17,101
edits
(Update for v1.0.3) |
(getFoodNavbox: Actually hide lemon cake as intended) |
||
Line 21: | Line 21: | ||
local tier = item.tier | local tier = item.tier | ||
if seedsTable[tier] == nil then | if seedsTable[tier] == nil then | ||
-- | -- Initialize tier tables | ||
seedsTable[tier] = {} | seedsTable[tier] = {} | ||
produceTable[tier] = {} | produceTable[tier] = {} | ||
Line 82: | Line 82: | ||
-- Cooked food | -- Cooked food | ||
for i, recipe in ipairs(SkillData.Cooking.Recipes) do | for i, recipe in ipairs(SkillData.Cooking.Recipes) do | ||
foundIDs[recipe.itemID] = true | if not foundIDs[recipe.itemID] then | ||
foundIDs[recipe.itemID] = true | |||
local cookedItem = Items.getItemByID(recipe.itemID) | |||
if cookedItem ~= nil then | |||
local catIdx = recipe.category + 1 | |||
-- Initialize category if it doesn't already exist | |||
if cookedFood[catIdx] == nil then | |||
cookedFood[catIdx] = {} | |||
end | |||
local perfectName = nil | |||
if recipe.perfectCookID ~= nil then | |||
local perfectItem = Items.getItemByID(recipe.perfectCookID) | |||
if perfectItem ~= nil then | |||
perfectName = perfectItem.name | |||
foundIDs[recipe.perfectCookID] = true | |||
end | |||
end | end | ||
table.insert(cookedFood[catIdx], { ["name"] = cookedItem.name, ["order"] = recipe.level, ["perfectName"] = perfectName }) | |||
end | end | ||
end | end | ||
end | end | ||
Line 398: | Line 400: | ||
local addCatData = function(cat, catLink, itemName, itemOrder) | local addCatData = function(cat, catLink, itemName, itemOrder) | ||
if categoryItems[cat] == nil then | if categoryItems[cat] == nil then | ||
-- | -- Initialize category | ||
table.insert(categoryHeader, { ["name"] = cat, ["link"] = catLink }) | table.insert(categoryHeader, { ["name"] = cat, ["link"] = catLink }) | ||
categoryItems[cat] = {} | categoryItems[cat] = {} |