Module:Sandbox/User:Alsang/PotionList: Difference between revisions
implement "unkown" table format
(rename the SMW properties "Recipe XP", "Recipe KP", and "Recipe duration" to "Activity XP", "Activity KP", and "Activity duration" so they can generate the same fields as Template:Profession info) |
(implement "unkown" table format) |
||
Line 35:
-- makes the html for the cells containing currency directly, no tags needed
-- flag is for if the number should not be known, replaces with zero
local function currency_cell(amount
▲ a = currency._cell(amount, { html = 'yes' })
end
Line 103 ⟶ 97:
-- flags for if data values should be shown
item.hasLvl = param.has_content(item.lvl)
item.hasBuy = param.has_content(item.buy)
item.hasSell = param.has_content(item.sell)
Line 202 ⟶ 197:
out
:tag('tr')
:tag('td')
:css{ ['text-align'] = 'center' }
▲ :wikitext(item.lvl)
:wikitext(item.lvl)
:addClass('table-bg-grey')
:css{ ['text-align'] = 'center' }
:wikitext('unknown')
:END()
:done()
:tag('td')
:wikitext('[[File:' .. item.name .. '.png|30px|link=' .. item.name .. ']] [[' .. item.name .. ']]')
:done()
:tag('td')
:wikitext(reagentCell)
:done()
:wikitext(currency_cell(item.buy,item.hasBuy))▼
:
:wikitext(currency_cell(item.
:ELSE()
:wikitext(currency_cell(item.profitPerHour,item.hasProfit and item.hasDuration))▼
:addClass('table-bg-grey')
:attr{ colspan = '10' }
:css{ ['text-align'] = 'center' }
:wikitext('unknown')
:done()
:END()
:IF(item.hasSell)
-- I cannot for the life of me figure out why,
-- but if I put item.sell directly into this function it claims it has value nil
-- it works for other functions to display it directly
-- so here is the workaround I guess
:ELSE()
:tag('td')
:addClass('table-bg-grey')
:attr{ colspan = '10' }
:css{ ['text-align'] = 'center' }
:wikitext('unknown')
:done()
:END()
:IF(item.hasProfit)
:wikitext(currency_cell(item.profit))
:ELSE()
:tag('td')
:addClass('table-bg-grey')
:attr{ colspan = '10' }
:css{ ['text-align'] = 'center' }
:wikitext('unknown')
:done()
:END()
:IF(item.hasProfit and item.hasDuration)
:ELSE()
:tag('td')
:addClass('table-bg-grey')
:attr{ colspan = '10' }
:css{ ['text-align'] = 'center' }
:wikitext('unknown')
:done()
:END()
:tag('td')
:
:wikitext(item.XP)
:ELSE()
:addClass('table-bg-grey')
:css{ ['text-align'] = 'center' }
:wikitext('unknown')
:END()
:done()
:tag('td')
:
:wikitext(item.XPPerHour)
:ELSE()
:addClass('table-bg-grey')
:css{ ['text-align'] = 'center' }
:wikitext('unknown')
:END()
:done()
▲ :wikitext(currency_cell(item.profitPerXP,item.hasXP and item.hasProfit))
:IF(item.hasXP and item.hasProfit)
▲ --:tag('td')
:attr{ colspan = '10' }
▲ --:done()
:css{ ['text-align'] = 'center' }
:wikitext('unknown')
:done()
:END()
:done()
|