Skip to content

Commit

Permalink
2.6.3
Browse files Browse the repository at this point in the history
Fixed errors with custom filters
Fixed error when deleting a profile
Cleaned up static tables
Fixed issue with tooltip for the first item displayed
  • Loading branch information
Noshei committed Oct 21, 2024
1 parent a56acbd commit 5587e66
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 69 deletions.
12 changes: 7 additions & 5 deletions Config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
Expand Down Expand Up @@ -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
Expand All @@ -1563,7 +1566,7 @@ function GT:CreateCustomFilterOptions()

return data
end,
order = (id + 1000)
order = (itemID + 1000)
}
AceConfigRegistry:NotifyChange("GT/Filter")
end)
Expand Down Expand Up @@ -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")

Expand Down
96 changes: 35 additions & 61 deletions Constants.lua
Original file line number Diff line number Diff line change
@@ -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 = {
Expand Down
2 changes: 2 additions & 0 deletions DisplayCreation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions FilterButton.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion GatheringTracker.toc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5587e66

Please sign in to comment.