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() |