mirror of
https://github.com/Bluewhale1337/ElvUIModernized.git
synced 2026-07-27 16:34:45 +00:00
update Bags skin
This commit is contained in:
@@ -3,7 +3,7 @@ local S = E:GetModule("Skins");
|
|||||||
|
|
||||||
--Cache global variables
|
--Cache global variables
|
||||||
--Lua functions
|
--Lua functions
|
||||||
local _G = getfenv()
|
local _G = _G
|
||||||
local unpack = unpack
|
local unpack = unpack
|
||||||
local match = string.match
|
local match = string.match
|
||||||
--WoW API / Variables
|
--WoW API / Variables
|
||||||
@@ -12,12 +12,12 @@ local GetContainerItemLink = GetContainerItemLink
|
|||||||
local BANK_CONTAINER = BANK_CONTAINER
|
local BANK_CONTAINER = BANK_CONTAINER
|
||||||
local NUM_CONTAINER_FRAMES = NUM_CONTAINER_FRAMES
|
local NUM_CONTAINER_FRAMES = NUM_CONTAINER_FRAMES
|
||||||
|
|
||||||
function S:ContainerFrame_Update(self)
|
function S:ContainerFrame_Update()
|
||||||
local id = self:GetID()
|
local id = this:GetID()
|
||||||
local name = self:GetName()
|
local name = this:GetName()
|
||||||
local _, itemButton, itemLink, quality
|
local _, itemButton, itemLink, quality
|
||||||
|
|
||||||
for i = 1, self.size, 1 do
|
for i = 1, this.size, 1 do
|
||||||
itemButton = _G[name.."Item"..i]
|
itemButton = _G[name.."Item"..i]
|
||||||
|
|
||||||
itemLink = GetContainerItemLink(id, itemButton:GetID())
|
itemLink = GetContainerItemLink(id, itemButton:GetID())
|
||||||
@@ -34,13 +34,18 @@ function S:ContainerFrame_Update(self)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function S:BankFrameItemButton_Update(button)
|
function S:BankFrameItemButton_OnUpdate()
|
||||||
if not button.isBag then
|
if not this.isBag then
|
||||||
local _, _, _, quality = GetContainerItemInfo(BANK_CONTAINER, button:GetID())
|
local itemLink = GetContainerItemLink(BANK_CONTAINER, this:GetID())
|
||||||
|
if itemLink then
|
||||||
|
local _, _, quality = GetItemInfo(match(itemLink, "item:(%d+)"))
|
||||||
if quality then
|
if quality then
|
||||||
button:SetBackdropBorderColor(GetItemQualityColor(quality))
|
this:SetBackdropBorderColor(GetItemQualityColor(quality))
|
||||||
else
|
else
|
||||||
button:SetBackdropBorderColor(unpack(E["media"].bordercolor))
|
this:SetBackdropBorderColor(unpack(E["media"].bordercolor))
|
||||||
|
end
|
||||||
|
else
|
||||||
|
this:SetBackdropBorderColor(unpack(E["media"].bordercolor))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -82,6 +87,7 @@ local function LoadSkin()
|
|||||||
end
|
end
|
||||||
|
|
||||||
S:SecureHook("ContainerFrame_Update")
|
S:SecureHook("ContainerFrame_Update")
|
||||||
|
S:SecureHookScript(ContainerFrame1, "OnShow", "ContainerFrame_Update")
|
||||||
|
|
||||||
-- BankFrame
|
-- BankFrame
|
||||||
E:CreateBackdrop(BankFrame, "Transparent")
|
E:CreateBackdrop(BankFrame, "Transparent")
|
||||||
@@ -136,7 +142,7 @@ local function LoadSkin()
|
|||||||
|
|
||||||
S:HandleButton(BankFramePurchaseButton)
|
S:HandleButton(BankFramePurchaseButton)
|
||||||
|
|
||||||
-- S:SecureHook("BankFrameItemButton_UpdateLock")
|
S:SecureHook("BankFrameItemButton_OnUpdate")
|
||||||
end
|
end
|
||||||
|
|
||||||
S:AddCallback("SkinBags", LoadSkin)
|
S:AddCallback("SkinBags", LoadSkin)
|
||||||
Reference in New Issue
Block a user