bag-search: prevent clipping and desaturate
This commit is contained in:
+17
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user