Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add trash items (white/grey) filtering in Classic #1714

Merged
merged 1 commit into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions locales/Default Locale.lua
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ L.SETTINGS_MENU = {
MAIN_ONLY_TOOLTIP = "Turn this setting on if you additionally want ATT to *pretend* that you've earned all shared appearances not locked by a different race or class.\n\nAs an example, if you have collected a Hunter-Only Tier Piece from ICC and there is a shared appearance from the raid without class/race restrictions, ATT will *pretend* that you've earned that source of the appearance as well.\n\nNOTE: Switching to a different race/class will incorrectly report that you've earned appearance sources that you haven't collected for that new chararacter when unlocked in this way.";
ONLY_RWP = "Only RWP";
ONLY_RWP_TOOLTIP = "Enable this option to only track transmog that get removed from the game in the future. Only Items tagged with 'removed with patch' data count toward this. If you find an item not tagged that should be tagged, please let me know!\n\nYou can change which sort of loot displays for you based on the Filters tab.";
ONLY_NOT_TRASH = "Filter Trash Items";
ONLY_NOT_TRASH_TOOLTIP = "Enable this option to ignore white/grey items. Blizzard does not yet provide API for it in Classic.";
UNOFFICIAL_SUPPORT_TOOLTIP = "NOTE: At this time, official support is not provided by WoW's API, but ATT can track items or quest completion to make it functional in the addon.";

-- General Content
Expand Down
1 change: 1 addition & 0 deletions src/Classes/Item.Classic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ app.CreateItem = app.CreateClass("Item", "itemID", itemFields,
"AsTransmog", {
collectible = app.GameBuildVersion >= 40000 and function(t)
if t.collectibleAsCost then return true; end
if app.Settings.OnlyNotTrash and (not t.q or t.q < 2) then return false; end
return app.Settings.Collectibles.Transmog;
end or function(t)
if t.collectibleAsCost then return true; end
Expand Down
2 changes: 2 additions & 0 deletions src/Settings/Classic Settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ local GeneralSettingsBase = {
["Thing:Transmog"] = app.GameBuildVersion >= 40000,
["DeathTracker"] = app.GameBuildVersion < 40000,
["Only:RWP"] = app.GameBuildVersion < 40000,
["Only:NotTrash"] = app.GameBuildVersion <= 40000,
["Skip:AutoRefresh"] = false,
["Show:CompletedGroups"] = false,
["Show:CollectedThings"] = false,
Expand Down Expand Up @@ -1126,6 +1127,7 @@ settings.UpdateMode = function(self, doRefresh)
filterSet.Event()
end
self.OnlyRWP = self:Get("Only:RWP");
self.OnlyNotTrash = self:Get("Only:NotTrash");
end
app.MODE_DEBUG_OR_ACCOUNT = app.MODE_DEBUG or app.MODE_ACCOUNT;

Expand Down
18 changes: 18 additions & 0 deletions src/Settings/Pages/General.lua
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,24 @@ if app.GameBuildVersion >= 40000 then -- Transmog officially supported with Cata
end)
checkboxMainOnlyMode:SetATTTooltip(L.MAIN_ONLY_TOOLTIP)
checkboxMainOnlyMode:AlignBelow(checkboxTransmog, 1)

local checkboxQualityFilter = child:CreateCheckBox(L.ONLY_NOT_TRASH,
function(self)
self:SetChecked(settings:Get("Only:NotTrash"))
if not settings:Get("Thing:Transmog") and not app.MODE_DEBUG then
self:Disable()
self:SetAlpha(0.4)
else
self:Enable()
self:SetAlpha(1)
end
end,
function(self)
settings:Set("Only:NotTrash", self:GetChecked());
settings:UpdateMode(1);
end)
checkboxQualityFilter:SetATTTooltip(L.ONLY_NOT_TRASH_TOOLTIP)
checkboxQualityFilter:AlignAfter(checkboxMainOnlyMode)
else
local checkboxOnlyRWP = child:CreateCheckBox(L.ONLY_RWP,
function(self)
Expand Down