Skip to content
Open
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
39 changes: 32 additions & 7 deletions modules/bags.lua
Original file line number Diff line number Diff line change
Expand Up @@ -983,16 +983,41 @@ pfUI:RegisterModule("bags", "vanilla:tbc", function ()
frame.search.edit:SetTextColor(.5,.5,.5,1)

frame.search.edit:SetScript("OnEditFocusGained", function()
this:SetText("")
if this:GetText() == T["Search"] then
this:SetText("")
end
end)

frame.search.edit:SetScript("OnEditFocusLost", function()
this:SetText(T["Search"])
for bag=-2, 11 do
local bagsize = GetContainerNumSlots(bag)
if bag == -2 and pfUI.bag.showKeyring == true then bagsize = GetKeyRingSize() end
for slot=1, bagsize do
pfUI.bags[bag].slots[slot].frame:SetAlpha(1)
if not pfUI.bag:IsShown() then
this:SetText(T["Search"])
for bag=-2, 11 do
local bagsize = GetContainerNumSlots(bag)
if bag == -2 and pfUI.bag.showKeyring == true then bagsize = GetKeyRingSize() end
for slot=1, bagsize do
pfUI.bags[bag].slots[slot].frame:SetAlpha(1)
end
end
end
end)

frame.search.edit:SetScript("OnLeave", function()
if GetMouseFocus() ~= this then
this:ClearFocus()
end
end)

frame.search:SetScript("OnHide", function()
frame.search.edit:SetText(T["Search"])
for bag = -2, 11 do
if pfUI.bags[bag] then
local bagsize = GetContainerNumSlots(bag)
if bag == -2 and pfUI.bag.showKeyring == true then bagsize = GetKeyRingSize() end
for slot = 1, bagsize do
if pfUI.bags[bag] then
pfUI.bags[bag].slots[slot].frame:SetAlpha(1)
end
end
end
end
end)
Expand Down