Module:Shop: Difference between revisions

115 bytes removed ,  21 February 2022
_getPurchaseContents: Ensure GP alignment is left in all cases
m (Woops hehe :3)
(_getPurchaseContents: Ensure GP alignment is left in all cases)
Line 199: Line 199:
table.insert(containArray, '|-\r\n| style="min-width:25px"| ' .. Icons.Icon({item.name, type='item', notext=true, size='25'}))
table.insert(containArray, '|-\r\n| style="min-width:25px"| ' .. Icons.Icon({item.name, type='item', notext=true, size='25'}))
table.insert(containArray, '| ' .. Icons.Icon({item.name, type='item', noicon=true}) .. '\r\n| data-sort-value="' .. itemLine[2] .. '" style="text-align:right" | ' .. Shared.formatnum(itemLine[2]))
table.insert(containArray, '| ' .. Icons.Icon({item.name, type='item', noicon=true}) .. '\r\n| data-sort-value="' .. itemLine[2] .. '" style="text-align:right" | ' .. Shared.formatnum(itemLine[2]))
table.insert(containArray, '| style="text-align:left;" data-sort-value="' .. GPVal .. '"| ' .. Icons.GP(GPVal))
table.insert(containArray, '| data-sort-value="' .. GPVal .. '"| ' .. Icons.GP(GPVal))
end
end
end
end
Line 209: Line 209:
table.insert(containArray, '|-\r\n| style="min-width:25px"| ' .. Icons.Icon({purchase.name, type='item', notext=true, size='25'}))
table.insert(containArray, '|-\r\n| style="min-width:25px"| ' .. Icons.Icon({purchase.name, type='item', notext=true, size='25'}))
table.insert(containArray, '| ' .. Icons.Icon({purchase.name, type='item', noicon=true}) .. ' Charges\r\n| data-sort-value="' .. purchase.charges .. '" style="text-align:right" | ' .. Shared.formatnum(purchase.charges))
table.insert(containArray, '| ' .. Icons.Icon({purchase.name, type='item', noicon=true}) .. ' Charges\r\n| data-sort-value="' .. purchase.charges .. '" style="text-align:right" | ' .. Shared.formatnum(purchase.charges))
table.insert(containArray, '| style="text-align:right; data-sort-value="0"| ' .. Icons.GP(0))
table.insert(containArray, '| data-sort-value="0"| ' .. Icons.GP(0))
end
end
end
end
if not asList and Shared.tableCount(containArray) > 0 then
if not asList and Shared.tableCount(containArray) > 0 then
table.insert(containArray, '|- class="sortbottom"\r\n! colspan="3"| Total\r\n| style="text-align:right;"| ' .. Icons.GP(GPTotal) .. '\r\n|}')
table.insert(containArray, '|- class="sortbottom"\r\n! colspan="3"| Total\r\n| ' .. Icons.GP(GPTotal) .. '\r\n|}')
end
end


Line 229: Line 229:
return "ERROR: Couldn't find purchase with name '" .. purchaseName .. "'[[Category:Pages with script errors]]"
return "ERROR: Couldn't find purchase with name '" .. purchaseName .. "'[[Category:Pages with script errors]]"
else
else
return p._getPurchaseContents(purchase, asList) .. '[[Category:GetPurchaseContents]]'
return p._getPurchaseContents(purchase, asList)
end
end
end
end