Module:Items/ComparisonTables: Difference between revisions

getItemUpgradeTable: Include stat change column for potions, now that modifiers are included
(getStatChangeString: Move to Module:Items)
(getItemUpgradeTable: Include stat change column for potions, now that modifiers are included)
Line 454: Line 454:
end
end


local useStatChange = isEquipment or (string.upper(category) == 'POTION')
local resultPart = {}
local resultPart = {}
table.insert(resultPart, '{| class="wikitable sortable stickyHeader"')
table.insert(resultPart, '{| class="wikitable sortable stickyHeader"')
table.insert(resultPart, '\r\n|- class="headerRow-0"')
table.insert(resultPart, '\r\n|- class="headerRow-0"')
table.insert(resultPart, '\r\n!colspan="2"|Upgraded Item!!Ingredients')
table.insert(resultPart, '\r\n!colspan="2"|Upgraded Item!!Ingredients')
if isEquipment then table.insert(resultPart, '!!Stat Change') end
if useStatChange then table.insert(resultPart, '!!Stat Change') end


for i, upgrade in ipairs(upgradeArray) do
for i, upgrade in ipairs(upgradeArray) do
Line 472: Line 473:
if mat ~= nil then
if mat ~= nil then
table.insert(matArray, Icons.Icon({mat.name, type='item', qty=itemCost.quantity}))
table.insert(matArray, Icons.Icon({mat.name, type='item', qty=itemCost.quantity}))
if isEquipment and item.validSlots ~= nil and mat.validSlots ~= nil and statChangeString == '' then
if (isEquipment and item.validSlots ~= nil and mat.validSlots ~= nil) or (not isEquipment and useStatChange) and statChangeString == '' then
statChangeString = Items.getStatChangeString(item, mat)
statChangeString = Items.getStatChangeString(item, mat)
end
end
Line 485: Line 486:
table.insert(resultPart, '||'..table.concat(matArray, '<br/>'))
table.insert(resultPart, '||'..table.concat(matArray, '<br/>'))


if isEquipment then
if useStatChange then
table.insert(resultPart, '||'..statChangeString)
table.insert(resultPart, '||'..statChangeString)
end
end