572
edits
No edit summary |
|||
Line 1: | Line 1: | ||
local Shared = require('Module:Shared') | local Shared = require('Module:Shared') | ||
local Icons = require('Module:Icons') | local Icons = require('Module:Icons') | ||
local GameData = require('Module:GameData') | |||
-- Data Module | -- Data Module | ||
Line 159: | Line 160: | ||
-- Returns a list of all the Township resources | -- Returns a list of all the Township resources | ||
function Data.Township.Resources() | function Data.Township.Resources() | ||
-- | |||
-- Get a sorted list of all the resources | |||
local Township = GameData.getSkillData('melvorD:Township') | |||
local resources = GameData.sortByOrderTable(Township.resources, Township.resourceDisplayOrder[1].ids) | |||
resources = Shared.clone(resources) | |||
-- Append the icon reference to each resource | |||
-- From https://melvoridle.com/assets/data/melvorFull.json -> data.skillData -> Township.data.resources.media | |||
local resource_icons = { | local resource_icons = { | ||
GP = { | ['melvorF:GP'] = {'Coins'}, | ||
Food = {'Raw Beef', type='item' | ['melvorF:Food'] = {'Raw Beef', type='item'}, | ||
Wood = {'Wood', type='resource' | ['melvorF:Wood'] = {'Wood', type='resource'}, | ||
Stone = {'Stone', type='resource' | ['melvorF:Stone'] = {'Stone', type='resource'}, | ||
Ore = {'Iron Ore', type='rock' | ['melvorF:Ore'] = {'Iron Ore', type='rock'}, | ||
Coal = {'Coal', type='resource' | ['melvorF:Coal'] = {'Coal', type='resource'}, | ||
Bar = {'Iron Bar', type='item' | ['melvorF:Bar'] = {'Iron Bar', type='item'}, | ||
Herbs = {'Garum Herb', type='item' | ['melvorF:Herbs'] = {'Garum Herb', type='item'}, | ||
Rune_Essence = {'Rune Essence', type='item' | ['melvorF:Rune_Essence'] = {'Rune Essence', type='item'}, | ||
Leather = {'Leather', type='item' | ['melvorF:Leather'] = {'Leather', type='item'}, | ||
Potions = {'Potion', type='resource' | ['melvorF:Potions'] = {'Potion', type='resource'}, | ||
Planks = {'Planks', type='resource' | ['melvorF:Planks'] = {'Planks', type='resource'}, | ||
Clothing = {'Leather Body', type='item' | ['melvorF:Clothing'] = {'Leather Body', type='item'} | ||
} | } | ||
for _, resource in ipairs(resources) do | |||
resource._icon = resource_icons[resource.id] | |||
resource._icon.notext = true | |||
resource._icon.nolink = true | |||
end | end | ||
return resources | |||
end | end | ||
edits