From 9f8a01d839686f0e1a3d94dbfbf0f9e5002d2e6b Mon Sep 17 00:00:00 2001 From: Ackis Date: Mon, 27 Oct 2008 18:21:42 +0000 Subject: [PATCH] Ackis Recipe List: - Fix eroneous errors when no recipes are displayed (ticket 146) - Added to locals L["ARL_ALLKNOWN"] - Dry-coded (Compiles with luac -p) --- ARLFrame.lua | 41 +++++++++++++++++++++++++++++++++++------ Locals/ARLLocals-enUS.lua | 1 + 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/ARLFrame.lua b/ARLFrame.lua index d1daf51..ce13df8 100644 --- a/ARLFrame.lua +++ b/ARLFrame.lua @@ -97,7 +97,7 @@ StaticPopupDialogs["ARL_NOTSCANNED"] = { exclusive = 1, whileDead = 1, hideOnEscape = 1 -}; +} StaticPopupDialogs["ARL_ALLFILTERED"] = { text = L["ALL_FILTERED"], @@ -106,6 +106,15 @@ StaticPopupDialogs["ARL_ALLFILTERED"] = { exclusive = 1, whileDead = 1, hideOnEscape = 1 +} + +StaticPopupDialogs["ARL_ALLKNOWN"] = { + text = L["ARL_ALLKNOWN"], + button1 = L["Ok"], + timeout = 0, + exclusive = 1, + whileDead = 1, + hideOnEscape = 1 }; -- Description: @@ -335,14 +344,20 @@ function addon.resetTitle() -- reset the frame title line local myTitle = "" local addonversion = GetAddOnMetadata("AckisRecipeList", "Version") + if (addon.Frame._Expanded == true) then + local aFil, tFil = addon.numFilters() + myTitle = "ARL (v." .. addonversion .. ") - " .. currentProfession .. " (" .. aFil .. "/" .. tFil .. " " .. L["Filters"] .. ")" + else + myTitle = "ARL (v." .. addonversion .. ") - " .. currentProfession + end --- addon.Frame.HeadingText:SetText(addon:White(myTitle)) + addon.Frame.HeadingText:SetText(addon:Normal(myTitle)) end @@ -908,6 +923,7 @@ function SetSwitcherTexture(tex) ARL_SwitcherButton:SetNormalTexture(ARL_S_NTexture) ARL_SwitcherButton:SetPushedTexture(ARL_S_PTexture) ARL_SwitcherButton:SetDisabledTexture(ARL_S_DTexture) + end -- Description: @@ -1035,12 +1051,14 @@ end -- Output: function ClearRecipeButtonTooltip(bIndex) + local pButton = addon.PlusListButton[bIndex] local rButton = addon.RecipeListButton[bIndex] pButton:SetScript("OnEnter", function () end) pButton:SetScript("OnLeave", function () end) rButton:SetScript("OnEnter", function () end) rButton:SetScript("OnLeave", function () end) + end -- Description: @@ -1656,17 +1674,28 @@ function RecipeList_Update() end + -- Entries are 0 here else ---TODOfix popups for when everything is fileterd - -- If the recipetotal > 0 that means we've already scanned this recipe - if (playerData.totalRecipes > 0) then + + -- If the recipe total is at 0, it means we have not scanned the profession yet + if (playerData.totalRecipes == 0) then StaticPopup_Show("ARL_NOTSCANNED") - else + -- We know all the recipes + elseif (playerData.foundRecipes == playerData.totalRecipes) then + + StaticPopup_Show("ARL_ALLKNOWN") + + -- Our filters are actually filtering something + elseif ((playerData.totalRecipes - (playerData.filteredRecipes - playerData.otherRecipes)) > 0) then StaticPopup_Show("ARL_ALLFILTERED") + else + + addon:Print("No recipes to display.") + end end diff --git a/Locals/ARLLocals-enUS.lua b/Locals/ARLLocals-enUS.lua index f2741f8..8bf92d9 100644 --- a/Locals/ARLLocals-enUS.lua +++ b/Locals/ARLLocals-enUS.lua @@ -259,6 +259,7 @@ L["Required Skill"] = true -- Popup Strings L["NOTSCANNED"] = "You have not yet scanned this profession. Please open this profession and click on Scan Skills." L["ALL_FILTERED"] = "Although you have already scanned this profession, your filters are currently preventing any recipes from being displayed. Please change your filters and try again." +L["ARL_ALLKNOWN"] = "You know all the recipes for this profession." -- Error/warning Text L["MissingFromDB"] = ": is is missing from the database. \nPlease inform the author of the add-on about this recipe." -- 1.7.9.5