forked from Slothpala/RaidFrameSettings
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPowerColor.lua
More file actions
executable file
·38 lines (31 loc) · 899 Bytes
/
PowerColor.lua
File metadata and controls
executable file
·38 lines (31 loc) · 899 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
local _, addonTable = ...
addonTable.PowerColor = {}
local PowerColor = addonTable.PowerColor
------------------------
--- Speed references ---
------------------------
-- WoW Api
local UnitIsConnected = UnitIsConnected
local function set_power_color(cuf_frame)
-- Function is controlled by RaidFrameColor.lua
end
local function update_power_color(cuf_frame)
if not cuf_frame.powerBar then
return
end
local is_connected = UnitIsConnected(cuf_frame.unit)
if not is_connected then
return
else
set_power_color(cuf_frame)
end
end
hooksecurefunc("CompactUnitFrame_UpdatePowerColor", update_power_color)
--- Set the default color of player healthbars
---@param new_set_power_color function
function PowerColor:SetPowerColorFunction(new_set_power_color)
set_power_color = new_set_power_color
end
function PowerColor:UpdateColor(cuf_frame)
update_power_color(cuf_frame)
end