Skip to content

Commit 812debd

Browse files
committed
Use spell id for icons
Resolves #94 Resolves #108
1 parent ba67e38 commit 812debd

File tree

2 files changed

+7
-37
lines changed

2 files changed

+7
-37
lines changed

Data/Auras.lua

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ local PET_FLAGS = bit.bor(
2323
_G.COMBATLOG_OBJECT_AFFILIATION_MINE
2424
)
2525

26+
local function getIcon(info)
27+
return GetSpellTexture(info.spellID or info.abilityName)
28+
end
29+
2630
local function retrieveDestName(info)
2731
if not info.recipientName then return end
2832
if Parrot.db.profile.showNameRealm then
@@ -50,40 +54,6 @@ local FindAura do
5054
end
5155
end
5256

53-
local getIcon do
54-
local iconCache = {}
55-
56-
local units = {
57-
player = true,
58-
pet = true,
59-
target = true,
60-
}
61-
for i = 1, 40 do
62-
units["nameplate"..i] = true
63-
-- units["raid"..i.."target"] = true
64-
end
65-
66-
local function getUnit(guid)
67-
for unit in next, units do
68-
if UnitGUID(unit) == guid then
69-
return unit
70-
end
71-
end
72-
end
73-
74-
function getIcon(info)
75-
local icon = GetSpellTexture(info.abilityName)
76-
if not icon then
77-
local _, texture = FindAura(getUnit(info.recipientID), info.abilityName, info.auraType == "DEBUFF" and "HARMFUL" or nil)
78-
if texture then
79-
iconCache[info.abilityName] = texture
80-
icon = texture
81-
end
82-
end
83-
return icon or iconCache[info.abilityName]
84-
end
85-
end
86-
8757
--[[============================================================================
8858
-- Players Auras
8959
--============================================================================]]

Data/CombatEvents.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,14 @@ end
172172
-- they tend to use a different icon from the original spell, which annoys some
173173
-- people.
174174
--]]
175-
local dumbTriggerSpellOverride = {
176-
}
175+
-- local dumbTriggerSpellOverride = {
176+
-- }
177177

178178
--[[
179179
-- helperfunction to retrieve an icon
180180
--]]
181181
local function retrieveIconFromAbilityName(info)
182-
return dumbTriggerSpellOverride[info.spellID] or GetSpellTexture(info.abilityName)
182+
return GetSpellTexture(info.spellID or info.abilityName) -- dumbTriggerSpellOverride[info.spellID] or
183183
end
184184

185185
--[[

0 commit comments

Comments
 (0)