vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | |
2 | -- Title: CastingBar Time v0.1 |
||
3 | -- Notes: Displays remaining casting / channeling time |
||
4 | -- Author: lua@lumpn.de |
||
5 | |||
6 | local function CastingBarTime_toString(end_time) |
||
7 | return string.format(" (%.1fs)", end_time - GetTime()); |
||
8 | end |
||
9 | |||
10 | function CastingBarTime_OnLoad() |
||
11 | this:RegisterEvent("SPELLCAST_START"); |
||
12 | this:RegisterEvent("SPELLCAST_CHANNEL_START"); |
||
13 | this.SpellName = ""; |
||
14 | end |
||
15 | |||
16 | |||
17 | function CastingBarTime_OnEvent() |
||
18 | if ( event == "SPELLCAST_START" ) then |
||
19 | this.SpellName = arg1; |
||
20 | elseif ( event == "SPELLCAST_CHANNEL_START" ) then |
||
21 | this.SpellName = arg2; |
||
22 | end |
||
23 | end |
||
24 | |||
25 | |||
26 | function CastingBarTime_OnUpdate() |
||
27 | |||
28 | if ( CastingBarFrame.casting ) then |
||
29 | CastingBarText:SetText(this.SpellName..CastingBarTime_toString(CastingBarFrame.maxValue)); |
||
30 | elseif ( CastingBarFrame.channeling ) then |
||
31 | CastingBarText:SetText(this.SpellName..CastingBarTime_toString(CastingBarFrame.endTime)); |
||
32 | end |
||
33 | |||
34 | end |