-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharcaneCharges.lua
54 lines (43 loc) · 1.36 KB
/
arcaneCharges.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
-- Show the number of Arcane Charges. Add an overlay when casting Arcane
-- Blast.
-- TSU: TRIGGER:1:2
function(allstates, event, triggerNum, triggerStates)
local state = allstates['']
if state == nil or event ~= 'TRIGGER' then
-- If this is an 'OPTIONS' event, 'allstates[""]' is a weird state, so
-- we just overwrite it with a new one.
state = {
['show'] = true,
['changed'] = true,
['progressType'] = 'static',
['total'] = 4,
['value'] = UnitPower('player', Enum.PowerType.ArcaneCharges),
['additionalProgress'] = {
[1] = {
['direction'] = 'forward',
['width'] = 0,
}
},
}
allstates[''] = state
if event ~= 'TRIGGER' then
-- This additionally catches 'STATUS' events, which will not have a
-- 'triggerStates' table.
return true
end
end
local triggerState = triggerStates['']
if triggerNum == 1 then
state['value'] = triggerState['value']
elseif triggerNum == 2 then
state['additionalProgress'][1]['width'] = triggerState and 1 or 0
end
state['changed'] = true
return true
end
-- Custom variables
{
['value'] = true,
['total'] = true,
['additionalProgress'] = 1,
}