Anonymous

Module:Sandbox/Shop: Difference between revisions

From Melvor Idle
no edit summary
No edit summary
No edit summary
 
Line 201: Line 201:
end
end


function p._getPurchaseContents(purchase, asList, notext)
function p._getPurchaseContents(purchase, asList, noText)
if asList == nil then asList = true end
if asList == nil then asList = true end
local noText = noText or nil
local containArray = {}
local containArray = {}
local GPTotal = 0
local GPTotal = 0
Line 217: Line 218:
local itemQty = itemLine.quantity
local itemQty = itemLine.quantity
if asList then
if asList then
table.insert(containArray, Icons.Icon({item.name, type='item', qty=itemQty, notext=notext}))
table.insert(containArray, Icons.Icon({item.name, type='item', qty=itemQty, notext=noText}))
else
else
if item.sellsForCurrency ~= nil then
if item.sellsForCurrency ~= nil then
Line 571: Line 572:
local namespace, localID = Shared.getLocalID(purchase.id)
local namespace, localID = Shared.getLocalID(purchase.id)
local source = nil
local source = nil
local showText = false
local notext = true


if purchase.contains.items ~= nil and Shared.tableCount(purchase.contains.items) > 1 then
if purchase.contains.items ~= nil and Shared.tableCount(purchase.contains.items) > 1 then
source = p._getPurchaseExpansionIcon(purchase) .. Common.getPurchaseIcon({purchase})
source = p._getPurchaseExpansionIcon(purchase) .. Common.getPurchaseIcon({purchase})
showText = true
notext = false
else
else
source = Icons.Icon({'Shop'}) .. ' Purchase'
source = Icons.Icon({'Shop'}) .. ' Purchase'
Line 584: Line 585:
['isAbyssal'] = namespace == 'melvorItA',
['isAbyssal'] = namespace == 'melvorItA',
['costs'] = p.getCostString(purchase.cost, false),
['costs'] = p.getCostString(purchase.cost, false),
['qty'] = p._getPurchaseContents(purchase, true, true),
['qty'] = p._getPurchaseContents(purchase, true, notext),
['source'] = source,
['source'] = source
['showText'] = showText
})
})
end
end