Anonymous

Module:Shop: Difference between revisions

From Melvor Idle
m
Include a third `notext` parameter in _getPurchaseContents to hide icon text; Add Ancient Relics to the list of gamemodes with an icon
m (Remove % suffix from sight/survey range)
m (Include a third `notext` parameter in _getPurchaseContents to hide icon text; Add Ancient Relics to the list of gamemodes with an icon)
 
Line 201: Line 201:
end
end


function p._getPurchaseContents(purchase, asList)
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 220: Line 221:
end
end
if asList then
if asList then
table.insert(containArray, Icons.Icon({item.name, type='item', qty=itemQty}))
table.insert(containArray, Icons.Icon({item.name, type='item', qty=itemQty, notext=notext}))
else
else
local GPVal = item.sellsFor * itemQty
local GPVal = item.sellsFor * itemQty
Line 288: Line 289:
-- The limit varies depending on game mode
-- The limit varies depending on game mode
local limitTable = {}
local limitTable = {}
local gamemodeHasIcon = { 'melvorF:Hardcore', 'melvorF:Adventure' }
local gamemodeHasIcon = { 'melvorF:Hardcore', 'melvorF:Adventure', 'melvorAoD:AncientRelics' }
for i, buyLimit in ipairs(purchase.buyLimitOverrides) do
for i, buyLimit in ipairs(purchase.buyLimitOverrides) do
local gamemode = GameData.getEntityByID('gamemodes', buyLimit.gamemodeID)
local gamemode = GameData.getEntityByID('gamemodes', buyLimit.gamemodeID)