vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 -- Minion support
2  
3 lazyr.minion = {}
4  
5 lazyr.minion.lastUpdate = 0
6 lazyr.minion.updateInterval = 0.1
7  
8  
9 function lazyr.minion.OnUpdate()
10 if (not lazyr.addOnIsActive) then
11 return
12 end
13 if (not lazyr.perPlayerConf.minionIsVisible) then
14 return
15 end
16  
17 local now = GetTime()
18 if (now >= (lazyr.minion.lastUpdate + lazyr.minion.updateInterval)) then
19 lazyr.minion.lastUpdate = now
20  
21 if (lazyr.perPlayerConf.minionHidesOutOfCombat) then
22 if (not lazyr.isInCombat and LazyRogueMinionFrame:IsShown()) then
23 lazyr.d("You're not in combat, and the thing's showing, so I'm hiding it")
24 LazyRogueMinionFrame:Hide()
25 end
26 if (lazyr.isInCombat and not LazyRogueMinionFrame:IsShown()) then
27 lazyr.d("You're IN combat, and the thing's hidden, so I'm showing it")
28 LazyRogueMinionFrame:Show()
29 end
30 end
31  
32 if (lazyr.isInCombat) then
33 local actions = lazyr.FindParsedForm(lazyr.perPlayerConf.defaultForm)
34 if (actions) then
35 lazyr.mock = true
36 local whichAction = lazyr.TryActions(actions)
37 lazyr.mock = false
38 if (not whichAction) then
39 whichAction = "...zzz..."
40 end
41 lazyr.minion.SetText(whichAction)
42 end
43 end
44 end
45 end
46  
47 function lazyr.minion.OnEnter(button)
48 GameTooltip:SetOwner(button, "ANCHOR_RIGHT")
49 GameTooltip:AddLine("LazyRogue v"..lazyr.version.." Minion.\n")
50 GameTooltip:AddLine("Shift + Left Click to move me around.\n")
51 GameTooltip:Show()
52 end
53  
54 function lazyr.minion.OnLeave(button)
55 GameTooltip:Hide()
56 end
57  
58 function lazyr.minion.SetText(text)
59 if (not text) then
60 text = ""
61 end
62 LazyRogueMinionText:SetText(text)
63 end
64  
65