0
@@ -5,8 +5,7 @@ if not ControlFreak then return end
0
local DongleFrames = DongleStub("DongleFrames-1.0")
0
-local ww = WidgetWarlock
0
+local ww = LibStub("WidgetWarlock-Alpha1")
0
local ControlFreak = ControlFreak
0
@@ -25,52 +24,24 @@ function ControlFreak:CreatePanel()
0
frame:SetScript("OnHide", function() self:UnregisterEvent("PLAYER_REGEN_DISABLED") end)
0
- local lockpos, lockposlabel = ww.SummonLabeledCheckBox("Lock frame", 22, frame, "TOPLEFT", 15, -10)
0
- ww.EnslaveTooltip(lockpos, "Locks the frame to prevent accidental movement")
0
+ local lockpos = ww:SummonCheckBox(frame, nil, "TOPLEFT", 15, -10)
0
+ ww:EnslaveLabel(lockpos, "Lock frame")
0
+ lockpos:SetHitRectInsets(0, -100, 0, 0)
0
+ ww:EnslaveTooltip(lockpos, "Locks the frame to prevent accidental movement")
0
lockpos:SetScript("OnClick", function() self.db.profile.frameopts.locked = not self.db.profile.frameopts.locked end)
0
lockpos:SetChecked(self.db.profile.frameopts.locked)
0
- local showtip = ww.SummonLabeledCheckBox("Show tooltip", 22, frame, "TOPLEFT", lockpos, "TOPLEFT", 133, 0)
0
- ww.EnslaveTooltip(showtip, "Show help tooltip on hover")
0
+ local showtip = ww:SummonCheckBox(frame, nil, "TOPLEFT", lockpos, "TOPLEFT", 133, 0)
0
+ showtip:SetHitRectInsets(0, -100, 0, 0)
0
+ ww:EnslaveLabel(showtip, "Show tooltip")
0
+ ww:EnslaveTooltip(showtip, "Show help tooltip on hover")
0
showtip:SetScript("OnClick", function() self.db.profile.showtooltip = not self.db.profile.showtooltip end)
0
showtip:SetChecked(self.db.profile.showtooltip)
0
- local editbox = CreateFrame("EditBox", nil, frame)
0
- editbox:SetWidth(620) editbox:SetHeight(200)
0
- editbox:SetPoint("BOTTOMLEFT", 5, 5)
0
- editbox:SetFontObject(GameFontHighlight)
0
- editbox:SetTextInsets(8,8,8,8)
0
- editbox:SetBackdrop(ww.TooltipBorderBG)
0
- editbox:SetBackdropColor(.1,.1,.1,.3)
0
- editbox:SetMultiLine(true)
0
- editbox:SetAutoFocus(false)
0
- editbox:SetText(self.db.profile.macrotext or "/script ChatFrame1:AddMessage(\"Error loading macro!\")")
0
- editbox:SetScript("OnTextChanged", function()
0
- self.db.profile.macrotext = editbox:GetText()
0
- self.macroupdated = true
0
- if not InCombatLockdown() then self:PLAYER_REGEN_ENABLED() end
0
- editbox:SetScript("OnEscapePressed", function(self) self:ClearFocus() end)
0
- local macrolabel = ww.EnslaveLabel(editbox, "Macro", "BOTTOMLEFT", editbox, "TOPLEFT", 5, 0)
0
- self.combatwarn = ww.EnslaveLabel(editbox, "|cffff0000Macro changes will not apply until combat ends!", "BOTTOMRIGHT", editbox, "TOPRIGHT", -5, 0)
0
- local debuff = CreateFrame("EditBox", nil, frame)
0
- debuff:SetPoint("BOTTOMRIGHT", editbox, "TOPRIGHT", 0, 15) debuff:SetWidth(200) debuff:SetHeight(22)
0
- debuff:SetFontObject(GameFontHighlight)
0
- debuff:SetTextInsets(8,8,8,8)
0
- debuff:SetBackdrop(ww.TooltipBorderBG)
0
- debuff:SetBackdropColor(.1,.1,.1,.3)
0
- debuff:SetAutoFocus(false)
0
- debuff:SetText(self.db.profile.spellname)
0
- debuff:SetScript("OnTextChanged", function() self.db.profile.spellname = debuff:GetText() end)
0
- debuff:SetScript("OnEscapePressed", function(self) self:ClearFocus() end)
0
- ww.EnslaveLabel(debuff, "Debuff", "RIGHT", debuff, "LEFT", -5, 0)
0
- local threshslider, threshslidertext = ww.SummonSlider(frame, "Break Threshold: "..self.db.profile.breakthreshold.." sec", 0, 10, "TOPLEFT", lockpos, "BOTTOMLEFT", -5, -15)
0
- ww.EnslaveTooltip(threshslider, "Time (in seconds) before spell breaks to unfade frame.")
0
+ local threshslider, threshslidertext = ww:SummonSlider(frame, "Break Threshold: "..self.db.profile.breakthreshold.." sec", 0, 10, "TOPLEFT", lockpos, "BOTTOMLEFT", -5, -15)
0
+ ww:EnslaveTooltip(threshslider, "Time (in seconds) before spell breaks to unfade frame.")
0
threshslider:SetValue(self.db.profile.breakthreshold)
0
threshslider:SetValueStep(1)
0
threshslider:SetScript("OnValueChanged", function()
0
@@ -80,8 +51,8 @@ function ControlFreak:CreatePanel()
0
local alpha = math.floor(self.db.profile.alpha*100 + .5)
0
- local alphaslider, alphaslidertext = ww.SummonSlider(frame, "Alpha: "..alpha.."%", "0%", "100%", "LEFT", threshslider, "RIGHT", 10, 0)
0
- ww.EnslaveTooltip(alphaslider, "Alpha level to fade frame to when focus is controlled, dead, or not set.")
0
+ local alphaslider, alphaslidertext = ww:SummonSlider(frame, "Alpha: "..alpha.."%", "0%", "100%", "LEFT", threshslider, "RIGHT", 10, 0)
0
+ ww:EnslaveTooltip(alphaslider, "Alpha level to fade frame to when focus is controlled, dead, or not set.")
0
alphaslider:SetValue(self.db.profile.alpha)
0
alphaslider:SetValueStep(0.05)
0
alphaslider:SetScript("OnValueChanged", function()
0
@@ -92,6 +63,34 @@ function ControlFreak:CreatePanel()
0
+ local debuff = ww:SummonEditBox(frame, 200, "BOTTOMLEFT", threshslider, "TOPLEFT", 5, -55)
0
+ debuff:SetText(self.db.profile.spellname)
0
+ debuff:SetScript("OnTextChanged", function() self.db.profile.spellname = debuff:GetText() end)
0
+ debuff:SetScript("OnEscapePressed", function(self) self:ClearFocus() end)
0
+ ww:EnslaveLabel(debuff, "Debuff")
0
+ local editbox = CreateFrame("EditBox", nil, frame)
0
+ editbox:SetPoint("BOTTOMLEFT", 5, 5)
0
+ editbox:SetPoint("TOP", frame, "BOTTOM", 0, 170)
0
+ editbox:SetFontObject(GameFontHighlight)
0
+ editbox:SetTextInsets(8,8,8,8)
0
+ editbox:SetBackdrop(ww.TooltipBorderBG)
0
+ editbox:SetBackdropColor(.1,.1,.1,.3)
0
+ editbox:SetMultiLine(true)
0
+ editbox:SetAutoFocus(false)
0
+ editbox:SetText(self.db.profile.macrotext or "/script ChatFrame1:AddMessage(\"Error loading macro!\")")
0
+ editbox:SetScript("OnTextChanged", function()
0
+ self.db.profile.macrotext = editbox:GetText()
0
+ self.macroupdated = true
0
+ if not InCombatLockdown() then self:PLAYER_REGEN_ENABLED() end
0
+ editbox:SetScript("OnEscapePressed", function(self) self:ClearFocus() end)
0
+ local macrolabel = ww:EnslaveLabel(editbox, "Macro", "BOTTOMLEFT", editbox, "TOPLEFT", 5, 0)
0
+ self.combatwarn = ww:EnslaveLabel(editbox, "|cffff0000Macro changes will not apply until combat ends!", "BOTTOMRIGHT", editbox, "TOPRIGHT", -5, 0)
0
local resetmacro = CreateFrame("Button", name.."ResetMacro", frame, "UIPanelButtonGrayTemplate")
0
resetmacro:SetPoint("TOPRIGHT", -5, -5) resetmacro:SetWidth(120) resetmacro:SetHeight(22)
0
resetmacro:SetText("Reset Defaults")
Comments
No one has commented yet.