17,101
edits
m (Formatting tweaks) |
(Update for v1.0.2) |
||
Line 27: | Line 27: | ||
section = 'AltMagic' | section = 'AltMagic' | ||
end | end | ||
name = Shared.fixPagename(name) | name = Shared.fixPagename(name) | ||
if section == nil then | if section == nil then | ||
Line 59: | Line 59: | ||
section = 'AltMagic' | section = 'AltMagic' | ||
end | end | ||
if MagicData[section] ~= nil then | if MagicData[section] ~= nil then | ||
return processSpell(section, id + 1) | return processSpell(section, id + 1) | ||
Line 107: | Line 107: | ||
function p._getSpellRunes(spell) | function p._getSpellRunes(spell) | ||
local | local formatRuneList = function(runes) | ||
local runeList = {} | |||
for i, req in ipairs(runes) do | |||
local rune = Items.getItemByID(req.id) | |||
if rune ~= nil then | |||
table.insert(runeList, Icons.Icon({rune.name, type='item', notext=true, qty=req.qty})) | |||
if spell.runesRequiredAlt ~= nil and not Shared.tablesEqual(spell.runesRequired, spell.runesRequiredAlt) then | end | ||
end | |||
return table.concat(runeList, ', ') | |||
end | |||
if type(spell.runesRequired) == 'table' then | |||
local resultPart = {} | |||
table.insert(resultPart, formatRuneList(spell.runesRequired)) | |||
if spell.runesRequiredAlt ~= nil and not Shared.tablesEqual(spell.runesRequired, spell.runesRequiredAlt) then | |||
table.insert(resultPart, "<br/>'''OR'''<br/>" .. formatRuneList(spell.runesRequiredAlt)) | |||
end | end | ||
return table.concat(resultPart) | |||
else | |||
return '' | |||
end | end | ||
end | end | ||
Line 236: | Line 241: | ||
end | end | ||
end | end | ||
table.sort(spellList, function(a, b) | table.sort(spellList, function(a, b) | ||
if a.type ~= b.type then | if a.type ~= b.type then | ||
return p.getSpellTypeIndex(a.type) < p.getSpellTypeIndex(b.type) | return p.getSpellTypeIndex(a.type) < p.getSpellTypeIndex(b.type) | ||
Line 318: | Line 323: | ||
end | end | ||
if p.getSpellTypeIndex(spell.type) == 4 then | if p.getSpellTypeIndex(spell.type) == 4 then | ||
rowTxt = rowTxt..'||'..spell. | rowTxt = rowTxt..'||'..spell.baseExperience | ||
end | end | ||
rowTxt = rowTxt..'||style="text-align:center"|' | rowTxt = rowTxt..'||style="text-align:center"|' |