-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalterTime.group.lua
64 lines (48 loc) · 1.64 KB
/
alterTime.group.lua
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
-------------------------------------------------------------------------------
-- init
aura_env.lgf = LibStub("LibGetFrame-1.0")
-------------------------------------------------------------------------------
-- show
local region = aura_env.region
local frame = aura_env.lgf.GetFrame(aura_env.state.unit)
region:ClearAllPoints()
region:SetPoint("CENTER", frame, "CENTER")
region:SetRegionWidth(frame:GetWidth())
region:SetRegionHeight(frame:GetHeight())
region:SetParent(frame)
region.bar.spark:SetHeight(frame:GetHeight() * 1.5)
-------------------------------------------------------------------------------
-- trigger (TSU): TRIGGER:1
function(allstates, event, _, triggerStates)
if event ~= 'TRIGGER' then
return false
end
local changed = false
-- Hide expired states.
for key, state in pairs(allstates) do
local triggerState = triggerStates[key]
if triggerState == nil or not triggerState['show'] then
state['show'] = false
state['changed'] = true
changed = true
end
end
-- Add new states.
for key, trigger1State in pairs(triggerStates) do
local state = allstates[key]
if state == nil or not state['show'] then
local unit = trigger1State['unit']
state = {
['show'] = true,
['changed'] = true,
['unit'] = unit,
['progressType'] = 'static',
['value'] = UnitHealth(unit),
['total'] = UnitHealthMax(unit)
}
allstates[key] = state
changed = true
end
end
return changed
end