12,721
edits
m (Align GP value left instead of right) |
m (Fix typo) |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 3: | Line 3: | ||
local ShopData = mw.loadData('Module:Shop/data') | local ShopData = mw.loadData('Module:Shop/data') | ||
local ConstantData = mw.loadData('Module:Constants/data') | local ConstantData = mw.loadData('Module:Constants/data') | ||
-- Data instead of Module:CombatAreas to avoid loop | -- Data instead of Module:CombatAreas to avoid loop when that module attempts to require Module:Shop | ||
local AreaData = require('Module:CombatAreas/data') | local AreaData = require('Module:CombatAreas/data') | ||
Line 55: | Line 55: | ||
elseif stat == 'type' then | elseif stat == 'type' then | ||
return p._getPurchaseType(purchase) | return p._getPurchaseType(purchase) | ||
elseif stat == 'buyLimit' then | |||
return p._getPurchaseBuyLimit(purchase, not displayInline) | |||
else | else | ||
return purchase[stat] | return purchase[stat] | ||
Line 209: | Line 211: | ||
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, '| | 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 | table.insert(containArray, '|- class="sortbottom"\r\n! colspan="3"| Total\r\n| ' .. Icons.GP(GPTotal) .. '\r\n|}') | ||
end | end | ||
Line 229: | Line 231: | ||
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) | return p._getPurchaseContents(purchase, asList) | ||
end | end | ||
end | end |