Module:Experience/table: Difference between revisions
Show xp per label in captions
(Created page with "require('strict') require('Module:Mw.html extension') local data = mw.loadData('Module:Experience/data') local yesno = require('Module:Yesno') local lang = mw.language.getContentLanguage() local p = {} function p.main(frame) local args = frame:getParent().args local default_collapsed = yesno(args.collapsed) local collapsed = {} for _, label in ipairs(data.labels) do local this_collapsed = yesno(template_args['collapsed-' .. label.name:tolower()]) if this_colla...") |
(Show xp per label in captions) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 13:
for _, label in ipairs(data.labels) do
local this_collapsed = yesno(
if this_collapsed == nil then
this_collapsed = default_collapsed
Line 40:
:addClass(collapsed[label.name] and 'mw-collapsed' or nil)
:tag('caption')
:wikitext((label.min == label.max and '%s (%s)' or '%s (%s-%s; %s XP)'):format(label.name, label.min, label.max, lang:formatNum((data.level[label.max + 1] or 0) - data.level[label.min])))
:done()
:tag('tr')
Line 77:
:done()
:tag('td')
:wikitext(lang:formatNum(data.level[level]))
:done()
:node(next_level_node)
|