/trunk
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, } |
local texturelist = {"Interface\\AddOns\\Buffed!\\Flat",} |
local texturelist = {"Interface\\AddOns\\Buffed!\\Flat","Interface\\AddOns\\Buffed!\\BantoBar"} |
local FontColour = {r = 1, g = 1, b = 1, a = 1} |
local scale = UIParent:GetScale() |
UIDropDownMenu_SetSelectedValue(this.owner, this.value); |
end |
local function MasterOptions(var, val1, val2) |
if ActiveButton[var] then |
for FrameName, FrameNum in pairs(BuffedSettings.FrameCreation) do |
for i = 1, FrameNum do |
local f = _G["Buffed"..FrameName..i]; |
f[var] = val1 |
end |
end |
else |
for FrameName, FrameNum in pairs(BuffedSettings.FrameCreation) do |
for i = 1, FrameNum do |
local f = _G["Buffed"..FrameName..i]; |
f[var] = val2 |
end |
end |
end |
end |
local function DropDownTest_Initialize(self, level) -- the menu items, needs a cleanup |
level = level or 1 |
local info = UIDropDownMenu_CreateInfo() |
info.tooltipTitle = "Sticky Positioning" |
info.tooltipText = "Aligns the buffs with other nearby buffs" |
if (ActiveButton:GetName() == "BuffedMaster1") then |
info.func = function() MasterOptions("StickyPos", nil, 1) end |
info.func = function() if ActiveButton.StickyPos then |
ForAllFrames(function(f)f.StickyPos = nil end) |
else |
ForAllFrames(function(f)f.StickyPos = nil end) |
end end |
else |
info.func = function() if ActiveButton.StickyPos then ActiveButton.StickyPos = nil else ActiveButton.StickyPos = 1 end end |
end |
info.tooltipTitle = "Sticky Sizing" |
info.tooltipText = "Sets the size of the buff to other nearby buffs" |
if (ActiveButton:GetName() == "BuffedMaster1") then |
info.func = function() MasterOptions("StickySize", nil, 1) end |
info.func = function() if ActiveButton.StickySize then |
ForAllFrames(function(f)f.StickySize = nil end) |
else |
ForAllFrames(function(f)f.StickySize = 1 end) |
end end |
else |
info.func = function() if ActiveButton.StickySize then ActiveButton.StickySize = nil else ActiveButton.StickySize = 1 end end |
end |
UIDropDownMenu_AddButton(info, level) |
info.text = "Sticky Padding" |
if (ActiveButton.padding == 10) then |
ForAllFrames(function(f)f.padding = 0 end) |
else |
for FrameName, FrameNum in pairs(BuffedSettings.FrameCreation) do |
for i = 1, FrameNum do |
local f = _G["Buffed"..FrameName..i] |
if f then |
f.padding = 10 |
end |
end |
end |
ForAllFrames(function(f)f.padding = 10 end) |
end |
end |
else |
buff:Hide(); |
buff.duration:Hide(); |
end |
return nil; |
return nil |
else |
local helpful = (filter == "HELPFUL"); |
if not buff then -- If button doesn't exist make it |
GameTooltip:SetUnitAura(unit, index, filter); |
end |
end |
return 1; |
return true; |
end |
local function BuffedSort(num, unit, filter) |
expirationTime = GetTime() + 100000 + i |
end |
BuffedSorter[i] = {expTime = expirationTime, number = i } |
end |
if next(BuffedSorter) then |
table.sort(BuffedSorter, function (a,b) return a.expTime < b.expTime end) |