Anonymous

Module:Shop: Difference between revisions

From Melvor Idle
Added qty to getItemSourceArray/getItemCostArray to save time
(Added shop icon to purchase list)
(Added qty to getItemSourceArray/getItemCostArray to save time)
Line 151: Line 151:
         for k, costLine in Shared.skpairs(purchase.cost.items) do
         for k, costLine in Shared.skpairs(purchase.cost.items) do
           if costLine[1] == itemID then
           if costLine[1] == itemID then
             table.insert(purchaseArray, p.processPurchase(catName, j - 1))
             local temp = p.processPurchase(catName, j - 1)
            temp.qty = costLine[2]
            table.insert(purchaseArray, temp)
             break
             break
           end
           end
Line 170: Line 172:
         for k, containsLine in Shared.skpairs(purchase.contains.items) do
         for k, containsLine in Shared.skpairs(purchase.contains.items) do
           if containsLine [1] == itemID then
           if containsLine [1] == itemID then
             table.insert(purchaseArray, p.processPurchase(catName, j - 1))
             local temp = p.processPurchase(catName, j - 1)
            temp.qty = containsLine[2]
            table.insert(purchaseArray, temp)
             break
             break
           end
           end