diff --git a/Config.lua b/Config.lua index 38a50cd..2bc14e8 100644 --- a/Config.lua +++ b/Config.lua @@ -316,7 +316,7 @@ local generalOptions = { }, header2 = { type = "header", - name = "Instance Visibility", + name = "Other", order = 200 }, instanceHide = { @@ -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 = { @@ -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, diff --git a/FilterButton.lua b/FilterButton.lua index f604de7..7583dd0 100644 --- a/FilterButton.lua +++ b/FilterButton.lua @@ -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 @@ -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 diff --git a/GatheringTracker.lua b/GatheringTracker.lua index 0fe3326..8c3082d 100644 --- a/GatheringTracker.lua +++ b/GatheringTracker.lua @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/GatheringTracker.toc b/GatheringTracker.toc index ed0a6ce..7733e29 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.4.2 +## Version: 2.4.3 ## OptionalDeps: TradeSkillMaster ## SavedVariables: GatheringTrackerDB ## AddonCompartmentFunc: GatheringTracker_OnAddonCompartmentClick