Module:Shop: Difference between revisions

Moved to generic getShopTable
(Created with initial shop tables)
 
(Moved to generic getShopTable)
Line 69: Line 69:
end
end


function p.getShopTable(Purchases)
function p._getShopTable(Purchases)
   local result = '{| class="wikitable sortable stickyHeader"'
   local result = '{| class="wikitable sortable stickyHeader"'
   result = result..'\r\n|- class="headerRow-0"'
   result = result..'\r\n|- class="headerRow-0"'
Line 103: Line 103:
end
end


function p.getShopSlayerTable(frame)
function p.getShopTable(frame)
   return p.getShopTable(ShopData.Shop.Slayer)
   local cat = frame.args ~= nil and frame.args[1] or frame
end
  local shopCat = ShopData.Shop[cat]
 
  if shopCat == nil then
function p.getShopMaterialTable(frame)
    return 'ERROR: Invalid category '..cat..'[[Category:Pages with script errors]]'
  return p.getShopTable(ShopData.Shop.Materials)
  else
end
    return p._getShopTable(shopCat)
 
   end
function p.getShopSkillUpgradeTable(frame)
   return p.getShopTable(ShopData.Shop.SkillUpgrades)
end
end


return p
return p