WoWInterface SVN Buffed

Compare Revisions

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

Rev 22 → Rev 23

trunk/Buffed!.lua
1,7 → 1,7
--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}
175,8 → 175,8
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")
205,7 → 205,7
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()
250,7 → 250,7
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")
295,7 → 295,16
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)
491,18 → 500,14
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();
517,34 → 522,21
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()
608,9 → 600,6
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
756,7 → 745,7
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)
834,17 → 823,16
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
857,17 → 845,40
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
1038,7 → 1049,6
frame.name = self.name
frame.Btype = self.namePrefix
frame.enabled = true
print(frame.enabled)
frame.fs:SetText(self.name)
ToggleLock() ToggleLock()
BuffedUpdate("force")