mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-05 21:20:00 +00:00
show item locks in bag- and bankframes
This commit is contained in:
@@ -55,6 +55,7 @@ pfUI:RegisterModule("bags", function ()
|
||||
pfUI.bag:RegisterEvent("BAG_CLOSED")
|
||||
pfUI.bag:RegisterEvent("BANKFRAME_CLOSED")
|
||||
pfUI.bag:RegisterEvent("BANKFRAME_OPENED")
|
||||
pfUI.bag:RegisterEvent("ITEM_LOCK_CHANGED")
|
||||
|
||||
pfUI.bag:SetScript("OnEvent", function()
|
||||
if event == "PLAYER_ENTERING_WORLD" or event == "UPDATE_FACTION" then
|
||||
@@ -108,6 +109,21 @@ pfUI:RegisterModule("bags", function ()
|
||||
pfUI.bag:CreateBags("bank")
|
||||
pfUI.bag.left:Hide()
|
||||
end
|
||||
|
||||
if event == "ITEM_LOCK_CHANGED" then
|
||||
for bag=-2, 11 do
|
||||
for slot=1, GetContainerNumSlots(bag) do
|
||||
if pfUI.bags[bag].slots[slot].frame:IsShown() then
|
||||
local _, _, locked, _ = GetContainerItemInfo(bag, slot)
|
||||
if locked then
|
||||
pfUI.bags[bag].slots[slot].frame:SetAlpha(.5)
|
||||
else
|
||||
pfUI.bags[bag].slots[slot].frame:SetAlpha(1)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
tinsert(UISpecialFrames,"pfBag")
|
||||
|
||||
Reference in New Issue
Block a user