From 80ef0b6b8b423e89f4ce02a725b88eb2d031102a Mon Sep 17 00:00:00 2001 From: ackis Date: Fri, 25 Sep 2009 15:36:12 +0000 Subject: [PATCH] Dry code support to close your headers which were closed before doing a tradeskill scan. --- AckisRecipeList.lua | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/AckisRecipeList.lua b/AckisRecipeList.lua index 2463a05..b5a7a1f 100644 --- a/AckisRecipeList.lua +++ b/AckisRecipeList.lua @@ -763,10 +763,13 @@ do local GetTradeSkillInfo = GetTradeSkillInfo local GetTradeSkillRecipeLink = GetTradeSkillRecipeLink local ExpandTradeSkillSubClass = ExpandTradeSkillSubClass + local CollapseTradeSkillSubClass = CollapseTradeSkillSubClass ---Scans the recipe listing and marks known recipes as true in the database function addon:ScanForKnownRecipes(RecipeDB, playerData) + local headerlist = {} + -- Clear the "Have Materials" check box -- If Mr Trader is installed if MRTUIUtils_PushFilterSelection then @@ -790,7 +793,10 @@ do -- Expand all headers so we can see all the recipes there are for i = GetNumTradeSkills(), 1, -1 do - local _, tradeType = GetTradeSkillInfo(i) + local name, tradeType, _, isExpanded = GetTradeSkillInfo(i) + if isExpanded then + headerlist[name] = true + end if tradeType == "header" then ExpandTradeSkillSubClass(i) end @@ -829,7 +835,13 @@ do if MRTUIUtils_PopFilterSelection then MRTUIUtils_PopFilterSelection() else - + -- Collapse all headers that were collapsed before + for i = GetNumTradeSkills(), 1, -1 do + local name, tradeType, _, isExpanded = GetTradeSkillInfo(i) + if headerlist[name] then + CollapseTradeSkillSubClass(i) + end + end end playerData.foundRecipes = foundRecipes -- 1.7.9.5