From cf669abb5e32a857dab0c9d78b0d9ed833ccce19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1?= Date: Fri, 25 Jul 2025 20:36:00 +0200 Subject: [PATCH] bag-search: prevent clipping and desaturate --- mods/bag-search.lua | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/mods/bag-search.lua b/mods/bag-search.lua index d272879..6c2d099 100644 --- a/mods/bag-search.lua +++ b/mods/bag-search.lua @@ -29,6 +29,10 @@ module.enable = function(self) search.icon = search.button:CreateTexture(nil, "OVERLAY") search.icon:SetAllPoints(search.button) + ShaguTweaks.HookScript(ContainerFrame1, "OnShow", function() + if this:GetID() == 0 then search:Show() else search:Hide() end + end) + local enable = function() search.icon:SetTexture("Interface\\Buttons\\UI-Panel-MinimizeButton-Up") search:SetAlpha(1) @@ -58,14 +62,20 @@ module.enable = function(self) for j = 1, MAX_CONTAINER_ITEMS do local button = _G[name.."Item"..j] + local texture = _G[button:GetName().."IconTexture"] if button then local slot = button and button:GetID() + local link = GetContainerItemLink(bag, slot) button:SetAlpha(.25) + texture:SetDesaturated(1) local item = link and string.sub(link, string.find(link, "%[")+1, string.find(link, "%]")-1) or "" - if strfind(strlower(item), text, 1, true) then button:SetAlpha(1) end + if strfind(strlower(item), text, 1, true) then + button:SetAlpha(1) + texture:SetDesaturated(0) + end end end end @@ -75,12 +85,17 @@ module.enable = function(self) if BankFrame:IsVisible() then for i = 1, 28 do local button = _G["BankFrameItem"..i] + local texture = _G[button:GetName().."IconTexture"] if button then local link = GetContainerItemLink(-1, i) button:SetAlpha(.25) + texture:SetDesaturated(1) local item = link and string.sub(link, string.find(link, "%[")+1, string.find(link, "%]")-1) or "" - if strfind(strlower(item), text, 1, true) then button:SetAlpha(1) end + if strfind(strlower(item), text, 1, true) then + button:SetAlpha(1) + texture:SetDesaturated(0) + end end end end