/
--http://wowuidev.pastey.net/113773 |
local floor, select, UnitAura, UnitName, GetTime, next, pairs = floor, select, UnitAura, UnitName, GetTime, next, pairs |
BuffedSettings = {FrameCreation = {TargetBuff = 7, Buff = 7, Debuff = 7, Wep = 2, TargetDebuff = 7, Master = 1, Filter = 20,}, duration = false, } |
BuffedSettings = {FrameCreation = {TargetBuff = 8, Buff = 16, Debuff = 8, Wep = 2, TargetDebuff = 8, Master = 1, Filter = 20,}, duration = false, } |
local texturelist = {"Interface\\AddOns\\Buffed!\\Flat","Interface\\AddOns\\Buffed!\\BantoBar"} |
local FontColour = {r = 1, g = 1, b = 1, a = 1} |
count = count + 1 |
if not _G["Buffed"..FrameName..i] then |
local f = CreateFrame("Button", "Buffed"..FrameName..i, UIParent) |
f:SetWidth(30) |
f:SetHeight(30) |
f:SetWidth(20) |
f:SetHeight(20) |
f:SetMovable(true) |
f.corner = CreateFrame("Button", "Buffed"..FrameName.."Corner"..i, f) |
f.corner:SetPoint("BOTTOMRIGHT", f, "BOTTOMRIGHT") |
f.durationb:SetParent(f) |
f.durationb:SetWidth(30) |
f.durationb:SetHeight(10) |
f.durationb:SetPoint("TOP", f, "BOTTOM") |
f.durationb:SetPoint("LEFT", f, "RIGHT", 104, 0) |
f.durationb:EnableMouse(true) |
f.durationb:SetMovable(true) |
f.duration:ClearAllPoints() |
end) |
f.fs = f:CreateFontString( FrameName.."FS"..i, "OVERLAY", "GameFontNormal") |
f.bar = CreateFrame("Frame", nil, f) |
f.bar:SetWidth(70) |
f.bar:SetWidth(100) |
f.bar:SetHeight(20) |
f.bar:SetPoint("LEFT", f, "RIGHT", 3, 0) |
f.bar.tex = f.bar:CreateTexture(nil, "OVERLAY") |
f.fs:SetPoint("CENTER") |
local x = cos((360/25)*count)*4*count |
local y = sin((360/25)*count)*4*count |
f:SetPoint("CENTER", UIParent, "CENTER", x , y) |
if i ~= 1 then |
f:SetPoint("TOP", _G["Buffed"..FrameName..i-1], "BOTTOM", 0, -2) |
elseif FrameName == "Buff" then |
f:SetPoint("CENTER", UIParent, "TOPRIGHT", -330, -20) |
elseif FrameName == "Debuff" then |
f:SetPoint("CENTER", UIParent, "TOPRIGHT", -490, -20) |
else |
f:SetPoint("CENTER", UIParent, "CENTER", x , y) |
end |
f.t = f:CreateTexture() |
f.t:SetTexture("Interface\\AddOns\\Buffed!\\ConfTexture") |
f.t:SetAllPoints(f) |
end |
local function AlphaSlider() |
local Slider |
if not _G["SwishAlphaSlider"] then |
local Slider = _G["SwishAlphaSlider"] |
if not Slider 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) |
SwishAlphaSliderLow:SetText(0) |
SwishAlphaSliderHigh:SetText(1) |
Slider:SetScript("OnValueChanged", function(self) |
ActiveButton.ti:SetAlpha(self:GetValue()); |
ActiveButton.alpha = self:GetValue(); |
end |
end) |
Slider:SetScript("OnMouseUp", function(self) self:Hide(); BuffedUpdate("force") end) |
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() |
info.tooltipText = "Set the Alpha for this frame" |
info.func = function() AlphaSlider() end |
UIDropDownMenu_AddButton(info, level) |
UIDropDownMenu_AddButton(info, level) |
info.hasOpacity = nil |
info.hasArrow = false |
local x, y = BGetPoint(f) |
local width, height = floor(f:GetWidth() + 0.5), floor(f:GetHeight() + 0.5) |
if not BuffedProfiles[UnitName("player")].combat["Buffed"..FrameName..i] then |
BuffedProfiles[UnitName("player")].combat["Buffed"..FrameName..i] = {} |
BuffedProfiles[UnitName("player")].combat["Buffed"..FrameName..i] = {bar = {}, durationb = {}} |
end |
local t = BuffedProfiles[UnitName("player")].combat["Buffed"..FrameName..i] |
t.width = width t.height = height t.x = x t.y = y t.alpha = f.alpha x, y = BGetPoint(f.bar) |
for i = 1, 32 do |
local f = _G["Buffed"..FrameName..i] |
if f then |
print("this bit") |
if BuffedProfiles[name].nocombat["Buffed"..FrameName..i] then |
local pos = BuffedProfiles[name].nocombat["Buffed"..FrameName..i] |
SetConfigVars(pos, f) |
print(name, f:GetName()) |
if FrameName == "Filter" then |
f.enabled = pos.enabled |
f.Btype = pos.Btype |
f.name = pos.name |
f.fs:SetText(pos.name) |
end |
BuffedProfiles[UnitName("player")] = BuffedProfiles[name] |
end |
end |
end |
info.text = "SBB/Elk" |
info.func = function() ForAllFrames(function(f, FrameName, FrameNum, i) |
if i ~= 1 then |
f:ClearAllPoints() |
f:SetPoint("TOP", _G["Buffed"..FrameName..i-1], "BOTTOM", 0, -2) |
end |
f:SetHeight(20) |
f:SetWidth(20) |
f.bar:SetHeight(20) |
f.bar:SetWidth(100) |
f.bar:ClearAllPoints() |
f.bar:SetPoint("LEFT", f, "RIGHT", 2, 0) |
f.durationb:ClearAllPoints() |
f.durationb:SetPoint("LEFT", f, "RIGHT", 104, 0) |
f.bar:Show() |
end) |
end |
UIDropDownMenu_AddButton(info, level) |
info.text = "Buffalo/Bison" |
info.func = function() ForAllFrames(function(f, FrameName, FrameNum, i) |
if i ~= 1 then |
f:ClearAllPoints() |
f:SetPoint("LEFT", _G["Buffed"..FrameName..i-1], "RIGHT", 5, 0) |
end |
f:SetHeight(30) |
f:SetWidth(30) |
f.bar:SetHeight(20) |
f.bar:SetWidth(100) |
f.bar:ClearAllPoints() |
f.bar:SetPoint("LEFT", f, "RIGHT", 2, 0) |
f.durationb:ClearAllPoints() |
f.durationb:SetPoint("TOP", f, "BOTTOM", 0, -5) |
f.bar:Hide() |
end) |
end |
UIDropDownMenu_AddButton(info, level) |
end |
elseif level == 3 then |
frame.name = self.name |
frame.Btype = self.namePrefix |
frame.enabled = true |
print(frame.enabled) |
frame.fs:SetText(self.name) |
ToggleLock() ToggleLock() |
BuffedUpdate("force") |