Anonymous

Module:Shop: Difference between revisions

From Melvor Idle
getRequirementString: Support 'ShopPurchase' requirement
(Further fixes & support for itemCharges contents)
(getRequirementString: Support 'ShopPurchase' requirement)
Line 218: Line 218:
                 end
                 end
             end
             end
        elseif req.type == 'ShopPurchase' then
        local shopPurch = p.getPurchaseByID(req.purchaseID)
        if shopPurch ~= nil then
        table.insert(reqArray, p._getPurchaseIcon({shopPurch}) .. ' Purchased')
        end
         elseif req.type == 'Completion' then
         elseif req.type == 'Completion' then
             local ns = GameData.getEntityByID('namespaces', req.namespace)
             local ns = GameData.getEntityByID('namespaces', req.namespace)
Line 391: Line 396:


if purchase == nil then
if purchase == nil then
return "ERROR: Couldn't find purchase with name '" .. purchaseName .. "'[[Category:Pages with script errors]]"
return "ERROR: Couldn't find purchase with name '" .. tostring(purchaseName) .. "'[[Category:Pages with script errors]]"
else
else
args[1] = purchase
args[1] = purchase