diff --git a/ElvUI/Core/core.lua b/ElvUI/Core/core.lua index 0d609ad..321a1a6 100644 --- a/ElvUI/Core/core.lua +++ b/ElvUI/Core/core.lua @@ -341,20 +341,24 @@ function E:UpdateFrameTemplates() end function E:UpdateBorderColors() - for frame in pairs(self["frames"]) do - if(frame) then - if(frame.template == "Default" or frame.template == "Transparent" or frame.template == nil) then - frame:SetBackdropBorderColor(unpack(self["media"].bordercolor)) + for frame, _ in pairs(self["frames"]) do + if frame and not frame.ignoreUpdates then + if not frame.ignoreBorderColors then + if frame.template == "Default" or frame.template == "Transparent" or frame.template == nil then + frame:SetBackdropBorderColor(unpack(self["media"].bordercolor)) + end end else self["frames"][frame] = nil end end - for frame in pairs(self["unitFrameElements"]) do + for frame, _ in pairs(self["unitFrameElements"]) do if frame and not frame.ignoreUpdates then - if frame.template == "Default" or frame.template == "Transparent" or frame.template == nil then - frame:SetBackdropBorderColor(unpack(self["media"].unitframeBorderColor)) + if not frame.ignoreBorderColors then + if frame.template == "Default" or frame.template == "Transparent" or frame.template == nil then + frame:SetBackdropBorderColor(unpack(self["media"].unitframeBorderColor)) + end end else self["unitFrameElements"][frame] = nil @@ -364,15 +368,13 @@ end function E:UpdateBackdropColors() for frame, _ in pairs(self["frames"]) do - if(frame) then - if(frame.template == "Default" or frame.template == nil) then - if(frame.backdropTexture) then - frame.backdropTexture:SetVertexColor(unpack(self["media"].backdropcolor)) - else + if frame then + if not frame.ignoreBackdropColors then + if frame.template == "Default" or frame.template == nil then frame:SetBackdropColor(unpack(self["media"].backdropcolor)) + elseif frame.template == "Transparent" then + frame:SetBackdropColor(unpack(self["media"].backdropfadecolor)) end - elseif(frame.template == "Transparent") then - frame:SetBackdropColor(unpack(self["media"].backdropfadecolor)) end else self["frames"][frame] = nil @@ -381,14 +383,12 @@ function E:UpdateBackdropColors() for frame, _ in pairs(self["unitFrameElements"]) do if frame then - if frame.template == "Default" or frame.template == nil then - if frame.backdropTexture then - frame.backdropTexture:SetVertexColor(unpack(self["media"].backdropcolor)) - else + if not frame.ignoreBackdropColors then + if frame.template == "Default" or frame.template == nil then frame:SetBackdropColor(unpack(self["media"].backdropcolor)) + elseif frame.template == "Transparent" then + frame:SetBackdropColor(unpack(self["media"].backdropfadecolor)) end - elseif frame.template == "Transparent" then - frame:SetBackdropColor(unpack(self["media"].backdropfadecolor)) end else self["unitFrameElements"][frame] = nil @@ -412,9 +412,9 @@ end function E:UpdateStatusBars() for _, statusBar in pairs(self.statusBars) do - if(statusBar and statusBar:GetObjectType() == "StatusBar") then + if (statusBar and statusBar:GetObjectType() == "StatusBar") then statusBar:SetStatusBarTexture(self.media.normTex) - elseif(statusBar and statusBar:GetObjectType() == "Texture") then + elseif (statusBar and statusBar:GetObjectType() == "Texture") then statusBar:SetTexture(self.media.normTex) end end diff --git a/ElvUI/Media/Textures/INV_Pet_Broom.blp b/ElvUI/Media/Textures/INV_Pet_Broom.blp new file mode 100644 index 0000000..964469a Binary files /dev/null and b/ElvUI/Media/Textures/INV_Pet_Broom.blp differ diff --git a/ElvUI/Media/Textures/INV_Pet_RatCage.blp b/ElvUI/Media/Textures/INV_Pet_RatCage.blp deleted file mode 100644 index cd16708..0000000 Binary files a/ElvUI/Media/Textures/INV_Pet_RatCage.blp and /dev/null differ diff --git a/ElvUI/Modules/Bags/Bags.lua b/ElvUI/Modules/Bags/Bags.lua index 2e19a37..4f3ed36 100644 --- a/ElvUI/Modules/Bags/Bags.lua +++ b/ElvUI/Modules/Bags/Bags.lua @@ -247,6 +247,7 @@ function B:UpdateSlot(bagID, slotID) if B.ProfessionColors[bagType] then slot:SetBackdropBorderColor(unpack(B.ProfessionColors[bagType])) + slot.ignoreBorderColors = true elseif clink then local _, iLvl, itemEquipLoc slot.name, _, slot.rarity, iLvl, _, _, _, itemEquipLoc = GetItemInfo(match(clink, "item:(%d+)")) @@ -266,13 +267,16 @@ function B:UpdateSlot(bagID, slotID) end -- color slot according to item quality - if slot.rarity then + if slot.rarity and slot.rarity > 1 then slot:SetBackdropBorderColor(r, g, b) + slot.ignoreBorderColors = true else slot:SetBackdropBorderColor(unpack(E.media.bordercolor)) + slot.ignoreBorderColors = true end else slot:SetBackdropBorderColor(unpack(E.media.bordercolor)) + slot.ignoreBorderColors = true end if texture then @@ -674,11 +678,14 @@ function B:UpdateKeySlot(slotID) if slot.rarity and slot.rarity > 1 then slot:SetBackdropBorderColor(r, g, b) + slot.ignoreBorderColors = true else slot:SetBackdropBorderColor(unpack(E.media.bordercolor)) + slot.ignoreBorderColors = true end else slot:SetBackdropBorderColor(unpack(E.media.bordercolor)) + slot.ignoreBorderColors = true end if texture then @@ -709,15 +716,14 @@ function B:UpdateAll() end function B:OnEvent() + local bag, slot = arg1, arg2 if event == "ITEM_LOCK_CHANGED" or event == "ITEM_UNLOCKED" then - local bag, slot = arg1, arg2 if bag == KEYRING_CONTAINER then B:UpdateKeySlot(slot) else this:UpdateSlot(bag, slot) end elseif event == "BAG_UPDATE" then - local bag = arg1 if bag == KEYRING_CONTAINER then if not _G["ElvUIKeyFrameItem"..GetKeyRingSize()] then B:Layout(false) @@ -735,7 +741,9 @@ function B:OnEvent() end end - this:UpdateBagSlots(arg1, arg2) + this:UpdateBagSlots(bag, slot) + + --Refresh search in case we moved items around if B:IsSearching() then B:SetSearch(SEARCH_STRING) end @@ -915,13 +923,13 @@ function B:ContructContainerFrame(name, isBank) E:Size(f.sortButton, 16 + E.Border) E:SetTemplate(f.sortButton) E:Point(f.sortButton, "RIGHT", f.bagText, "LEFT", -5, E.Border * 2) - f.sortButton:SetNormalTexture("Interface\\AddOns\\ElvUI\\media\\textures\\INV_Pet_RatCage") + f.sortButton:SetNormalTexture("Interface\\AddOns\\ElvUI\\media\\textures\\INV_Pet_Broom") f.sortButton:GetNormalTexture():SetTexCoord(unpack(E.TexCoords)) E:SetInside(f.sortButton:GetNormalTexture()) - f.sortButton:SetPushedTexture("Interface\\AddOns\\ElvUI\\media\\textures\\INV_Pet_RatCage") + f.sortButton:SetPushedTexture("Interface\\AddOns\\ElvUI\\media\\textures\\INV_Pet_Broom") f.sortButton:GetPushedTexture():SetTexCoord(unpack(E.TexCoords)) E:SetInside(f.sortButton:GetPushedTexture()) - f.sortButton:SetDisabledTexture("Interface\\AddOns\\ElvUI\\media\\textures\\INV_Pet_RatCage") + f.sortButton:SetDisabledTexture("Interface\\AddOns\\ElvUI\\media\\textures\\INV_Pet_Broom") f.sortButton:GetDisabledTexture():SetTexCoord(unpack(E.TexCoords)) E:SetInside(f.sortButton:GetDisabledTexture()) f.sortButton:GetDisabledTexture():SetDesaturated(true) @@ -1026,13 +1034,13 @@ function B:ContructContainerFrame(name, isBank) E:Size(f.sortButton, 16 + E.Border) E:SetTemplate(f.sortButton) E:Point(f.sortButton, "RIGHT", f.goldText, "LEFT", -5, E.Border * 2) - f.sortButton:SetNormalTexture("Interface\\AddOns\\ElvUI\\media\\textures\\INV_Pet_RatCage") + f.sortButton:SetNormalTexture("Interface\\AddOns\\ElvUI\\media\\textures\\INV_Pet_Broom") f.sortButton:GetNormalTexture():SetTexCoord(unpack(E.TexCoords)) E:SetInside(f.sortButton:GetNormalTexture()) - f.sortButton:SetPushedTexture("Interface\\AddOns\\ElvUI\\media\\textures\\INV_Pet_RatCage") + f.sortButton:SetPushedTexture("Interface\\AddOns\\ElvUI\\media\\textures\\INV_Pet_Broom") f.sortButton:GetPushedTexture():SetTexCoord(unpack(E.TexCoords)) E:SetInside(f.sortButton:GetPushedTexture()) - f.sortButton:SetDisabledTexture("Interface\\AddOns\\ElvUI\\media\\textures\\INV_Pet_RatCage") + f.sortButton:SetDisabledTexture("Interface\\AddOns\\ElvUI\\media\\textures\\INV_Pet_Broom") f.sortButton:GetDisabledTexture():SetTexCoord(unpack(E.TexCoords)) E:SetInside(f.sortButton:GetDisabledTexture()) f.sortButton:GetDisabledTexture():SetDesaturated(true) @@ -1371,11 +1379,10 @@ function B:Initialize() self.BagFrame = self:ContructContainerFrame("ElvUI_ContainerFrame") --Hook onto Blizzard Functions - self:RawHook("ToggleBag", "ToggleBags") - self:RawHook("OpenBackpack", "OpenBags") - self:RawHook("CloseAllBags", "CloseBags") - self:RawHook("CloseBackpack", "CloseBags") - self:RawHook("ToggleBackpack", "ToggleBags") + self:RawHook("ToggleBag", "ToggleBags", true) + self:RawHook("OpenBackpack", "OpenBags", true) + self:RawHook("CloseAllBags", "CloseBags", true) + self:RawHook("CloseBackpack", "CloseBags", true) self:RawHook("OpenAllBags", "OpenAllBags", true) self:Layout() diff --git a/ElvUI/Modules/Skins/Blizzard/Bags.lua b/ElvUI/Modules/Skins/Blizzard/Bags.lua index 396132a..3ff6260 100644 --- a/ElvUI/Modules/Skins/Blizzard/Bags.lua +++ b/ElvUI/Modules/Skins/Blizzard/Bags.lua @@ -23,13 +23,16 @@ function S:ContainerFrame_Update() itemLink = GetContainerItemLink(id, itemButton:GetID()) if itemLink then _, _, quality = GetItemInfo(match(itemLink, "item:(%d+)")) - if quality then + if quality and quality > 1 then itemButton:SetBackdropBorderColor(GetItemQualityColor(quality)) + itemButton.ignoreBorderColors = true else itemButton:SetBackdropBorderColor(unpack(E["media"].bordercolor)) + itemButton.ignoreBorderColors = true end else itemButton:SetBackdropBorderColor(unpack(E["media"].bordercolor)) + itemButton.ignoreBorderColors = true end end end @@ -39,13 +42,16 @@ function S:BankFrameItemButton_OnUpdate() local itemLink = GetContainerItemLink(BANK_CONTAINER, this:GetID()) if itemLink then local _, _, quality = GetItemInfo(match(itemLink, "item:(%d+)")) - if quality then + if quality and quality > 1 then this:SetBackdropBorderColor(GetItemQualityColor(quality)) + this.ignoreBorderColors = true else this:SetBackdropBorderColor(unpack(E["media"].bordercolor)) + this.ignoreBorderColors = true end else this:SetBackdropBorderColor(unpack(E["media"].bordercolor)) + this.ignoreBorderColors = true end end end @@ -97,7 +103,7 @@ local function LoadSkin() E:StripTextures(BankFrame, true) - S:HandleCloseButton(BankCloseButton) + S:HandleCloseButton(BankCloseButton, BankFrame.backdrop) local button, buttonIcon for i = 1, NUM_BANKGENERIC_SLOTS, 1 do