From 5ada0de541ada353515cf3616829972ccd6bf3df Mon Sep 17 00:00:00 2001 From: Ackis Date: Tue, 9 Dec 2008 20:31:55 +0000 Subject: [PATCH] Ackis Recipe List: - Changed a localization string: L["SCAN_RECIPES_DESC"] = "Scans an open tradeskill for missing recipes. Press shift to generate a text dump." - When you shift-click the scan button, it opens up the text dump - When you click the scan button after opening up a new profession, it'll rescan instead of just closing the window - Dry-coded (Compiles with luac -p) --- ARLDataminer.rb | 2 +- ARLFrame.lua | 27 +++++++++++++++++---------- AckisRecipeList.lua | 6 ------ Locals/ARLLocals-enUS.lua | 2 +- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/ARLDataminer.rb b/ARLDataminer.rb index d58d813..2b8a925 100644 --- a/ARLDataminer.rb +++ b/ARLDataminer.rb @@ -1190,7 +1190,7 @@ L["ARL Documentation"] = true -- Config UI Elements and their associated descriptions L["MAIN_OPTIONS_DESC"] = "Main configuration options" L["Scan"] = true -L["SCAN_RECIPES_DESC"] = "Scans an open tradeskill for missing recipes." +L["SCAN_RECIPES_DESC"] = "Scans an open tradeskill for missing recipes. Press shift to generate a text dump." L["Text Dump"] = true L["TEXT_DUMP_DESC"] = "Displays all recipes in a comma separated value format which can be copied and pasted into another client." L["View Exclusion List"] = true diff --git a/ARLFrame.lua b/ARLFrame.lua index 4fc3871..c8d6987 100644 --- a/ARLFrame.lua +++ b/ARLFrame.lua @@ -1100,19 +1100,15 @@ function addon:CreateScanButton() -- Create the scan button if (not addon.ScanButton) then - addon.ScanButton = CreateFrame("Button","addon.ScanButton",UIParent,"UIPanelButtonTemplate") - end -- Add to Skillet interface if (Skillet and Skillet:IsActive()) then - addon.ScanButton:SetParent(SkilletFrame) addon.ScanButton:Show() Skillet:AddButtonToTradeskillWindow(addon.ScanButton) addon.ScanButton:SetWidth(80) - end -- Set some of the common button properties @@ -1910,14 +1906,25 @@ end function addon:ToggleFrame() - if (addon.Frame and addon.Frame:IsVisible()) then + -- What profession is opened? + local cprof = GetTradeSkillLine() - addon.Frame:Hide() - + 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:AckisRecipeList_Command() - + 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) + else + addon:AckisRecipeList_Command(false) + end end end diff --git a/AckisRecipeList.lua b/AckisRecipeList.lua index a701053..7766831 100644 --- a/AckisRecipeList.lua +++ b/AckisRecipeList.lua @@ -358,9 +358,7 @@ function addon:TRADE_SKILL_SHOW() addon:OpenTradeWindow() if (addon.ScanButton and not Skillet) then - self:ShowScanButton() - end end @@ -375,15 +373,11 @@ function addon:TRADE_SKILL_CLOSE() addon:CloseTradeWindow() if (addon.db.profile.closeguionskillclose and addon.Frame) then - self:CloseWindow() - end if (addon.ScanButton and not Skillet) then - addon.ScanButton:Hide() - end end diff --git a/Locals/ARLLocals-enUS.lua b/Locals/ARLLocals-enUS.lua index 0960c93..6559ab7 100644 --- a/Locals/ARLLocals-enUS.lua +++ b/Locals/ARLLocals-enUS.lua @@ -57,7 +57,7 @@ L["ARL Documentation"] = true -- Config UI Elements and their associated descriptions L["MAIN_OPTIONS_DESC"] = "Main configuration options" L["Scan"] = true -L["SCAN_RECIPES_DESC"] = "Scans an open tradeskill for missing recipes." +L["SCAN_RECIPES_DESC"] = "Scans an open tradeskill for missing recipes. Press shift to generate a text dump." L["Text Dump"] = true L["TEXT_DUMP_DESC"] = "Displays all recipes in a comma separated value format which can be copied and pasted into another client." L["View Exclusion List"] = true -- 1.7.9.5