From c975efa3b68aedfec8086a0b6b2dc1e7d92f1018 Mon Sep 17 00:00:00 2001 From: ackis Date: Thu, 1 Jan 2009 23:30:13 +0000 Subject: [PATCH] Fix for ticket 292 --- ARLFrame.lua | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/ARLFrame.lua b/ARLFrame.lua index f891014..2abde38 100644 --- a/ARLFrame.lua +++ b/ARLFrame.lua @@ -1916,27 +1916,34 @@ end -- Input: -- Output: -function addon:ToggleFrame() +do - -- What profession is opened? - local cprof = GetTradeSkillLine() + local currentProfession = nil - if (addon.Frame and addon.Frame:IsVisible()) then - -- If we have the same profession open, then we close the scanned window - if (addon.ScanButton.currentProfession == cprof) then - addon.Frame:Hide() - -- If we have a different profession open we do a scan - else - addon:AckisRecipeList_Command(false) - end - else - addon.ScanButton.currentProfession = cprof - -- If we click the scan button with the shift key down, we do a text dump - if (IsShiftKeyDown()) then - addon:AckisRecipeList_Command(true) + function addon:ToggleFrame() + + -- What profession is opened? + local cprof = GetTradeSkillLine() + + if (addon.Frame and addon.Frame:IsVisible()) then + -- If we have the same profession open, then we close the scanned window + if (currentProfession == cprof) then + addon.Frame:Hide() + -- If we have a different profession open we do a scan + else + addon:AckisRecipeList_Command(false) + currentProfession = cprof + end else - addon:AckisRecipeList_Command(false) + currentProfession = cprof + -- If we click the scan button with the shift key down, we do a text dump + if (IsShiftKeyDown()) then + addon:AckisRecipeList_Command(true) + else + addon:AckisRecipeList_Command(false) + end end + end end -- 1.7.9.5