Skip to content

Commit

Permalink
2.4.3
Browse files Browse the repository at this point in the history
Added option to display items with 0 count
Increased maximum column size to 50
Fixed issue with the display returning after disabling through the addon options
  • Loading branch information
Noshei committed Sep 23, 2024
1 parent a9b550e commit ae3cbce
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 8 deletions.
26 changes: 24 additions & 2 deletions Config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ local generalOptions = {
},
header2 = {
type = "header",
name = "Instance Visibility",
name = "Other",
order = 200
},
instanceHide = {
Expand All @@ -335,6 +335,28 @@ local generalOptions = {
end,
order = 210
},
allFiltered = {
type = "toggle",
name = "Display All Filtered Items",
desc =
"When selected all selected filtered items will be displayed, including those with 0 count.\n\n" ..
"Not recommended to be used with a large number of enabled filters as it will cause significant lag.\n\n" ..
"|cffff0000Automatically disables with over 500 filters selected.|r",
width = 1.70,
get = function() return GT.db.profile.General.allFiltered end,
set = function(_, key)
GT.db.profile.General.allFiltered = key
GT:InventoryUpdate("Toggle Display All", false)
end,
disabled = function()
if #GT.IDs > 500 then
return true
else
return false
end
end,
order = 220
},
},
},
LookandFeel = {
Expand Down Expand Up @@ -487,7 +509,7 @@ local generalOptions = {
name = "Max Rows Per Column",
desc = "Set the maximum number of rows to be displayed per column.",
min = 1,
max = 30,
max = 50,
step = 1,
width = 1.70,
get = function() return GT.db.profile.General.numRows or 1 end,
Expand Down
12 changes: 10 additions & 2 deletions FilterButton.lua
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@ function GT:GenerateFiltersMenu(frame)
GT.baseFrame.button[expansion][category] = GT.baseFrame.button[expansion]:CreateCheckbox(category, IsSelected_Category, SetSelected_Category)
if category == "Knowledge" then
local columns = 3

--GT.baseFrame.button[expansion][category]:SetGridMode(MenuConstants.VerticalGridDirection, columns)
end
GT.baseFrame.button[expansion][category]:SetScrollMode(GetScreenHeight() * 0.75)
for _, itemData in ipairs(GT.ItemData[expansion][category]) do
Expand Down Expand Up @@ -397,3 +395,13 @@ function GT:CreateProfilesList(rootDescription)
GT.baseFrame.button["Profiles"][name] = GT.baseFrame.button["Profiles"]:CreateCheckbox(name, IsSelected_Profile, SetSelected_Profile)
end
end

function GT:DisplayAllCheck()
if not GT.db.profile.General.allFiltered then
return
end

if #GT.IDs > 500 then
GT.db.profile.General.allFiltered = false
end
end
11 changes: 8 additions & 3 deletions GatheringTracker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ function GT:OptionsHide()
GT.NotificationPause = true

--Do an inventory update if we dont have any information
if #GT.InventoryData == 0 then
if #GT.InventoryData == 0 and GT.Enabled then
GT:InventoryUpdate("InterfaceOptionsFrame:OnHide", false)
end
end
Expand Down Expand Up @@ -708,7 +708,7 @@ function GT:CleanUpInventoryData()
end

-- Removes Items that have a total count of 0
if GT:SumTable(itemData.counts) == 0 then
if GT:SumTable(itemData.counts) == 0 and not GT.db.profile.General.allFiltered then
GT.Debug("CleanUpInventoryData", 2, itemID, GT:SumTable(itemData.counts))
GT:RemoveItemData(false, itemID)
end
Expand Down Expand Up @@ -748,6 +748,9 @@ function GT:InventoryUpdate(event, wait)
GT.Debug(traceback, 1, event)
return
end
if not GT.Enabled then
return
end
if GT:CheckModeStatus() == false then
GT.Debug("InventoryUpdate: CheckModeStatus", 2, GT:CheckModeStatus())
return
Expand All @@ -763,6 +766,8 @@ function GT:InventoryUpdate(event, wait)
GT.PlayerEnteringWorld = false
end

GT:DisplayAllCheck()

GT:ProcessSoloData(event)

if GT.db.profile.General.groupType > 0 and IsInGroup() then
Expand All @@ -786,7 +791,7 @@ function GT:ProcessSoloData(event)
itemCount = GetItemCount(id, GT.db.profile.General.includeBank, false)
end

if itemCount > 0 then
if itemCount > 0 or GT.db.profile.General.allFiltered then
itemTable[id] = itemCount
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.4.2
## Version: 2.4.3
## OptionalDeps: TradeSkillMaster
## SavedVariables: GatheringTrackerDB
## AddonCompartmentFunc: GatheringTracker_OnAddonCompartmentClick
Expand Down

0 comments on commit ae3cbce

Please sign in to comment.