public
Description: WoW Addon - Crowd control assistance
Homepage: http://www.tekkub.net
Clone URL: git://github.com/tekkub/controlfreak.git
Search Repo:
Click here to lend your support to: controlfreak and make a donation at www.pledgie.com !
Add "compact" mode
tekkub (author)
Sun Jun 08 17:48:56 -0700 2008
commit  51fa18fda35b36ab617d1e0355b90a4e6e3abc55
tree    c2c439b61912aede114832fcc156782d36421f07
parent  69842986ee7b7185a2de267b733b09f89b35e507
...
37
38
39
 
 
 
 
 
 
 
 
 
 
 
 
40
41
42
...
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
0
@@ -37,6 +37,18 @@ frame:SetScript("OnShow", function(frame)
0
   showtip:SetChecked(ControlFreak.db.char.showtooltip)
0
 
0
 
0
+ local compactmode = tekcheck.new(frame, nil, "Compact mode", "TOPLEFT", showtip, "BOTTOMLEFT", 0, -GAP)
0
+ compactmode.tiptext = "Use compact feedback frame"
0
+ compactmode:SetScript("OnClick", function(self)
0
+ checksound(self)
0
+ ControlFreak.db.char.compactmode = not ControlFreak.db.char.compactmode
0
+ ControlFreakFrame:SetText(ControlFreak.db.char.compactmode and "000s" or "Controlled (000s)")
0
+ ControlFreakFrame:Resize()
0
+ ControlFreak:OnUpdate(true)
0
+ end)
0
+ compactmode:SetChecked(ControlFreak.db.char.compactmode)
0
+
0
+
0
   local threshslider, threshslidertext, threshcontainer = tekslider.new(frame, "Break Threshold: "..ControlFreak.db.char.breakthreshold.." sec", 0, 50, "LEFT", frame, "TOP", GAP, 0)
0
   threshcontainer:SetPoint("TOP", lockpos, "TOP", 0, 0)
0
   threshslider.tiptext = "Time (in seconds) before spell breaks to unfade frame."
...
92
93
94
95
 
96
97
98
...
235
236
237
 
238
239
240
...
250
251
252
253
 
254
255
256
257
258
259
260
 
261
262
263
...
283
284
285
 
286
287
288
...
92
93
94
 
95
96
97
98
...
235
236
237
238
239
240
241
...
251
252
253
 
254
255
256
257
258
259
260
 
261
262
263
264
...
284
285
286
287
288
289
290
0
@@ -92,7 +92,7 @@ function ControlFreak:Enable()
0
   self:RegisterMessage("DONGLE_PROFILE_DELETED", "ProfileDeleted")
0
 
0
   lego = ControlFreakFrame
0
- lego:SetText("Controlled (000s)")
0
+ lego:SetText(self.db.char.compactmode and "000s" or "Controlled (000s)")
0
   lego:Resize()
0
   lego:SetDB(self.db.char.frameopts)
0
 
0
@@ -235,6 +235,7 @@ function ControlFreak:StopTimer()
0
 end
0
 
0
 
0
+local shortnotes = {["Control Freak"] = "CF", Invalid = "Inv", Controlled = "Ctr", Damage = "Dmg", Loose = "L", Ready = "Rdy", Dead = "D"}
0
 function ControlFreak:OnUpdate(elapsed)
0
   local self = ControlFreak
0
   self.elapsed = self.elapsed or 0
0
@@ -250,14 +251,14 @@ function ControlFreak:OnUpdate(elapsed)
0
   if hp and hp ~= lasthp then lasthp, lasthptime = hp, GetTime() end
0
 
0
   local alpha, color, note, range, unittag = self.db.char.alpha, "default", "Control Freak", "", ""
0
- local unit
0
+ local unit, timeLeft
0
   if focusisenemy and not focusdead then unit = "focus" end
0
   if unit then
0
     if not isvalid[unit] then color, note, tiptext = "grey", "Invalid"
0
     else
0
       for debuff in pairs(mydebuffs) do if IsSpellInRange(debuff, unit) == 0 then range = "*" end end
0
       if controlled[unit] then
0
- local _, _, _, _, _, _, timeLeft = UnitDebuff(unit, controlled[unit])
0
+ timeLeft = select(7, UnitDebuff(unit, controlled[unit]))
0
         color, note = "cyan", timeLeft and string.format("Controlled (%ds)", timeLeft) or "Controlled"
0
         if timeLeft and timeLeft <= self.db.char.breakthreshold then alpha = 1.0 end
0
       elseif lasthptime and lasthptime >= (GetTime()-damageinterval) then alpha, color, note = 1.0, "red", "Damage"
0
@@ -283,6 +284,7 @@ function ControlFreak:OnUpdate(elapsed)
0
 
0
   lego:SetAlpha(alpha)
0
   lego:SetBackdropBorderColor(unpack(colors[color]))
0
+ if self.db.char.compactmode then note = timeLeft and string.format("%ds", timeLeft) or shortnotes[note] end
0
   lego:SetText(string.concat(colors[color].t, range, note, range))
0
 
0
   if focusdead and not wasfocusdead then self:PLAYER_FOCUS_CHANGED() end

Comments

    No one has commented yet.