From 3069e8f3cfb84661934ab0264dc775327aa4257c Mon Sep 17 00:00:00 2001 From: Derek Mikesell Date: Sun, 31 May 2026 20:04:51 -0700 Subject: [PATCH] Add Crafting Current Expansion Only filter for Place Crafter Order window Mirrors the AH Current Expansion Only QoL toggle. Hooks the customer orders browse page's SetDefaultFilters to re-apply the CurrentExpansionOnly filter whenever the Place Crafter Order window opens, when enabled. --- EllesmereUIQoL/EUI_QoL_Options.lua | 16 ++++++++++++- EllesmereUIQoL/EllesmereUIQoL.lua | 36 ++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/EllesmereUIQoL/EUI_QoL_Options.lua b/EllesmereUIQoL/EUI_QoL_Options.lua index d60da6ac..2f9a6142 100644 --- a/EllesmereUIQoL/EUI_QoL_Options.lua +++ b/EllesmereUIQoL/EUI_QoL_Options.lua @@ -228,6 +228,18 @@ initFrame:SetScript("OnEvent", function(self) if not EllesmereUIDB then EllesmereUIDB = {} end EllesmereUIDB.ahCurrentExpansion = v end }, + { type="toggle", text="Crafting Current Expansion Only", + tooltip="Automatically enables the 'Current Expansion Only' filter whenever you open the Place Crafter Order window.", + getValue=function() + return EllesmereUIDB and EllesmereUIDB.craftingCurrentExpansion or false + end, + setValue=function(v) + if not EllesmereUIDB then EllesmereUIDB = {} end + EllesmereUIDB.craftingCurrentExpansion = v + end } + ); y = y - h + + _, h = W:DualRow(parent, y, { type="toggle", text="Hide Talking Head", tooltip="Hides the large NPC dialogue popup that appears during quests and dungeons.", getValue=function() @@ -236,7 +248,8 @@ initFrame:SetScript("OnEvent", function(self) setValue=function(v) if not EllesmereUIDB then EllesmereUIDB = {} end EllesmereUIDB.hideTalkingHead = v - end } + end }, + { type="label", text="" } ); y = y - h -- Row 5: Show Coordinates on Map (left, with cog) | empty @@ -1243,6 +1256,7 @@ initFrame:SetScript("OnEvent", function(self) EllesmereUIDB.quickSignup = false EllesmereUIDB.persistSignupNote = false EllesmereUIDB.ahCurrentExpansion = false + EllesmereUIDB.craftingCurrentExpansion = false EllesmereUIDB.healthMacroEnabled = false EllesmereUIDB.healthMacroPrio1 = 1 EllesmereUIDB.healthMacroPrio2 = 2 diff --git a/EllesmereUIQoL/EllesmereUIQoL.lua b/EllesmereUIQoL/EllesmereUIQoL.lua index ea036de1..b1ddc2ba 100644 --- a/EllesmereUIQoL/EllesmereUIQoL.lua +++ b/EllesmereUIQoL/EllesmereUIQoL.lua @@ -435,6 +435,42 @@ qolFrame:SetScript("OnEvent", function(self) end) end + --------------------------------------------------------------------------- + -- Crafting Current Expansion Only (Place Crafter Order window) + --------------------------------------------------------------------------- + do + local hooked = false + local function HookBrowseFilters() + if hooked then return end + local browse = ProfessionsCustomerOrdersFrame and ProfessionsCustomerOrdersFrame.BrowseOrders + if not browse or not browse.SetDefaultFilters then return end + hooked = true + -- SetDefaultFilters runs every time the window opens (via Init), resetting + -- the filter table; re-apply Current Expansion Only afterward when enabled. + hooksecurefunc(browse, "SetDefaultFilters", function(self) + if not (EllesmereUIDB and EllesmereUIDB.craftingCurrentExpansion) then return end + if not (Enum and Enum.AuctionHouseFilter and Enum.AuctionHouseFilter.CurrentExpansionOnly) then return end + local fd = self.SearchBar and self.SearchBar.FilterDropdown + if fd and fd.filters then + fd.filters[Enum.AuctionHouseFilter.CurrentExpansionOnly] = true + end + end) + end + + local coFrame = CreateFrame("Frame") + coFrame:RegisterEvent("ADDON_LOADED") + coFrame:SetScript("OnEvent", function(self, event, addonName) + if addonName == "Blizzard_ProfessionsCustomerOrders" then + self:UnregisterEvent("ADDON_LOADED") + HookBrowseFilters() + end + end) + + if C_AddOns and C_AddOns.IsAddOnLoaded and C_AddOns.IsAddOnLoaded("Blizzard_ProfessionsCustomerOrders") then + HookBrowseFilters() + end + end + --------------------------------------------------------------------------- -- Auto Sell Junk + Auto Repair ---------------------------------------------------------------------------