Module:Skills/Gathering: Difference between revisions

getRecipeRequirements: Support 'requirements' property of recipes. Also replaces the 'shopItemPurchased' property
(getFarmingPlotTable: Fix missing item costs & plot order)
(getRecipeRequirements: Support 'requirements' property of recipes. Also replaces the 'shopItemPurchased' property)
Line 6: Line 6:
local GameData = require('Module:GameData')
local GameData = require('Module:GameData')
local SkillData = GameData.skillData
local SkillData = GameData.skillData
local Common = require('Module:Common')
local Common = require('Module:Common')
local Common = require('Module:Common')
local Items = require('Module:Items')
local Items = require('Module:Items')
local Icons = require('Module:Icons')
local Icons = require('Module:Icons')
local Shop = require('Module:Shop')
local Skills = require('Module:Skills')
local Skills = require('Module:Skills')
local ItemSourceTables = require('Module:Items/SourceTables')
local ItemSourceTables = require('Module:Items/SourceTables')
Line 21: Line 21:
table.insert(reqText, Shared.formatnum(recipe.totalMasteryRequired) .. ' ' .. Icons.Icon({skillName, type='skill', notext=true}) .. ' ' .. Icons.Icon({'Mastery'}))
table.insert(reqText, Shared.formatnum(recipe.totalMasteryRequired) .. ' ' .. Icons.Icon({skillName, type='skill', notext=true}) .. ' ' .. Icons.Icon({'Mastery'}))
end
end
if recipe.shopItemPurchased ~= nil then
if type(recipe.requirements) == 'table' then
local purchReq = Shop.getPurchaseByID(recipe.shopItemPurchased)
local reqs = Common.getRequirementString(recipe.requirements)
if purchReq ~= nil then
if reqs ~= nil then
table.insert(reqText, Shop._getPurchaseIcon({purchReq}))
table.insert(reqText, reqs)
end
end
end
end