From b8879a39a4c44eee26f0f6108dee7a748d71d883 Mon Sep 17 00:00:00 2001 From: "James D. Callahan III" Date: Sun, 21 Mar 2010 22:26:55 -0400 Subject: [PATCH] In MainPanel.scroll_frame:Update(): For Acquisition and Location views, show the number of recipes next to the category name. --- Frame.lua | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/Frame.lua b/Frame.lua index 01c3ce8..9e01e7f 100644 --- a/Frame.lua +++ b/Frame.lua @@ -2219,23 +2219,22 @@ do if sort_type == "Acquisition" then for index = 1, #sorted_acquires do local acquire_type = sorted_acquires[index] - local show_acquire = false + local count = 0 -- Check to see if any recipes for this location will be shown - otherwise, don't show the location in the list. for spell_id in pairs(private.acquire_list[acquire_type].recipes) do local recipe = private.recipe_list[spell_id] if Player.professions[recipe.profession] and recipe.is_visible and recipe.is_relevant then - show_acquire = true - break + count = count + 1 end end - if show_acquire then + if count > 0 then local t = AcquireTable() - t.text = private.acquire_names[acquire_type] + t.text = string.format("%s (%d)", private.acquire_names[acquire_type], count) t.acquire_id = acquire_type t.is_header = true @@ -2255,22 +2254,21 @@ do elseif sort_type == "Location" then for index = 1, #sorted_locations do local loc_name = sorted_locations[index] - local show_loc = false + local count = 0 -- Check to see if any recipes for this location will be shown - otherwise, don't show the location in the list. for spell_id in pairs(private.location_list[loc_name].recipes) do local recipe = private.recipe_list[spell_id] if Player.professions[recipe.profession] and recipe.is_visible and recipe.is_relevant then - show_loc = true - break + count = count + 1 end end - if show_loc then + if count > 0 then local t = AcquireTable() - t.text = loc_name + t.text = string.format("%s (%d)", loc_name, count) t.location_id = loc_name t.is_header = true -- 1.7.9.5