public
Description: WoW Addon - Crowd control assistance
Homepage: http://www.tekkub.net
Clone URL: git://github.com/tekkub/controlfreak.git
Click here to lend your support to: controlfreak and make a donation at www.pledgie.com !
Add option to scale frame
tekkub (author)
Sun Jun 08 17:14:45 -0700 2008
commit  69842986ee7b7185a2de267b733b09f89b35e507
tree    065c0def28609ab3c83439c06334b466326ca934
parent  badb29e85e3e9e5858cfc2b04f4846aa892ac297
...
43
44
45
 
 
 
 
 
46
 
47
48
49
...
43
44
45
46
47
48
49
50
51
52
53
54
55
0
@@ -43,7 +43,13 @@ end)
0
 
0
 function frame:SetDB(newdb)
0
   db = newdb
0
+ self:Position()
0
+end
0
+
0
+
0
+function frame:Position()
0
   frame:ClearAllPoints()
0
+ frame:SetScale(db.scale)
0
   frame:SetPoint("CENTER", UIParent, db.x and "BOTTOMLEFT" or "CENTER", db.x or 0, db.y or -100)
0
 end
0
 
...
49
50
51
52
53
 
54
55
56
...
62
63
64
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
66
67
...
49
50
51
 
 
52
53
54
55
...
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
0
@@ -49,8 +49,7 @@ frame:SetScript("OnShow", function(frame)
0
 
0
 
0
   local alpha = math.floor(ControlFreak.db.char.alpha*100 + .5)
0
- local alphaslider, alphaslidertext = tekslider.new(frame, "Alpha: "..alpha.."%", "0%", "100%", "TOP", threshcontainer, "BOTTOM", 0, -GAP)
0
---~ alphaslider:SetPoint("LEFT", threshslider, "LEFT")
0
+ local alphaslider, alphaslidertext, alphacontainer = tekslider.new(frame, "Alpha: "..alpha.."%", "0%", "100%", "TOP", threshcontainer, "BOTTOM", 0, -GAP)
0
   alphaslider.tiptext = "Alpha level to fade frame to when focus is controlled, dead, or not set."
0
   alphaslider:SetValue(ControlFreak.db.char.alpha)
0
   alphaslider:SetValueStep(0.05)
0
@@ -62,6 +61,21 @@ frame:SetScript("OnShow", function(frame)
0
   end)
0
 
0
 
0
+ local scale = math.floor(ControlFreak.db.char.frameopts.scale*100 + .5)
0
+ local scaleslider, scaleslidertext = tekslider.new(frame, "Scale: "..scale.."%", "50%", "200%", "TOP", alphacontainer, "BOTTOM", 0, -GAP)
0
+ scaleslider.tiptext = "Frame scale."
0
+ scaleslider:SetValue(ControlFreak.db.char.frameopts.scale)
0
+ scaleslider:SetValueStep(0.05)
0
+ scaleslider:SetScript("OnValueChanged", function()
0
+ local block, db = ControlFreakFrame, ControlFreak.db.char.frameopts
0
+ local oldscale, oldx, oldy = block:GetScale(), block:GetCenter()
0
+ db.scale = scaleslider:GetValue()
0
+ db.x, db.y = oldx * oldscale / db.scale, oldy * oldscale / db.scale
0
+ block:Position()
0
+ scaleslidertext:SetText("Scale: "..math.floor(db.scale*100 + .5).."%")
0
+ end)
0
+
0
+
0
   frame:SetScript("OnShow", fade)
0
 end)
0
 
...
59
60
61
62
 
63
64
65
...
59
60
61
 
62
63
64
65
0
@@ -59,7 +59,7 @@ function ControlFreak:Initialize()
0
       breakthreshold = 5,
0
       alpha = 0.5,
0
       showtooltip = true,
0
- frameopts = {locked = false}
0
+ frameopts = {locked = false, scale = 1}
0
     },
0
     profile = {
0
       spellname = "",

Comments

    No one has commented yet.