From c55616ff8d8bc58c4c87236d395952d994590676 Mon Sep 17 00:00:00 2001 From: Dusk-92 Date: Sun, 23 Aug 2026 21:52:07 +0200 Subject: [PATCH] Route junk selling through central API layer --- mods/sell-junk.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mods/sell-junk.lua b/mods/sell-junk.lua index 1f62bf8..cfbbf2b 100644 --- a/mods/sell-junk.lua +++ b/mods/sell-junk.lua @@ -1,5 +1,6 @@ local _G = ShaguTweaks.GetGlobalEnv() local T = ShaguTweaks.T +local API = ShaguTweaks.API local module = ShaguTweaks:register({ title = T["Sell Junk"], @@ -25,7 +26,7 @@ local function CreateGoldString(money) end local function HasGreyItems() - return C_MerchantFrame.GetNumJunkItems() > 0 + return API.GetNumJunkItems() > 0 end module.enable = function(self) @@ -43,7 +44,7 @@ module.enable = function(self) -- ClassicAPI performs a real merchant sale and drains the queue one item -- per frame, without abusing UseContainerItem or a manual throttle. - C_MerchantFrame.SellAllJunkItems() + API.SellAllJunkItems() end) autovendor:SetScript("OnHide", function() @@ -62,7 +63,7 @@ module.enable = function(self) -- This frame is visible only while ClassicAPI's short sell queue is active. -- Polling a single engine count here replaces repeated full bag scans. autovendor:SetScript("OnUpdate", function() - if this.started and C_MerchantFrame.GetNumJunkItems() == 0 then + if this.started and API.GetNumJunkItems() == 0 then this:Hide() end end)