From 5587e6676c6f8b037a0c4f9a1bd1a4ae81dd630d Mon Sep 17 00:00:00 2001 From: Noshei <8866000+Noshei@users.noreply.github.com> Date: Mon, 21 Oct 2024 10:21:59 -0600 Subject: [PATCH] 2.6.3 Fixed errors with custom filters Fixed error when deleting a profile Cleaned up static tables Fixed issue with tooltip for the first item displayed --- Config.lua | 12 +++--- Constants.lua | 96 ++++++++++++++++---------------------------- DisplayCreation.lua | 2 + FilterButton.lua | 9 ++++- GatheringTracker.toc | 2 +- 5 files changed, 52 insertions(+), 69 deletions(-) diff --git a/Config.lua b/Config.lua index d8e454b..1b5ec91 100644 --- a/Config.lua +++ b/Config.lua @@ -1257,7 +1257,10 @@ local filterOptions = { GT:CreateCustomFilterOptions() GT:RebuildIDTables() GT:InventoryUpdate("Custom Filter Changed", true) - GT:CreateCustomFiltersList() + GT:CreateCustomFiltersList( + GT.baseFrame.button, + GT.baseFrame.button.rootDescription + ) end, order = 2 }, @@ -1541,12 +1544,12 @@ function GT:CreateCustomFilterOptions() local borderColor = {} local overlay = {} - if id <= #GT.ItemData.Other.Other then + if itemID <= #GT.ItemData.Other.Other then border = nil borderColor = nil overlay = nil else - local rarity = C_Item.GetItemQualityByID(id) or 1 + local rarity = C_Item.GetItemQualityByID(itemID) or 1 if rarity <= 1 then border = { "Interface\\Common\\WhiteIconFrame", "texture" } else @@ -1563,7 +1566,7 @@ function GT:CreateCustomFilterOptions() return data end, - order = (id + 1000) + order = (itemID + 1000) } AceConfigRegistry:NotifyChange("GT/Filter") end) @@ -1659,7 +1662,6 @@ function GT:OnInitialize() GT.db = LibStub("AceDB-3.0"):New("GatheringTrackerDB", GT.defaults, true) GT.db.RegisterCallback(GT, "OnProfileChanged", "RefreshConfig") - GT.db.RegisterCallback(GT, "OnProfileDeleted", "CreateProfilesList") GT.db.RegisterCallback(GT, "OnProfileCopied", "RefreshConfig") GT.db.RegisterCallback(GT, "OnProfileReset", "RefreshConfig") diff --git a/Constants.lua b/Constants.lua index 60db233..8393edc 100644 --- a/Constants.lua +++ b/Constants.lua @@ -1,77 +1,51 @@ ---@class GT local GT = LibStub("AceAddon-3.0"):GetAddon("GatheringTracker") -local expansions = { - ["Classic"] = 1, - ["BC"] = 2, - ["Wrath"] = 3, - ["Cata"] = 4, - ["MoP"] = 5, - ["WoD"] = 6, - ["Legion"] = 7, - ["BFA"] = 8, - ["SL"] = 9, - ["DF"] = 10, - ["TWW"] = 11, - ["Other"] = 12, -} -GT.expansions = expansions - local expansionsOrder = { - [1] = "Classic", - [2] = "BC", - [3] = "Wrath", - [4] = "Cata", - [5] = "MoP", - [6] = "WoD", - [7] = "Legion", - [8] = "BFA", - [9] = "SL", - [10] = "DF", - [11] = "TWW", - [12] = "Other", + "Classic", + "BC", + "Wrath", + "Cata", + "MoP", + "WoD", + "Legion", + "BFA", + "SL", + "DF", + "TWW", + "Other", } GT.expansionsOrder = expansionsOrder -local categories = { - ["Herb"] = 1, - ["Ore"] = 2, - ["Cloth"] = 3, - ["Leather"] = 4, - ["Meat"] = 5, - ["Fish"] = 6, - ["Elemental"] = 7, - ["Gem"] = 8, - ["Enchanting"] = 9, - ["Pigment"] = 10, - ["Legendary"] = 11, - ["Synthesis"] = 12, - ["Knowledge"] = 13, - - ["Other"] = 14, -} -GT.categories = categories +GT.expansions = {} +for index, expansion in ipairs(GT.expansionsOrder) do + GT.expansions[expansion] = index +end local categoriesOrder = { - [1] = "Herb", - [2] = "Ore", - [3] = "Cloth", - [4] = "Leather", - [5] = "Meat", - [6] = "Fish", - [7] = "Elemental", - [8] = "Gem", - [9] = "Enchanting", - [10] = "Pigment", - [11] = "Legendary", - [12] = "Synthesis", - [13] = "Knowledge", - - [14] = "Other", + "Herb", + "Ore", + "Cloth", + "Leather", + "Meat", + "Fish", + "Elemental", + "Gem", + "Enchanting", + "Pigment", + "Legendary", + "Synthesis", + "Knowledge", + "Other", } GT.categoriesOrder = categoriesOrder +GT.categories = {} +for index, category in ipairs(GT.categoriesOrder) do + GT.categories[category] = index +end + local ItemData = { Classic = { Herb = { diff --git a/DisplayCreation.lua b/DisplayCreation.lua index 00007f9..0d0cfe0 100644 --- a/DisplayCreation.lua +++ b/DisplayCreation.lua @@ -152,6 +152,8 @@ function GT:DisplayFrameBase(id) frame:SetWidth(GT.db.profile.General.iconWidth) local frameHeight = math.max(GT.db.profile.General.iconHeight, GT.db.profile.General.totalSize) frame:SetHeight(frameHeight + 3) + frame:SetFrameStrata("BACKGROUND") + frame:SetFrameLevel(3) frame:Show() return frame diff --git a/FilterButton.lua b/FilterButton.lua index 3797d68..4769061 100644 --- a/FilterButton.lua +++ b/FilterButton.lua @@ -62,6 +62,7 @@ function GT:FiltersButton(profileChanged) filterButton:EnableMouse(true) filterButton:RegisterForClicks("AnyDown") filterButton:SetFrameStrata("BACKGROUND") + filterButton:SetFrameLevel(1) filterButton:Show() filterButton:SetScript("OnClick", function(self, button, down) @@ -104,6 +105,7 @@ end function GT:GenerateFiltersMenu(frame) local function FiltersMenu(frame, rootDescription) + rootDescription:SetTag("GatheringTracker_Filter_Menu") for expansionIndex, expansion in ipairs(GT.expansionsOrder) do local function IsSelected_Expansion() local checked = true @@ -262,12 +264,13 @@ function GT:GenerateFiltersMenu(frame) end end end - --add Custom Filters to filterMenu GT:CreateCustomFiltersList(frame, rootDescription) --add Profiles to filterMenu GT:CreateProfilesList(frame, rootDescription) + + GT.baseFrame.button.rootDescription = rootDescription end MenuUtil.CreateContextMenu(frame, FiltersMenu) @@ -300,7 +303,8 @@ function GT:FiltersButtonFade(alpha) mouseOver:SetHeight(75) mouseOver:SetPoint("CENTER", GT.baseFrame.button, "CENTER") mouseOver:SetMouseClickEnabled(false) - mouseOver:SetFrameStrata("LOW") + mouseOver:SetFrameStrata("BACKGROUND") + mouseOver:SetFrameLevel(2) GT.baseFrame.button.mouseOver = mouseOver end GT.baseFrame.button:SetIgnoreParentAlpha(GT.db.profile.General.buttonFade) @@ -325,6 +329,7 @@ function GT:FiltersButtonFade(alpha) if GT.baseFrame.button.mouseOver then GT.baseFrame.button.mouseOver:SetScript("OnEnter", nil) GT.baseFrame.button.mouseOver:SetScript("OnLeave", nil) + GT.baseFrame.button.mouseOver:SetMouseMotionEnabled(false) end end end diff --git a/GatheringTracker.toc b/GatheringTracker.toc index ffad540..803793e 100644 --- a/GatheringTracker.toc +++ b/GatheringTracker.toc @@ -2,7 +2,7 @@ ## Title: Gathering Tracker ## Notes: Addon for tracking gathered items, supports solo players and groups ## Author: Noshei -## Version: 2.6.2 +## Version: 2.6.3 ## OptionalDeps: TradeSkillMaster, RECrystallize, Auctionator ## SavedVariables: GatheringTrackerDB ## AddonCompartmentFunc: GatheringTracker_OnAddonCompartmentClick