Module:Sandbox/User:Alsang/PotionList: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
(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: | Line 35: | ||
-- makes the html for the cells containing currency directly, no tags needed |
-- 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 |
-- flag is for if the number should not be known, replaces with zero |
||
local function currency_cell(amount |
local function currency_cell(amount) |
||
⚫ | |||
local a = {} |
|||
if flag then |
|||
⚫ | |||
else |
|||
a = currency._cell(0, { html = 'yes' }) -- replace this with blank, if I can figure out how to |
|||
end |
|||
return a |
|||
end |
end |
||
Line 103: | Line 97: | ||
-- flags for if data values should be shown |
-- flags for if data values should be shown |
||
item.hasLvl = param.has_content(item.lvl) |
|||
item.hasBuy = param.has_content(item.buy) |
item.hasBuy = param.has_content(item.buy) |
||
item.hasSell = param.has_content(item.sell) |
item.hasSell = param.has_content(item.sell) |
||
Line 202: | Line 197: | ||
out |
out |
||
:tag('tr') |
:tag('tr') |
||
:tag('td') |
:tag('td') |
||
⚫ | |||
:css{ ['text-align'] = 'center' } |
:css{ ['text-align'] = 'center' } |
||
⚫ | |||
:wikitext(item.lvl) |
|||
⚫ | |||
:addClass('table-bg-grey') |
|||
:css{ ['text-align'] = 'center' } |
|||
:wikitext('unknown') |
|||
:END() |
|||
:done() |
:done() |
||
:tag('td') |
:tag('td') |
||
:wikitext('[[File:' .. item.name .. '.png|30px|link=' .. item.name .. ']] [[' .. item.name .. ']]') |
:wikitext('[[File:' .. item.name .. '.png|30px|link=' .. item.name .. ']] [[' .. item.name .. ']]') |
||
:done() |
:done() |
||
:tag('td') |
:tag('td') |
||
:wikitext(reagentCell) |
:wikitext(reagentCell) |
||
:done() |
:done() |
||
⚫ | |||
: |
:IF(item.hasBuy) |
||
:wikitext(currency_cell(item. |
:wikitext(currency_cell(item.buy)) |
||
:ELSE() |
|||
⚫ | |||
⚫ | |||
: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') |
:tag('td') |
||
: |
:IF(item.hasXP) |
||
:wikitext(item.XP) |
|||
:ELSE() |
|||
:addClass('table-bg-grey') |
|||
:css{ ['text-align'] = 'center' } |
|||
:wikitext('unknown') |
|||
:END() |
|||
:done() |
:done() |
||
:tag('td') |
:tag('td') |
||
: |
:IF(item.hasXP and item.hasDuration) |
||
:wikitext(item.XPPerHour) |
|||
:ELSE() |
|||
:addClass('table-bg-grey') |
|||
:css{ ['text-align'] = 'center' } |
|||
:wikitext('unknown') |
|||
:END() |
|||
:done() |
:done() |
||
⚫ | |||
:IF(item.hasXP and item.hasProfit) |
|||
⚫ | |||
:wikitext(currency_cell(item.profitPerXP)) |
|||
:ELSE() |
|||
:tag('td') |
|||
:addClass('table-bg-grey') |
|||
:attr{ colspan = '10' } |
|||
⚫ | |||
:css{ ['text-align'] = 'center' } |
|||
:wikitext('unknown') |
|||
:done() |
|||
:END() |
|||
:done() |
:done() |
||