From ec66ea97e00e6abf077ceceba8df07a05561c04c Mon Sep 17 00:00:00 2001 From: "James D. Callahan III" Date: Wed, 24 Mar 2010 22:10:07 -0400 Subject: [PATCH] In MainPanel.scroll_frame:Update(): Re-added the profession checks for Acquisition and Location sort, since vendor scanning will dump every profession into the recipe list. --- Frame.lua | 55 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 23 deletions(-) diff --git a/Frame.lua b/Frame.lua index 21da36e..9d20042 100644 --- a/Frame.lua +++ b/Frame.lua @@ -2630,8 +2630,6 @@ do if not refresh and not self.scrolling then local recipe_list = private.recipe_list local sorted_recipes = addon.sorted_recipes - local sorted_locations = addon.sorted_locations - local sorted_acquires = addon.sorted_acquires local sort_type = addon.db.profile.sorting local recipe_count = 0 @@ -2644,6 +2642,9 @@ do twipe(recipe_registry) if sort_type == "Acquisition" then + local sorted_acquires = addon.sorted_acquires + local current_prof = Player.current_prof + SortAcquireList() for index = 1, #sorted_acquires do @@ -2653,19 +2654,22 @@ do -- Check to see if any recipes for this acquire type will be shown - otherwise, don't show the type in the list. for spell_id, faction in pairs(private.acquire_list[acquire_type].recipes) do local recipe = private.recipe_list[spell_id] - local has_faction = false - if type(faction) == "boolean" - or addon.db.profile.filters.general.faction or faction == BFAC[Player.faction] or faction == BFAC["Neutral"] then - has_faction = true - end + if recipe.profession == current_prof then + local has_faction = false + + if type(faction) == "boolean" + or addon.db.profile.filters.general.faction or faction == BFAC[Player.faction] or faction == BFAC["Neutral"] then + has_faction = true + end - if has_faction and recipe.is_visible and recipe.is_relevant then - count = count + 1 + if has_faction and recipe.is_visible and recipe.is_relevant then + count = count + 1 - if not recipe_registry[recipe] then - recipe_registry[recipe] = true - recipe_count = recipe_count + 1 + if not recipe_registry[recipe] then + recipe_registry[recipe] = true + recipe_count = recipe_count + 1 + end end end end @@ -2677,11 +2681,13 @@ do t.acquire_id = acquire_type t.type = "header" - insert_index = self:InsertEntry(t, insert_index, expand_acquires) end end elseif sort_type == "Location" then + local sorted_locations = addon.sorted_locations + local current_prof = Player.current_prof + SortLocationList() for index = 1, #sorted_locations do @@ -2691,19 +2697,22 @@ do -- Check to see if any recipes for this location will be shown - otherwise, don't show the location in the list. for spell_id, faction in pairs(private.location_list[loc_name].recipes) do local recipe = private.recipe_list[spell_id] - local has_faction = false - if type(faction) == "boolean" - or addon.db.profile.filters.general.faction or faction == BFAC[Player.faction] or faction == BFAC["Neutral"] then - has_faction = true - end + if recipe.profession == current_prof then + local has_faction = false - if has_faction and recipe.is_visible and recipe.is_relevant then - count = count + 1 + if type(faction) == "boolean" + or addon.db.profile.filters.general.faction or faction == BFAC[Player.faction] or faction == BFAC["Neutral"] then + has_faction = true + end - if not recipe_registry[recipe] then - recipe_registry[recipe] = true - recipe_count = recipe_count + 1 + if has_faction and recipe.is_visible and recipe.is_relevant then + count = count + 1 + + if not recipe_registry[recipe] then + recipe_registry[recipe] = true + recipe_count = recipe_count + 1 + end end end end -- 1.7.9.5