Module:MoneyMakingGuide: Difference between revisions

m
Fix exp value icon
(Add error display for invalid skill exp values)
m (Fix exp value icon)
Line 19: Line 19:
ita = icons.ItA()
ita = icons.ItA()
}
}
--- Formats a wikicode string to be bold and red
local function formatError(errorMessage)
local eror = mw.html.create('span')
:wikitext("'''")
:css('color', 'red')
:wikitext(errorMessage)
:wikitext("'''")
:done()
return tostring(error)
end


--- Formats a given string to TitleCase.
--- Formats a given string to TitleCase.
Line 45: Line 33:
local function getSkillExpIcon(skillName, expValue)
local function getSkillExpIcon(skillName, expValue)
if expValue == nil then error("expValue is nil") end
if expValue == nil then error("expValue is nil") end
local icon = icons.Icon({skillName, type='skill', notext=true})
expValue = num.formatnum(expValue)
expValue = num.formatnum(expValue)
return icons.Icon({
return icon .. ' ' .. expValue
skillName,
expValue,
type='skill',
nolink=true})
end
end


918

edits