From 40c7f5cb366a4b98b10bf11662086aca306d12ee Mon Sep 17 00:00:00 2001 From: torhal Date: Mon, 1 Feb 2010 10:31:22 +0000 Subject: [PATCH] Renamed almost every member of a recipe table for clarity of purpose and changed all occurrences from recipe["Level"] to recipe.skill_level (for example). Retained original naming and usage of "Display", "Search", "Flags", and "Acquire" until I decide what to do with them. --- ARL.lua | 128 +++++++++++++++++++++++++++++----------------------------- Datamine.lua | 55 ++++++++++++------------- Frame.lua | 68 +++++++++++++++---------------- Player.lua | 4 +- 4 files changed, 127 insertions(+), 128 deletions(-) diff --git a/ARL.lua b/ARL.lua index 722137e..7c22f2a 100644 --- a/ARL.lua +++ b/ARL.lua @@ -487,12 +487,12 @@ function addon:OnInitialize() if mob and mob["DropList"] then for spell_id in pairs(mob["DropList"]) do local recipe = RecipeList[spell_id] - local skill_level = Player["Professions"][GetSpellInfo(recipe["Profession"])] + local skill_level = Player["Professions"][GetSpellInfo(recipe.profession)] - if skill_level and not recipe["Known"] or shifted then - local _, _, _, hex = GetItemQualityColor(recipe["Rarity"]) + if skill_level and not recipe.is_known or shifted then + local _, _, _, hex = GetItemQualityColor(recipe.quality) - self:AddLine("Drops: "..hex..recipe["Name"].."|r ("..recipe["Level"]..")") + self:AddLine("Drops: "..hex..recipe.name.."|r ("..recipe.skill_level..")") end end return @@ -502,17 +502,17 @@ function addon:OnInitialize() if vendor and vendor["SellList"] then for spell_id in pairs(vendor["SellList"]) do local recipe = RecipeList[spell_id] - local recipe_prof = GetSpellInfo(recipe["Profession"]) + local recipe_prof = GetSpellInfo(recipe.profession) local scanned = Player["Scanned"][recipe_prof] if scanned then local skill_level = Player["Professions"][recipe_prof] - local has_level = skill_level and (type(skill_level) == "boolean" and true or skill_level >= recipe["Level"]) + local has_level = skill_level and (type(skill_level) == "boolean" and true or skill_level >= recipe.skill_level) - if ((not recipe["Known"] and has_level) or shifted) and Player:IsCorrectFaction(recipe["Flags"]) then - local _, _, _, hex = GetItemQualityColor(recipe["Rarity"]) + if ((not recipe.is_known and has_level) or shifted) and Player:IsCorrectFaction(recipe["Flags"]) then + local _, _, _, hex = GetItemQualityColor(recipe.quality) - self:AddLine("Sells: "..hex..recipe["Name"].."|r ("..recipe["Level"]..")") + self:AddLine("Sells: "..hex..recipe.name.."|r ("..recipe.skill_level..")") end end end @@ -523,17 +523,17 @@ function addon:OnInitialize() if trainer and trainer["TrainList"] then for spell_id in pairs(trainer["TrainList"]) do local recipe = RecipeList[spell_id] - local recipe_prof = GetSpellInfo(recipe["Profession"]) + local recipe_prof = GetSpellInfo(recipe.profession) local scanned = Player["Scanned"][recipe_prof] if scanned then local skill_level = Player["Professions"][recipe_prof] - local has_level = skill_level and (type(skill_level) == "boolean" and true or skill_level >= recipe["Level"]) + local has_level = skill_level and (type(skill_level) == "boolean" and true or skill_level >= recipe.skill_level) - if ((not recipe["Known"] and has_level) or shifted) and Player:IsCorrectFaction(recipe["Flags"]) then - local _, _, _, hex = GetItemQualityColor(recipe["Rarity"]) + if ((not recipe.is_known and has_level) or shifted) and Player:IsCorrectFaction(recipe["Flags"]) then + local _, _, _, hex = GetItemQualityColor(recipe.quality) - self:AddLine("Trains: "..hex..recipe["Name"].."|r ("..recipe["Level"]..")") + self:AddLine("Trains: "..hex..recipe.name.."|r ("..recipe.skill_level..")") end end end @@ -846,27 +846,26 @@ end --- Adds a tradeskill recipe into the specified recipe database. -- @name AckisRecipeList:addTradeSkill -- @usage AckisRecipeList:addTradeSkill(RecipeDB,2329,1,2454,1,2259,0,1,55,75,95) --- @param RecipeDB The database (array) which you wish to add data too. --- @param SpellID The [[http://www.wowwiki.com/SpellLink | Spell ID]] of the recipe being added to the database. --- @param SkillLevel The skill level at which the recipe may be learned. --- @param ItemID The [[http://www.wowwiki.com/ItemLink | Item ID]] that is created by the recipe, or nil --- @param Rarity The rarity of the recipe. --- @param Profession The profession ID that uses the recipe. See [[database-documentation]] for a listing of profession IDs. --- @param Specialty The specialty that uses the recipe (ie: goblin engineering) or nil or blank --- @param Game Game version recipe was found in, for example, Original, BC, or Wrath. --- @param Orange Level at which recipe is considered orange. --- @param Yellow Level at which recipe is considered yellow. --- @param Green Level at which recipe is considered green. --- @param Grey Level at which recipe is considered grey. +-- @param RecipeDB The database table which you wish to add data too. +-- @param spell_id The [[http://www.wowwiki.com/SpellLink | Spell ID]] of the recipe being added to the database. +-- @param skill_level The skill level at which the recipe may be learned. +-- @param item_id The [[http://www.wowwiki.com/ItemLink | Item ID]] that is created by the recipe, or nil +-- @param quality The quality/rarity of the recipe. +-- @param profession The profession ID that uses the recipe. See [[database-documentation]] for a listing of profession IDs. +-- @param specialty The specialty that uses the recipe (ie: goblin engineering) or nil or blank +-- @param genesis Game version recipe was found in, for example, Original, BC, or Wrath. +-- @param optimal_level Level at which recipe is considered orange. +-- @param medium_level Level at which recipe is considered yellow. +-- @param easy_level Level at which recipe is considered green. +-- @param trivial_level Level at which recipe is considered grey. -- @return None, array is passed as a reference. -function addon:addTradeSkill(RecipeDB, SpellID, SkillLevel, ItemID, Rarity, Profession, Specialty, Game, Orange, Yellow, Green, Grey) - local spellLink = GetSpellLink(SpellID) - local profession_id = GetSpellInfo(Profession) - local recipe_name = GetSpellInfo(SpellID) +function addon:addTradeSkill(RecipeDB, spell_id, skill_level, item_id, quality, profession, specialty, genesis, optimal_level, medium_level, easy_level, trivial_level) + local profession_id = GetSpellInfo(profession) + local recipe_name = GetSpellInfo(spell_id) - if RecipeDB[SpellID] then + if RecipeDB[spell_id] then --@alpha@ - self:Print("Duplicate recipe: "..profession_id.." "..tostring(SpellID).." "..recipe_name) + self:Print("Duplicate recipe: "..profession_id.." "..tostring(spell_id).." "..recipe_name) --@end-alpha@ return end @@ -875,35 +874,34 @@ function addon:addTradeSkill(RecipeDB, SpellID, SkillLevel, ItemID, Rarity, Prof -- Create a table inside the RecipeListing table which stores all information -- about a recipe ------------------------------------------------------------------------------- - RecipeDB[SpellID] = { - ["Level"] = SkillLevel, - ["ItemID"] = ItemID, - ["Rarity"] = Rarity, - ["Profession"] = profession_id, - ["Locations"] = nil, - ["RecipeLink"] = spellLink, - ["Name"] = recipe_name, - ["Display"] = true, -- Set to be displayed until the filtering occurs - ["Search"] = true, -- Set to be showing in the search results - ["Flags"] = {}, -- Create the flag space in the RecipeDB - ["Acquire"] = {}, -- Create the Acquire space in the RecipeDB - ["Specialty"] = Specialty, -- Assumption: there will only be 1 speciality for a trade skill - ["Game"] = Game, - ["Orange"] = Orange or SkillLevel, -- If we don't have an orange value in the db, just assume the skill level - ["Yellow"] = Yellow or SkillLevel + 10, -- If we don't have a yellow value in the db, just assume the skill level - ["Green"] = Green or SkillLevel + 15, -- If we don't have a green value in the db, just assume the skill level - ["Grey"] = Grey or SkillLevel + 20, -- If we don't have a grey value in the db, just assume the skill level + local recipe = { + ["skill_level"] = skill_level, + ["item_id"] = item_id, + ["quality"] = quality, + ["profession"] = profession_id, + ["spell_link"] = GetSpellLink(spell_id), + ["name"] = recipe_name, + ["Display"] = true, -- Set to be displayed until the filtering occurs + ["Search"] = true, -- Set to be showing in the search results + ["Flags"] = {}, -- Create the flag space in the RecipeDB + ["Acquire"] = {}, -- Create the Acquire space in the RecipeDB + ["specialty"] = specialty, -- Assumption: there will only be 1 speciality for a trade skill + ["genesis"] = genesis, + ["optimal_level"] = optimal_level or skill_level, + ["medium_level"] = medium_level or skill_level + 10, + ["easy_level"] = easy_level or skill_level + 15, + ["trivial_level"] = trivial_level or skill_level + 20, } - local recipe = RecipeDB[SpellID] - if not recipe["Name"] then - self:Print(strformat(L["SpellIDCache"], SpellID)) + if not recipe.name then + self:Print(strformat(L["SpellIDCache"], spell_id)) end -- Set all the flags to be false, will also set the padding spaces to false as well. for i = 1, NUM_FILTER_FLAGS, 1 do recipe["Flags"][i] = false end + RecipeDB[spell_id] = recipe end --- Adds filtering flags to a specific tradeskill. @@ -1090,7 +1088,7 @@ do end -- Populate the location field with all the data table.sort(location_list, LocationSort) - DB[SpellID]["Locations"] = (#location_list == 0 and "" or tconcat(location_list, ", ")) + DB[SpellID].locations = (#location_list == 0 and "" or tconcat(location_list, ", ")) end end -- do block @@ -1196,20 +1194,20 @@ do end -- Display all skill levels? - if not general_filters.skill and recipe["Level"] > Player["ProfessionLevel"] then + if not general_filters.skill and recipe.skill_level > Player["ProfessionLevel"] then return false end -- Display all specialities? if not general_filters.specialty then - local specialty = recipe["Specialty"] + local specialty = recipe.specialty if specialty and specialty ~= Player["Specialty"] then return false end end local obtain_filters = filter_db.obtain - local game_version = recipe["Game"] + local game_version = recipe.genesis -- Filter out game recipes if not obtain_filters.originalwow and game_version == GAME_ORIG then @@ -1421,8 +1419,8 @@ do local current_profession = Player["Profession"] for recipe_id, recipe in pairs(RecipeList) do - if recipe["Profession"] == current_profession then - local is_known = recipe["Known"] + if recipe.profession == current_profession then + local is_known = recipe.is_known can_display = CanDisplayRecipe(recipe) recipes_total = recipes_total + 1 @@ -1560,7 +1558,7 @@ do --- Set the known flag to false for every recipe in the database. for SpellID in pairs(RecipeList) do - RecipeList[SpellID]["Known"] = false + RecipeList[SpellID].is_known = false end ------------------------------------------------------------------------------- @@ -1608,7 +1606,7 @@ do local recipe = RecipeList[tonumber(SpellString)] if recipe then - recipe["Known"] = true + recipe.is_known = true recipes_found = recipes_found + 1 else self:Print(self:Red(tradeName .. " " .. SpellString) .. self:White(L["MissingFromDB"])) @@ -1794,15 +1792,15 @@ do tinsert(text_table, "Spell ID,Recipe Name,Skill Level,ARL Filter Flags,Acquire Methods,Known\n") for SpellID in pairs(RecipeDB) do - local recipe_prof = GetSpellInfo(RecipeDB[SpellID]["Profession"]) + local recipe_prof = GetSpellInfo(RecipeDB[SpellID].profession) if recipe_prof == profession then -- Add Spell ID, Name and Skill Level to the list tinsert(text_table, SpellID) tinsert(text_table, ",") - tinsert(text_table, RecipeDB[SpellID]["Name"]) + tinsert(text_table, RecipeDB[SpellID].name) tinsert(text_table, ",") - tinsert(text_table, RecipeDB[SpellID]["Level"]) + tinsert(text_table, RecipeDB[SpellID].skill_level) tinsert(text_table, ",\"") -- Add in all the filter flags @@ -1842,7 +1840,7 @@ do prev = true end - if (RecipeDB[SpellID]["Known"]) then + if RecipeDB[SpellID].is_known then tinsert(text_table, "\",true\n") else tinsert(text_table, "\",false\n") diff --git a/Datamine.lua b/Datamine.lua index 4bde869..8594ddc 100644 --- a/Datamine.lua +++ b/Datamine.lua @@ -1065,8 +1065,8 @@ do twipe(reverse_lookup) for i in pairs(recipe_list) do - --if t[recipe_list[i]["Name"]] then addon:Print("Dupe: " .. i) end - reverse_lookup[recipe_list[i]["Name"]] = i + --if t[recipe_list[i].name] then addon:Print("Dupe: " .. i) end + reverse_lookup[recipe_list[i].name] = i end return reverse_lookup @@ -1127,11 +1127,11 @@ do twipe(output) for i in pairs(recipe_list) do - local i_name = recipe_list[i]["Name"] + local i_name = recipe_list[i].name - if info[i_name] and info[i_name] ~= recipe_list[i]["Level"] then + if info[i_name] and info[i_name] ~= recipe_list[i].skill_level then found = true - tinsert(output, L["DATAMINER_SKILLELVEL"]:format(i_name, recipe_list[i]["Level"], info[i_name])) + tinsert(output, L["DATAMINER_SKILLELVEL"]:format(i_name, recipe_list[i].skill_level, info[i_name])) end end tinsert(output, "Trainer Skill Level Scan Complete.") @@ -1206,7 +1206,7 @@ do local noteachflag = false for i in pairs(recipe_list) do - local i_name = recipe_list[i]["Name"] + local i_name = recipe_list[i].name local acquire = recipe_list[i]["Acquire"] local flags = recipe_list[i]["Flags"] @@ -1255,7 +1255,7 @@ do tsort(teach) for i in ipairs(teach) do - tinsert(output, L["DATAMINER_TRAINER_TEACH"]:format(teach[i], recipe_list[teach[i]]["Name"])) + tinsert(output, L["DATAMINER_TRAINER_TEACH"]:format(teach[i], recipe_list[teach[i]].name)) end end @@ -1264,7 +1264,7 @@ do tsort(noteach) for i in ipairs(noteach) do - tinsert(output, L["DATAMINER_TRAINER_NOTTEACH"]:format(noteach[i], recipe_list[noteach[i]]["Name"])) + tinsert(output, L["DATAMINER_TRAINER_NOTTEACH"]:format(noteach[i], recipe_list[noteach[i]].name)) end end tinsert(output, "Trainer Acquire Scan Complete.") @@ -1375,7 +1375,7 @@ do twipe(recipe_list) for i in pairs(master_list) do - local prof = strlower(master_list[i]["Profession"]) + local prof = strlower(master_list[i].profession) if prof and prof == prof_name then recipe_list[i] = master_list[i] @@ -1644,8 +1644,8 @@ do self:Print(string.format("Spell ID %d does not exist in the database.", tonumber(spell_id))) return end - local recipe_name = spell_info["Name"] - local game_vers = spell_info["Game"] + local recipe_name = spell_info.name + local game_vers = spell_info.genesis twipe(output) @@ -1654,29 +1654,30 @@ do elseif game_vers > 2 then tinsert(output, "Expansion information too high: " .. tostring(spell_id) .. " " .. recipe_name) end - local Orange = spell_info["Orange"] - local Yellow = spell_info["Yellow"] - local Green = spell_info["Green"] - local Grey = spell_info["Grey"] - local SkillLevel = spell_info["Level"] + local optimal_level = spell_info.optimal_level + local medium_level = spell_info.medium_level + local easy_level = spell_info.easy_level + local trivial_level = spell_info.trivial_level + local SkillLevel = spell_info.skill_level - if not Orange then + if not optimal_level then tinsert(output, "No skill level information: " .. tostring(spell_id) .. " " .. recipe_name) else -- Highest level is greater than the skill of the recipe - if Orange > SkillLevel then - tinsert(output, "Skill Level Error (Orange > Skill): " .. tostring(spell_id) .. " " .. recipe_name) + if optimal_level > SkillLevel then + tinsert(output, "Skill Level Error (optimal_level > Skill): " .. tostring(spell_id) .. " " .. recipe_name) end + -- Level info is messed up - if Orange > Yellow or Orange > Green or Orange > Grey or Yellow > Green or Yellow > Grey or Green > Grey then + if optimal_level > medium_level or optimal_level > easy_level or optimal_level > trivial_level or medium_level > easy_level or medium_level > trivial_level or easy_level > trivial_level then tinsert(output, "Skill Level Error: " .. tostring(spell_id) .. " " .. recipe_name) end end - local recipe_link = spell_info["RecipeLink"] + local recipe_link = spell_info.spell_link if not recipe_link then - if spell_info["Profession"] ~= GetSpellInfo(53428) then -- Lets hide this output for runeforging. - self:Print("Missing RecipeLink for ID " .. spell_id .. " - " .. recipe_name .. " (Normal for DK abilities.") + if spell_info.profession ~= GetSpellInfo(53428) then -- Lets hide this output for runeforging. + self:Print("Missing spell_link for ID " .. spell_id .. " - " .. recipe_name .. " (Normal for DK abilities.") end return end @@ -2321,15 +2322,15 @@ do end if (scan_data.specialty) then - if (not scan_data.recipe_list[spell_id]["Specialty"]) then + if (not scan_data.recipe_list[spell_id].specialty) then addedtotable = true tinsert(output, "Recipe: " .. recipe_name .. " (" .. spell_id .. ") Missing Specialty: " .. scan_data.specialty) - elseif (scan_data.recipe_list[spell_id]["Specialty"] ~= scan_data.specialty) then + elseif (scan_data.recipe_list[spell_id].specialty ~= scan_data.specialty) then tinsert(output, "Recipe: " .. recipe_name .. " (" .. spell_id .. ") Wrong Specialty, the correct one is: " .. scan_data.specialty) end - elseif (scan_data.recipe_list[spell_id]["Specialty"]) then + elseif (scan_data.recipe_list[spell_id].specialty) then addedtotable = true - tinsert(output, "Recipe: " .. recipe_name .. " (" .. spell_id .. ") Extra Specialty: " .. scan_data.recipe_list[spell_id]["Specialty"]) + tinsert(output, "Recipe: " .. recipe_name .. " (" .. spell_id .. ") Extra Specialty: " .. scan_data.recipe_list[spell_id].specialty) end if (addedtotable) then diff --git a/Frame.lua b/Frame.lua index 8f38002..60bafe9 100644 --- a/Frame.lua +++ b/Frame.lua @@ -366,25 +366,25 @@ do local function Sort_SkillAsc(a, b) local reca, recb = recipe_list[a], recipe_list[b] - if reca["Level"] == recb["Level"] then - return reca["Name"] < recb["Name"] + if reca.skill_level == recb.skill_level then + return reca.name < recb.name else - return reca["Level"] < recb["Level"] + return reca.skill_level < recb.skill_level end end local function Sort_SkillDesc(a, b) local reca, recb = recipe_list[a], recipe_list[b] - if reca["Level"] == recb["Level"] then - return reca["Name"] < recb["Name"] + if reca.skill_level == recb.skill_level then + return reca.name < recb.name else - return recb["Level"] < reca["Level"] + return recb.skill_level < reca.skill_level end end local function Sort_Name(a, b) - return recipe_list[a]["Name"] < recipe_list[b]["Name"] + return recipe_list[a].name < recipe_list[b].name end -- Will only sort based off of the first acquire type @@ -402,19 +402,19 @@ do if reca["Type"] == A_CUSTOM then if reca["ID"] == recb["ID"] then - return recipe_list[a]["Name"] < recipe_list[b]["Name"] + return recipe_list[a].name < recipe_list[b].name else return reca["ID"] < recb["ID"] end else - return recipe_list[a]["Name"] < recipe_list[b]["Name"] + return recipe_list[a].name < recipe_list[b].name end end local function Sort_Location(a, b) -- We do the or "" because of nil's, I think this would be better if I just left it as a table which was returned - local reca = recipe_list[a]["Locations"] or "" - local recb = recipe_list[b]["Locations"] or "" + local reca = recipe_list[a].locations or "" + local recb = recipe_list[b].locations or "" reca = smatch(reca,"(%w+), ") or reca recb = smatch(recb,"(%w+), ") or recb @@ -589,7 +589,7 @@ do local spell_tip_anchor = addon.db.profile.spelltooltiplocation local acquire_tip_anchor = addon.db.profile.acquiretooltiplocation local recipe_entry = addon.recipe_list[rIndex] - local spell_link = recipe_entry["RecipeLink"] + local spell_link = recipe_entry.spell_link local MainPanel = addon.Frame if acquire_tip_anchor == _G.OFF then @@ -628,7 +628,7 @@ do acquire_tip:Clear() acquire_tip:SetScale(addon.db.profile.frameopts.tooltipscale) acquire_tip:AddHeader() - acquire_tip:SetCell(1, 1, "|cff"..addon:hexcolor("HIGH")..recipe_entry["Name"], "CENTER", 2) + acquire_tip:SetCell(1, 1, "|cff"..addon:hexcolor("HIGH")..recipe_entry.name, "CENTER", 2) -- check if the recipe is excluded local exclude = addon.db.profile.exclusionlist @@ -640,7 +640,7 @@ do -- Add in skill level requirement, colored correctly local color_1 = addon:hexcolor("NORMAL") - local recipe_level = recipe_entry["Level"] + local recipe_level = recipe_entry.skill_level local skill_level = Player["ProfessionLevel"] local color_2 @@ -655,7 +655,7 @@ do else color_2 = addon:hexcolor("MIDGREY") end - ttAdd(0, -1, false, L["Required Skill"] .. " :", color_1, recipe_entry["Level"], color_2) + ttAdd(0, -1, false, L["Required Skill"] .. " :", color_1, recipe_entry.skill_level, color_2) -- Binding info acquire_tip:AddSeparator() @@ -2123,21 +2123,21 @@ do ------------------------------------------------------------------------------- local function ColourSkillLevel(recipeEntry, hasFaction, recipe_text) local skill_level = Player["ProfessionLevel"] - local recipe_level = recipeEntry["Level"] - local recipeOrange = recipeEntry["Orange"] - local recipeYellow = recipeEntry["Yellow"] - local recipeGreen = recipeEntry["Green"] - local recipeGrey = recipeEntry["Grey"] + local recipe_level = recipeEntry.skill_level + local optimal_level = recipeEntry.optimal_level + local medium_level = recipeEntry.medium_level + local easy_level = recipeEntry.easy_level + local trivial_level = recipeEntry.trivial_level if recipe_level > skill_level or not hasFaction then return addon:Red(recipe_text) - elseif skill_level >= recipeGrey then + elseif skill_level >= trivial_level then return addon:MidGrey(recipe_text) - elseif skill_level >= recipeGreen then + elseif skill_level >= easy_level then return addon:Green(recipe_text) - elseif skill_level >= recipeYellow then + elseif skill_level >= medium_level then return addon:Yellow(recipe_text) - elseif skill_level >= recipeOrange then + elseif skill_level >= optimal_level then return addon:Orange(recipe_text) else --@alpha@ @@ -2167,12 +2167,12 @@ do local recipe_entry = recipe_list[recipe_index] if recipe_entry["Display"] and recipe_entry["Search"] then - local recipe_string = recipe_entry["Name"] + local recipe_string = recipe_entry.name if exclusions[recipe_index] then recipe_string = "** " .. recipe_string .. " **" end - local recipe_level = recipe_entry["Level"] + local recipe_level = recipe_entry.skill_level recipe_string = skill_sort and ("[" .. recipe_level .. "] - " .. recipe_string) or (recipe_string .. " - [" .. recipe_level .. "]") @@ -3405,12 +3405,12 @@ function addon:InitializeFrame() local SearchRecipes do local search_params = { - ["ItemID"] = true, - ["Name"] = true, - ["Locations"] = true, - ["Specialty"] = true, - ["Level"] = true, - ["Rarity"] = true, + ["item_id"] = true, + ["name"] = true, + ["locations"] = true, + ["specialty"] = true, + ["skill_level"] = true, + ["quality"] = true, } -- Scans through the recipe database and toggles the flag on if the item is in the search criteria function SearchRecipes(pattern) @@ -3562,7 +3562,7 @@ function addon:InitializeFrame() if IsControlKeyDown() and IsShiftKeyDown() then addon:SetupMap(clicked_line.recipe_id) elseif IsShiftKeyDown() then - local itemID = addon.recipe_list[clicked_line.recipe_id]["ItemID"] + local itemID = addon.recipe_list[clicked_line.recipe_id].item_id if itemID then local _, itemLink = GetItemInfo(itemID) @@ -3576,7 +3576,7 @@ function addon:InitializeFrame() addon:Print(L["NoItemLink"]) end elseif IsControlKeyDown() then - ChatFrameEditBox:Insert(addon.recipe_list[clicked_line.recipe_id]["RecipeLink"]) + ChatFrameEditBox:Insert(addon.recipe_list[clicked_line.recipe_id].spell_link) elseif IsAltKeyDown() then -- Code needed here to insert this item into the "Ignore List" addon:ToggleExcludeRecipe(clicked_line.recipe_id) diff --git a/Player.lua b/Player.lua index 8b2de2b..00e33dd 100644 --- a/Player.lua +++ b/Player.lua @@ -78,9 +78,9 @@ function Player:MarkExclusions() recipe["Display"] = false end - local tmp_prof = GetSpellInfo(recipe["Profession"]) + local tmp_prof = GetSpellInfo(recipe.profession) - if not recipe["Known"] and tmp_prof == profession then + if not recipe.is_known and tmp_prof == profession then known_count = known_count + 1 elseif tmp_prof == profession then unknown_count = unknown_count + 1 -- 1.7.9.5