WoWInterface SVN Buffed

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 21 to Rev 22
    Reverse comparison

Rev 21 → Rev 22

Buffed!.lua
490,6 → 490,61
UIDropDownMenu_SetSelectedValue(this.owner, this.value);
end
 
local function AlphaSlider()
local Slider
if not _G["SwishAlphaSlider"] then
Slider = CreateFrame("Slider", "SwishAlphaSlider", UIParent, "OptionsSliderTemplate")
if ActiveButton.alpha then
Slider:SetValue(ActiveButton.alpha)
else
Slider:SetValue(0.5)
end
Slider:SetMinMaxValues(0,1)
Slider:SetValueStep(0.05)
_G["SwishAlphaSliderLow"]:SetText(0)
_G["SwishAlphaSliderHigh"]:SetText(1)
Slider:SetScript("OnValueChanged", function(self)
ActiveButton.ti:SetAlpha(self:GetValue());
ActiveButton.alpha = self:GetValue();
if (ActiveButton:GetName() == "BuffedMaster1") then
for FrameName, FrameNum in pairs(BuffedSettings.FrameCreation) do
for i = 1, FrameNum do
local f = _G["Buffed"..FrameName..i]
f.ti:SetAlpha(self:GetValue())
f.alpha = self:GetValue()
end
end
end
end)
Slider:SetScript("OnMouseUp", function(self) self:Hide(); BuffedUpdate("force") end)
Slider:SetWidth(ActiveButton:GetWidth() + 30)
else
Slider = _G["SwishAlphaSlider"]
if ActiveButton.alpha then
Slider:SetValue(ActiveButton.alpha)
else
Slider:SetValue(0.5)
end
Slider:SetScript("OnValueChanged", function(self)
ActiveButton.ti:SetAlpha(self:GetValue());
ActiveButton.alpha = self:GetValue();
if (ActiveButton:GetName() == "BuffedMaster1") then
for FrameName, FrameNum in pairs(BuffedSettings.FrameCreation) do
for i = 1, FrameNum do
local f = _G["Buffed"..FrameName..i]
f.ti:SetAlpha(self:GetValue())
f.alpha = self:GetValue()
end
end
end
end)
end
Slider:ClearAllPoints()
Slider:SetPoint("CENTER", ActiveButton, "TOP", 0, 10)
Slider:Show()
end
 
 
local function DropDownTest_Initialize(self, level) -- the menu items, needs a cleanup
level = level or 1
local info = UIDropDownMenu_CreateInfo()
549,16 → 604,10
info.text = "Alpha"
info.value = "Alpha"
info.checked = nil
info.hasArrow = true
info.tooltipTitle = "Alpha"
info.tooltipText = "Set the Alpha for this frame"
info.hasOpacity = 1
info.opacity = ActiveButton.ti:GetAlpha()
if (ActiveButton:GetName() == "BuffedMaster1") then
info.opacityFunc = function() ForAllFrames(function(f)local A = OpacitySliderFrame:GetValue() f.ti:SetAlpha(A) f.alpha = A end)end
else
info.opacityFunc = function() local A = OpacitySliderFrame:GetValue() ActiveButton.ti:SetAlpha(A) ActiveButton.alpha = A end
end
info.func = function() AlphaSlider() end
UIDropDownMenu_AddButton(info, level)
 
UIDropDownMenu_AddButton(info, level)