Anonymous

Module:Items: Difference between revisions

From Melvor Idle
Making GloveTable a module-level variable so I can move code to Items/SourceTables
(Attempting to move ItemUseTables out to fix API timeout issues. (NOTE: This will temporarily break Lots of Things))
(Making GloveTable a module-level variable so I can move code to Items/SourceTables)
Line 30: Line 30:
local AltMagicProducts = {'Rune Essence', 'Bones', 'Holy Dust'}
local AltMagicProducts = {'Rune Essence', 'Bones', 'Holy Dust'}
--The kinds of gloves with cost & charges
--The kinds of gloves with cost & charges
local GloveTable = {['Cooking Gloves'] = {cost=50000, charges=500},
p.GloveTable = {['Cooking Gloves'] = {cost=50000, charges=500},
                     ['Mining Gloves'] = {cost=75000, charges=500},
                     ['Mining Gloves'] = {cost=75000, charges=500},
                     ['Smithing Gloves'] = {cost=100000, charges=500},
                     ['Smithing Gloves'] = {cost=100000, charges=500},
Line 922: Line 922:
   elseif item.slayerCost ~= nil then
   elseif item.slayerCost ~= nil then
     table.insert(cost, Icons.SC(item.slayerCost))
     table.insert(cost, Icons.SC(item.slayerCost))
   elseif GloveTable[item.name] ~= nil then
   elseif p.GloveTable[item.name] ~= nil then
     table.insert(cost, Icons.GP(GloveTable[item.name].cost))
     table.insert(cost, Icons.GP(p.GloveTable[item.name].cost))
     qty = ' +'..Shared.formatnum(GloveTable[item.name].charges)..' Charges'
     qty = ' +'..Shared.formatnum(p.GloveTable[item.name].charges)..' Charges'
   end
   end
   if item.buysForLeather ~= nil then  
   if item.buysForLeather ~= nil then