From fad5b4277b34c0cccc96f58253d99041ccf56258 Mon Sep 17 00:00:00 2001 From: "James D. Callahan III" Date: Sun, 28 Mar 2010 08:08:09 -0400 Subject: [PATCH] Added the ability to search by location name. --- Frame.lua | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/Frame.lua b/Frame.lua index 5c3712c..92a4660 100644 --- a/Frame.lua +++ b/Frame.lua @@ -1308,14 +1308,13 @@ SetTooltipScripts(ARL_ExpandButton, L["EXPANDALL_DESC"]) local SearchRecipes do local acquire_names = private.acquire_names + local location_list = private.location_list local search_params = { ["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) @@ -1328,8 +1327,29 @@ do for index in pairs(recipe_list) do local entry = recipe_list[index] + entry.is_relevant = false + for location_name in pairs(location_list) do + local breakout = false + + for spell_id in pairs(location_list[location_name].recipes) do + if spell_id == entry.spell_id then + local str = location_name:lower() + + if str and str:find(pattern) then + entry.is_relevant = true + breakout = true + break + end + end + end + + if breakout then + break + end + end + for acquire_type in pairs(acquire_names) do local str = acquire_names[acquire_type]:lower() -- 1.7.9.5