-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature] Add PostUpdate API fn to Auras & Glow Helpers (#91)
* Add util functions for glows * add PostUpdate fn call to auras * mark global EventUtil * create example snippet for applying glow
- Loading branch information
Showing
5 changed files
with
136 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
-- Run Snippet late to ensure addon is properly loaded | ||
EventUtil.RegisterOnceFrameEventAndCallback("LOADING_SCREEN_DISABLED", function() | ||
local Util = CUF.Util | ||
|
||
local function PostUpdate(icon, auraData) | ||
if auraData.spellId == 393438 then | ||
Util.GlowStart_Normal(icon) | ||
else | ||
Util.GlowStop(icon) | ||
end | ||
end | ||
|
||
-- Override PostUpdate for all auras | ||
Util:IterateAllUnitButtons(function(button, unit) | ||
-- Nil check | ||
if not button:HasWidget("buffs") then return end | ||
|
||
-- NOTE: Only apply to player | ||
-- if unit ~= "player" then return end | ||
|
||
-- can also iterate "button.widgets.debuffs" | ||
for _, icon in ipairs(button.widgets.buffs) do | ||
icon.PostUpdate = PostUpdate | ||
end | ||
end) | ||
end) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters