2,875
edits
mNo edit summary |
(Add error display for invalid skill exp values) |
||
Line 145: | Line 145: | ||
for _, skillLine in pairs(skills) do | for _, skillLine in pairs(skills) do | ||
local hasInvalidExp = false | local hasInvalidExp = false | ||
local span = mw.html.create('div') | local span = mw.html.create('div') | ||
if skillLine.exp == nil or skillLine.exp | if skillLine.exp == nil or skillLine.exp <= 0 then | ||
hasInvalidExp = true | hasInvalidExp = true | ||
end | end | ||
local skillIcon = getSkillExpIcon(skillLine.name, skillLine.exp or 0) | local skillIcon = getSkillExpIcon(skillLine.name, skillLine.exp or 0) | ||
if | if hasInvalidExp then | ||
span:css('color', 'red') | |||
:wikitext('Skill in parameter ' .. skillLine.prmNumber .. " has an invalid experience value.") | |||
else | else | ||
span:wikitext(skillIcon) | span:wikitext(skillIcon) | ||
end | end | ||
table.insert(layoutLines, span) | table.insert(layoutLines, span) | ||
Line 286: | Line 280: | ||
items = "", | items = "", | ||
other = "", | other = "", | ||
skillExp1 = " | skillExp1 = "Maagic", | ||
skillExp1amount = "1000", | skillExp1amount = "-1000", | ||
skillExp2 = "Mining", | skillExp2 = "Mining", | ||
skillExp2amount = "420", | skillExp2amount = "420", |
edits