Module:StonemasonPassiveList: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
m (remove merchant hide module)
m (hide broken image links in table)
Line 118: Line 118:
item.XPPerHour = item.XP and item.productPerHour and math.floor(item.XP * item.productPerHour)
item.XPPerHour = item.XP and item.productPerHour and math.floor(item.XP * item.productPerHour)
item.profitPerHour = item.profit and item.productPerHour and math.floor(item.profit * item.productPerHour)
item.profitPerHour = item.profit and item.productPerHour and math.floor(item.profit * item.productPerHour)
-- testing something that will stop broken image links appearing
local imgQuery = mw.smw.ask('[[File:' .. item.name .. '.png]]|?Modification date #- =data|mainlabel=-')
item.imgResult = imgQuery and imgQuery[1] and imgQuery[1].data
end
end


Line 189: Line 193:
:tag('td')
:tag('td')
:addClass('plinkt-image no-border')
:addClass('plinkt-image no-border')
:css{ ['border-left'] = '0', ['padding-left'] = '0' }
:css{ ['border-left'] = '0', ['padding-left'] = '0' }
:IF(item.imgResult)
:wikitext('[[File:' .. item.name .. '.png|link=' .. item.name .. '|30px]]')
:wikitext('[[File:' .. item.name .. '.png|link=' .. item.name .. '|30px]]')
:END()
:done()
:done()
:tag('td')
:tag('td')
Line 202: Line 208:
for i, _ in ipairs(item.materials) do
for i, _ in ipairs(item.materials) do
materialCell:wikitext(item.materials[i].quantity .. '&times; [[File:' .. item.materials[i].name .. '.png|30px|link=' .. item.materials[i].name .. ']]' .. '[[' .. item.materials[i].name .. ']]<br>')
materialCell:wikitext(item.materials[i].quantity .. '&times; [[File:' .. item.materials[i].name .. '.png|30x30px|link=' .. item.materials[i].name .. ']]' .. '[[' .. item.materials[i].name .. ']]<br>')
end
end