Verified Commit 39712c20 authored by Merathilis's avatar Merathilis
Browse files

Show a Cosmetic Indicator if the item is only Cosmetic.

parent fa301b1f
......@@ -102,6 +102,9 @@ local SEARCH = SEARCH
local C_Item_GetCurrentItemLevel = C_Item.GetCurrentItemLevel
local C_CurrencyInfo_GetBackpackCurrencyInfo = C_CurrencyInfo.GetBackpackCurrencyInfo
local C_AzeriteEmpoweredItem_IsAzeriteEmpoweredItemByID = C_AzeriteEmpoweredItem.IsAzeriteEmpoweredItemByID
local C_Soulbinds_IsItemConduitByItemInfo = C_Soulbinds.IsItemConduitByItemInfo
local IsCosmeticItem = IsCosmeticItem
-- GLOBALS: ElvUIBags, ElvUIBagMover, ElvUIBankMover, ElvUIReagentBankFrame, ElvUIReagentBankFrameItem1
-- 8.3 this are now local in blizzard files. Copy & Pasted:
......@@ -118,6 +121,18 @@ B.BAG_FILTER_ICONS = {
[_G.LE_BAG_FILTER_FLAG_TRADE_GOODS] = 132906, -- Interface/ICONS/INV_Fabric_Silk_02
}
local function GetIconOverlayAtlas(slot)
if not slot then return end
if C_AzeriteEmpoweredItem_IsAzeriteEmpoweredItemByID(slot) then
return 'AzeriteIconFrame'
elseif IsCosmeticItem(slot) then
return 'CosmeticIconFrame'
elseif C_Soulbinds_IsItemConduitByItemInfo(slot) then
return 'ConduitIconFrame', 'ConduitIconFrame-Corners'
end
end
function B:GetContainerFrame(arg)
if type(arg) == 'boolean' and (arg == true) then
return B.BankFrame
......@@ -503,6 +518,18 @@ function B:UpdateSlot(frame, bagID, slotID)
B:UpdateItemUpgradeIcon(slot)
end
local atlas, secondAtlas = GetIconOverlayAtlas(slotID)
if atlas then
slot.IconOverlay:SetAtlas(atlas)
slot.IconOverlay:Show()
if secondAtlas then
local color = E.QualityColors[slotID.rarity or 1]
slot.IconOverlay:SetVertexColor(color.r, color.g, color.b)
slot.IconOverlay2:SetAtlas(secondAtlas)
slot.IconOverlay2:Show()
end
end
slot.itemLevel:SetText('')
slot.bindType:SetText('')
......
......@@ -8,9 +8,11 @@ local pairs, ipairs, type = pairs, ipairs, type
local EquipmentManager_GetItemInfoByLocation = EquipmentManager_GetItemInfoByLocation
local FauxScrollFrame_GetOffset = FauxScrollFrame_GetOffset
local GetFactionInfo = GetFactionInfo
local GetInventoryItemLink = GetInventoryItemLink
local GetNumFactions = GetNumFactions
local hooksecurefunc = hooksecurefunc
local IsAddOnLoaded = IsAddOnLoaded
local IsCosmeticItem = IsCosmeticItem
local ITEM_QUALITY_COLORS = ITEM_QUALITY_COLORS
local FLYOUT_LOCATIONS = {
......@@ -36,6 +38,11 @@ local function UpdateAzeriteEmpoweredItem(self)
self.AzeriteTexture:SetDrawLayer('BORDER', 1)
end
local function UpdateCosmetic(self)
local itemLink = GetInventoryItemLink("player", self:GetID())
self.IconOverlay:SetShown(itemLink and IsCosmeticItem(itemLink))
end
local function ColorizeStatPane(frame)
if frame.leftGrad then return end
......@@ -288,6 +295,8 @@ function S:CharacterFrame()
Slot:StyleButton(Slot)
Slot.icon:SetInside()
Slot.ignoreTexture:SetTexture([[Interface\PaperDollInfoFrame\UI-GearManager-LeaveItem-Transparent]])
Slot.IconOverlay:SetAtlas('CosmeticIconFrame')
Slot.IconOverlay:SetInside()
S:HandleIconBorder(Slot.IconBorder)
......@@ -308,6 +317,8 @@ function S:CharacterFrame()
highlight:SetTexture(E.Media.Textures.White8x8)
highlight:SetVertexColor(1, 1, 1, .25)
highlight:SetInside()
UpdateCosmetic(slot)
end)
--Give character frame model backdrop it's color back
......
......@@ -3,8 +3,16 @@ local S = E:GetModule('Skins')
local _G = _G
local pairs = pairs
local GetInventoryItemLink = GetInventoryItemLink
local IsCosmeticItem = IsCosmeticItem
local hooksecurefunc = hooksecurefunc
local function UpdateCosmetic(self)
local unit = _G.InspectFrame.unit
local itemLink = unit and GetInventoryItemLink(unit, self:GetID())
self.IconOverlay:SetShown(itemLink and IsCosmeticItem(itemLink))
end
function S:Blizzard_InspectUI()
if not (E.private.skins.blizzard.enable and E.private.skins.blizzard.inspect) then return end
......@@ -93,10 +101,18 @@ function S:Blizzard_InspectUI()
Slot.icon:SetInside()
Slot:StripTextures()
Slot:StyleButton()
Slot.IconOverlay:SetAtlas('CosmeticIconFrame')
Slot.IconOverlay:SetInside()
S:HandleIconBorder(Slot.IconBorder, Slot.icon.backdrop)
end
end
hooksecurefunc('InspectPaperDollItemSlotButton_Update', function(button)
button.icon:SetShown(button.hasItem)
UpdateCosmetic(button)
end)
InspectPVPFrame.BG:Kill()
_G.InspectGuildFrameBG:Kill()
_G.InspectTalentFrame:StripTextures()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment