vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 local elapsed = 0
2  
3 function oCB:MIRROR_TIMER_START(type, value, maxValue, scale, pause, text)
4 self:Debug("MIRROR_TIMER_START - %s | %s | %s | %s | %s | %s", type, value, maxValue, scale, pause, text)
5  
6 oCB.frames[type].value = (value / 1000)
7 oCB.frames[type].scale = scale
8  
9 if ( pause > 0 ) then CB.frames[type].pause = 1
10 else oCB.frames[type].pause = nil end
11  
12 oCB.frames[type].Spell:SetText(text)
13  
14 local c = self.db.profile.Mirror[type]
15 oCB.frames[type].Bar:SetMinMaxValues(0, (maxValue / 1000))
16 oCB.frames[type].Bar:SetValue(oCB.frames[type].value)
17 oCB.frames[type].Bar:SetStatusBarColor(c.r, c.g, c.b)
18  
19 if(not oCB.frames[type]:IsShown()) then
20 oCB.frames[type]:Show()
21 oCB.frames[type].Spark:Show()
22 oCB.frames[type].Time:Show()
23 end
24 end
25  
26 function oCB:MIRROR_TIMER_PAUSE(pause)
27 if ( pause > 0 ) then
28 this.pause = 1
29 else
30 this.pause = nil
31 end
32 end
33  
34 function oCB:MIRROR_TIMER_STOP(type)
35 self:Debug("MIRROR_TIMER_STOP - %s", type)
36  
37 oCB.frames[type]:Hide()
38 end
39  
40 function oCB:OnMirror()
41 if ( this.pause ) then
42 return
43 end
44 this.value = (this.value + this.scale * arg1)
45 this.Bar:SetValue(this.value)
46  
47 local w, _, max = this.Bar:GetWidth(), this.Bar:GetMinMaxValues()
48 sp = ( this.value / max ) * w
49  
50 if( sp < 0 ) then sp = 0 end
51 if(sp > w) then
52 this.Time:Hide()
53 this.Spark:Hide()
54 else
55 this.Time:SetText(string.format( "%.1f", math.max(this.value)))
56 this.Spark:SetPoint("CENTER", this.Bar, "LEFT", sp, 0)
57 end
58 end