Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding IconOverlay Support #445

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
24 changes: 23 additions & 1 deletion widgets/ItemButton.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ local ITEM_SIZE = addon.ITEM_SIZE

local buttonClass, buttonProto = addon:NewClass("ItemButton", "ItemButton", "ContainerFrameItemButtonTemplate", "ABEvent-1.0")

local childrenNames = { "Cooldown", "IconTexture", "IconQuestTexture", "Count", "Stock", "NormalTexture", "NewItemTexture" }
local childrenNames = { "Cooldown", "IconTexture", "IconQuestTexture", "Count", "Stock", "NormalTexture", "NewItemTexture", "IconOverlay" }

function buttonProto:OnCreate()
local name = self:GetName()
Expand Down Expand Up @@ -304,6 +304,7 @@ function buttonProto:Update()
else
self.Stock:Hide()
end
self:UpdateOverlay()
self:UpdateCount()
self:UpdateBorder()
self:UpdateCooldown()
Expand Down Expand Up @@ -414,6 +415,27 @@ function buttonProto:UpdateBorder(isolatedEvent)
end
end

function buttonProto:UpdateOverlay(isolatedEvent)
if self.hasItem then
local overlay = self.IconOverlay
local textureName = nil
if C_AzeriteEmpoweredItem.IsAzeriteEmpoweredItemByID(self.itemLink or self.itemId) then
textureName = "AzeriteIconFrame"
elseif IsCorruptedItem(self.itemLink or self.itemId) then
textureName = "Nzoth-inventory-icon"
end
overlay:Hide();
if textureName then
overlay:SetAtlas(textureName);
overlay:SetBlendMode("BLEND");
overlay:Show();
end
end
if isolatedEvent then
addon:SendMessage('AdiBags_UpdateOverlay', self)
end
end

--------------------------------------------------------------------------------
-- Item stack button
--------------------------------------------------------------------------------
Expand Down