Quantcast

Cleanup.

James D. Callahan III [03-12-11 - 10:30]
Cleanup.
Filename
Interface/List.lua
Recipe.lua
Scanner.lua
diff --git a/Interface/List.lua b/Interface/List.lua
index 051e137..04f48b1 100644
--- a/Interface/List.lua
+++ b/Interface/List.lua
@@ -25,7 +25,7 @@ local L		= LibStub("AceLocale-3.0"):GetLocale(MODNAME)
 local QTip	= LibStub("LibQTip-1.0")

 -- Set up the private intra-file namespace.
-local private	= select(2, ...)
+local FOLDER_NAME, private	= ...

 local Player	= private.Player

@@ -210,21 +210,22 @@ function private.InitializeListFrame()
 		if not clicked_line then
 			return
 		end
+
 		-- First, check if this is a "modified" click, and react appropriately
 		if clicked_line.recipe_id and _G.IsModifierKeyDown() then
 			if _G.IsControlKeyDown() and _G.IsShiftKeyDown() then
 				addon:AddWaypoint(clicked_line.recipe_id, clicked_line.acquire_id, clicked_line.location_id, clicked_line.npc_id)
 			elseif _G.IsShiftKeyDown() then
-				local itemID = private.recipe_list[clicked_line.recipe_id].item_id
+				local crafted_item_id = private.recipe_list[clicked_line.recipe_id]:CraftedItemID()

-				if itemID then
-					local _, itemLink = _G.GetItemInfo(itemID)
+				if crafted_item_id then
+					local _, item_link = _G.GetItemInfo(crafted_item_id)

-					if itemLink then
+					if item_link then
 						local edit_box = _G.ChatEdit_ChooseBoxForSend()

 						_G.ChatEdit_ActivateChat(edit_box)
-						edit_box:Insert(itemLink)
+						edit_box:Insert(item_link)
 					else
 						addon:Print(L["NoItemLink"])
 					end
@@ -235,7 +236,7 @@ function private.InitializeListFrame()
 				local edit_box = _G.ChatEdit_ChooseBoxForSend()

 				_G.ChatEdit_ActivateChat(edit_box)
-				edit_box:Insert(GetSpellLink(private.recipe_list[clicked_line.recipe_id].spell_id))
+				edit_box:Insert(_G.GetSpellLink(private.recipe_list[clicked_line.recipe_id].spell_id))
 			elseif _G.IsAltKeyDown() then
 				local exclusion_list = addon.db.profile.exclusionlist
 				local recipe_id = clicked_line.recipe_id
@@ -1736,18 +1737,18 @@ do
 		local recipe_item_id = private.recipe_list[recipe_id]:RecipeItemID()
 		local _, recipe_item_level

-		if item_id then
-			_, _, _, item_level = GetItemInfo(item_id)
+		if recipe_item_id then
+			_, _, _, recipe_item_level = _G.GetItemInfo(recipe_item_id)
 		end
-		local _, _, _, quality_color = GetItemQualityColor(private.recipe_list[recipe_id].quality)
+		local _, _, _, quality_color = _G.GetItemQualityColor(private.recipe_list[recipe_id].quality)
 		local type_color = string.gsub(quality_color, "|cff", "")

 		if type(id_num) == "string" then
-			local location_text = item_level and string.format("%s (%d - %d)", drop_location, item_level - 5, item_level + 5) or drop_location
+			local location_text = recipe_item_level and string.format("%s (%d - %d)", drop_location, recipe_item_level - 5, recipe_item_level + 5) or drop_location

 			addline_func(0, -1, false, L["World Drop"], type_color, location_text, CATEGORY_COLORS["location"])
 		else
-			local location_text = item_level and string.format("%s (%d - %d)", _G.UNKNOWN, item_level - 5, item_level + 5) or _G.UNKNOWN
+			local location_text = recipe_item_level and string.format("%s (%d - %d)", _G.UNKNOWN, recipe_item_level - 5, recipe_item_level + 5) or _G.UNKNOWN

 			addline_func(0, -1, false, L["World Drop"], type_color, location_text, CATEGORY_COLORS["location"])
 		end
@@ -1755,7 +1756,7 @@ do

 	local function Tooltip_AddAchievement(recipe_id, id_num, addline_func)
 		local recipe = private.recipe_list[recipe_id]
-		local _, achievement_name, _, _, _, _, _, achievement_desc = GetAchievementInfo(id_num)
+		local _, achievement_name, _, _, _, _, _, achievement_desc = _G.GetAchievementInfo(id_num)

 		-- The recipe is an actual reward from an achievement if flagged - else we're just using the text to describe how to get it.
 		if recipe:HasFilter("common1", "ACHIEVEMENT") then
diff --git a/Recipe.lua b/Recipe.lua
index 4a8e08b..a2554ad 100644
--- a/Recipe.lua
+++ b/Recipe.lua
@@ -43,18 +43,11 @@ local recipe_meta = {

 ---Adds a tradeskill recipe into the specified recipe database
 -- @name AckisRecipeList:AddRecipe
--- @usage AckisRecipeList:AddRecipe(28927, 305, 23109, Q.UNCOMMON, V.TBC, 305, 305, 325, 345)
+-- @usage AckisRecipeList:AddRecipe(28927, 23109, V.TBC, Q.UNCOMMON)
 -- @param spell_id The [[http://www.wowpedia.org/SpellLink|Spell ID]] of the recipe being added to the database
--- @param skill_level The skill level at which the recipe can be initially learned
--- @param item_id The [[http://www.wowpedia.org/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 [[API/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 that the recipe was first introduced in, for example, Original, BC, WoTLK, or Cata
--- @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
+-- @param quality The quality/rarity of the recipe
 -- @return Resultant recipe table.
 function addon:AddRecipe(spell_id, profession, genesis, quality)
 	local recipe_list = private.recipe_list
diff --git a/Scanner.lua b/Scanner.lua
index 91ae8c2..0b74140 100644
--- a/Scanner.lua
+++ b/Scanner.lua
@@ -53,8 +53,6 @@ local FOLDER_NAME, private	= ...
 local F = private.filter_flags
 local A = private.acquire_types

-local PROFESSIONS = private.professions
-
 -------------------------------------------------------------------------------
 -- Look up table of spell IDs for recipes which do not have a player flag
 -- BASICALLY A TEMPORARY STORAGE FOR IDS, SO WE CAN SEE CLEANER SCANS AND WHAT NOT,
@@ -533,12 +531,11 @@ local function LoadRecipe()
 			addon:InitializeLookups()
 		end

-		for idx, prof in pairs(PROFESSIONS) do
+		for index, prof in pairs(private.professions) do
 			addon:InitializeProfession(prof)
 		end
 	end
 	return recipe_list
-
 end

 -------------------------------------------------------------------------------