12,704
edits
(Substitute links with Icons.Icon() where possible to benefit from ambiguous link handling) |
(getShopMiscUpgradeTable: Include requirements column) |
||
(One intermediate revision by the same user not shown) | |||
Line 2: | Line 2: | ||
local ShopData = mw.loadData('Module:Shop/data') | local ShopData = mw.loadData('Module:Shop/data') | ||
-- Data instead of Module:CombatAreas to avoid loop whne that module attempts to require Module:Shop | |||
local AreaData = require('Module:CombatAreas/data') | |||
local Shared = require('Module:Shared') | local Shared = require('Module:Shared') | ||
Line 7: | Line 9: | ||
local Icons = require('Module:Icons') | local Icons = require('Module:Icons') | ||
local Constants = require('Module:Constants') | local Constants = require('Module:Constants') | ||
-- Overrides for various items, mostly relating to icon overrides | -- Overrides for various items, mostly relating to icon overrides | ||
Line 127: | Line 128: | ||
if reqs.dungeonCompletion ~= nil then | if reqs.dungeonCompletion ~= nil then | ||
for i, dungReq in Shared.skpairs(reqs.dungeonCompletion) do | for i, dungReq in Shared.skpairs(reqs.dungeonCompletion) do | ||
local dung = | local dung = AreaData['dungeons'][dungReq[1] + 1] | ||
local dungStr = 'Complete '..Icons.Icon({dung.name, type='dungeon'}) | local dungStr = 'Complete '..Icons.Icon({dung.name, type='dungeon'}) | ||
if dungReq[2] > 1 then | if dungReq[2] > 1 then | ||
Line 268: | Line 269: | ||
local headerPropsDefault = { | local headerPropsDefault = { | ||
["Purchase"] = 'colspan="2"', | ["Purchase"] = 'colspan="2"', | ||
["Cost"] = 'style="min-width: | ["Cost"] = 'style="min-width:100px"' | ||
} | } | ||
local usedColumns, purchHeader, sortOrder, headerProps = {}, 'Purchase', nil, {} | local usedColumns, purchHeader, sortOrder, headerProps = {}, 'Purchase', nil, {} | ||
Line 502: | Line 503: | ||
function p.getShopMiscUpgradeTable() | function p.getShopMiscUpgradeTable() | ||
local purchList = p.getPurchases(function(cat, purch) return cat == 'General' and string.find(purch.name, '^Auto Eat') == nil end) | local purchList = p.getPurchases(function(cat, purch) return cat == 'General' and string.find(purch.name, '^Auto Eat') == nil end) | ||
return p._getShopTable(purchList, { columns = { 'Purchase', 'Description', 'Cost' }, purchaseHeader = 'Upgrade' }) | return p._getShopTable(purchList, { columns = { 'Purchase', 'Description', 'Cost', 'Requirements' }, purchaseHeader = 'Upgrade' }) | ||
end | end | ||
Line 561: | Line 562: | ||
if reqs.dungeonCompletion ~= nil then | if reqs.dungeonCompletion ~= nil then | ||
for i, areaReq in ipairs(reqs.dungeonCompletion) do | for i, areaReq in ipairs(reqs.dungeonCompletion) do | ||
local dung = | local dung = AreaData['dungeons'][areaReq[1] + 1] | ||
if string.find(dung.name, 'God Dungeon$') ~= nil then return dung end | if string.find(dung.name, 'God Dungeon$') ~= nil then return dung end | ||
end | end |