Skip to content

Commit 42cb42e

Browse files
committed
fix dispelable aura highlight
1 parent 95a11b6 commit 42cb42e

File tree

3 files changed

+15
-20
lines changed

3 files changed

+15
-20
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
- Update spells for patch 11.0.0
1313
- Added cataclysm spells
1414
- Fix cataclysm cooldowns
15+
- Fix dispelable aura highlight
1516

1617
## [5.0.0] - 2024-07-27
1718

Filger.lua

+13-19
Original file line numberDiff line numberDiff line change
@@ -179,29 +179,22 @@ do
179179
* index - the actual position of the aura button (number)
180180
]]--
181181
function aura_proto:UpdateColor(button, unit, data)
182-
-- dispel harmful effects from friendly target.
183-
-- dispell beneficial effects from enemy target.
184-
local dispelType = LibDispel:GetDispelType(data.spellId, data.dispelName)
185-
local isDispelable = LibDispel:IsDispelable(unit, data.spellId, dispelType, data.isHarmful)
186-
187-
if (data.isHarmful and UnitCanAssist("player", unit)) or (data.isHelpful and UnitCanAttack(unit, "player")) then
188-
local color = Filger.colors[dispelType]
189-
if button.Backdrop then
182+
if button.Backdrop then
183+
if (data.isHarmful and UnitCanAssist("player", unit)) or (data.isHelpful and UnitCanAttack(unit, "player") and UnitCanAttack("player", unit)) then
184+
local color = Filger.colors[data.dispelName]
190185
button.Backdrop:SetBackdropBorderColor(color.r, color.g, color.b, color.a or 1)
191-
end
192-
else
193-
local color = Filger.config.general.backdrop.color
194-
if button.Backdrop then
186+
else
187+
local color = Filger.config.general.backdrop.color
195188
button.Backdrop:SetBackdropBorderColor(color.r, color.g, color.b, color.a or 1)
196189
end
197190
end
198191

199-
if button.Icon then
192+
if button.Icon and self.desaturated == true then
200193
button.Icon:SetDesaturated(data.isHarmful and not data.isPlayerAura and not UnitIsUnit(unit, "player"))
201194
end
202195

203196
if button.Animation then
204-
if isDispelable or data.isStealable then
197+
if data.isDispelable or data.isStealable then
205198
button.Animation:Play()
206199
button.Animation.playing = true
207200
else
@@ -331,8 +324,11 @@ do
331324

332325
data.isPlayerAura = data.sourceUnit and (UnitIsUnit("player", data.sourceUnit) or UnitIsOwnerOrControllerOfUnit("player", data.sourceUnit))
333326

327+
data.dispelName = LibDispel:GetDispelType(data.spellId, data.dispelName)
328+
data.isDispelable = LibDispel:IsDispelable(unit, data.spellId, data.dispelName, data.isHarmful)
329+
334330
local spell = self.spells[data.spellId]
335-
data.isSpell = spell and spell.enabled or false
331+
data.enabled = spell and spell.enabled or false
336332
data.priority = spell and spell.priority or 0
337333

338334
return data
@@ -669,11 +665,9 @@ do
669665
self:UpdateCooldowns("SPELL_UPDATE_COOLDOWN", self.unit)
670666
end
671667

668+
-- register which spell the player cast
672669
function cooldown_proto:UNIT_SPELLCAST_SUCCEEDED(unit, guid, spellId)
673-
local name = GetSpellName(spellId)
674-
if name then
675-
self.casted[spellId] = true
676-
end
670+
self.casted[spellId] = true
677671
end
678672
end
679673

libs/LibDispel

0 commit comments

Comments
 (0)