Module:Shop: Difference between revisions

Add a manual exception to getSkillcapeTable to support the HP skillcapes being silly
(Fix buy limit game mode text, and add function to receive buy limits for certain game modes)
(Add a manual exception to getSkillcapeTable to support the HP skillcapes being silly)
Line 739: Line 739:
function p.getSkillcapeTable(frame)
function p.getSkillcapeTable(frame)
local skillName = frame.args ~= nil and frame.args[1] or frame
local skillName = frame.args ~= nil and frame.args[1] or frame
local capeList = p.getPurchases(function(purch) return Shared.contains({'melvorD:Skillcapes', 'melvorTotH:SuperiorSkillcapes'}, purch.category) and string.find(p._getPurchaseName(purch), skillName) end)
-- Exception for "HP Skillcape" + "Superior Hitpoints Skillcape"
local capeList = {}
if skillName == 'HP' or skillName == 'Hitpoints' then
capeList = p.getPurchases(function(purch) return Shared.contains({'melvorD:Skillcapes', 'melvorTotH:SuperiorSkillcapes'}, purch.category) and (p._getPurchaseName(purch) == 'HP Skillcape' or p._getPurchaseName(purch) == 'Superior Hitpoints Skillcape') end)
else
capeList = p.getPurchases(function(purch) return Shared.contains({'melvorD:Skillcapes', 'melvorTotH:SuperiorSkillcapes'}, purch.category) and string.find(p._getPurchaseName(purch), skillName) end)
end
if Shared.tableIsEmpty(capeList) then
if Shared.tableIsEmpty(capeList) then
return ''
return ''
73

edits