4,951
edits
Falterfire (talk | contribs) (Moved getMiningOresTable here (from Module:Skills)) |
Falterfire (talk | contribs) (Testing new format for getAxeTable based on v0.19.1 code format) |
||
Line 3: | Line 3: | ||
local SkillData = mw.loadData('Module:Skills/data') | local SkillData = mw.loadData('Module:Skills/data') | ||
local Constants = require('Module:Constants') | |||
local Shared = require('Module:Shared') | local Shared = require('Module:Shared') | ||
local Items = require('Module:Items') | local Items = require('Module:Items') | ||
Line 10: | Line 10: | ||
function p.getAxeTable(frame) | function p.getAxeTable(frame) | ||
local axeArray = {} | |||
for i, upgrade in Shared.skpairs(SkillData.Shop.SkillUpgrades) do | |||
if Shared.contains(upgrade.name, 'Axe') then | |||
table.insert(axeArray, upgrade) | |||
end | |||
end | |||
local result = '{| class="wikitable sortable"' | local result = '{| class="wikitable sortable"' | ||
result = result..'\r\n|- class="headerRow-0"' | result = result..'\r\n|- class="headerRow-0"' | ||
result = result..'\r\n!colspan="2"|Name!!'..Icons.Icon({'Woodcutting', type='skill', notext=true})..' Level' | result = result..'\r\n!colspan="2"|Name!!'..Icons.Icon({'Woodcutting', type='skill', notext=true})..' Level' | ||
result = result..'!! | result = result..'!!Cost!!Description' | ||
for i, axe in Shared.skpairs( | for i, axe in Shared.skpairs(axeArray) do | ||
result = result..'\r\n|-' | |||
result = result..'\r\n|data-sort-value="'..axe.name..'"|'..Icons.Icon({axe.name, type='upgrade', size='50', notext=true}) | |||
result = result..'||[['..axe.name..']]' | |||
local level = 1 | |||
if axe.unlockRequirements ~= nil and axe.unlockRequirements.skillLevel ~= nil then | |||
--Gonna be lazy and assume there's only the one skill level and it's the one we care about | |||
level = axe.unlockRequirements.skillLevel[1][2] | |||
end | end | ||
result = result..'||style="text-align:right"|'..level | |||
result = result..'||style="text-align:right" data-sort-value="'..axe.cost.gp..'"|'..Icons.GP(axe.cost.gp) | |||
result = result..'||'..axe.description | |||
end | end | ||