/trunk
## Interface: 30100 |
## Title: Buffed! |
## Notes: Buff frame mod? |
## Version 2.05 Alpha |
## Version 1.84 Beta |
## Author: Kraftman |
## SavedVariables: BuffedSettings, BuffedProfiles |
Buffed!.lua |
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.texture = {"Interface\\AddOns\\Buffed!\\Flat",} |
local FontColour = {r = 1, g = 1, b = 1, a = 1} |
local scale = UIParent:GetScale() |
local BuffedSorter = {} |
f.corner:SetPoint("TOPLEFT", f, "CENTER", 5, -5) |
f.corner:SetMovable(true) |
f.cornerT = f.corner:CreateTexture() |
f.cornerT:SetTexture("Interface\\AddOns\\Buffed!\\ResizerButton") |
f.cornerT:SetTexture("Interface\\AddOns\\Buffed!\\ResizerButton.tga") |
f.cornerT:SetAllPoints(f.corner) |
f.corner:Hide() |
f.StickyPos = 1 |
f:SetScript("OnMouseWheel", function(self, value) local x, y = BGetPoint(f) if IsShiftKeyDown() then BSetPoint(f, x + value, y) else BSetPoint(f, x, y + value) end end) |
f.corner:EnableMouse(true) |
f.pa = f:CreateTexture() |
f.pa:SetTexture("Interface\\AddOns\\Buffed!\\ConfTexture") |
f.pa:SetTexture("Interface\\AddOns\\Buffed!\\ConfTexture.tga") |
f.pa:SetPoint("TOPLEFT", f, "TOPLEFT", -f.padding, f.padding) |
f.pa:SetPoint("BOTTOMRIGHT", f, "BOTTOMRIGHT", f.padding, -f.padding) |
f.pa:SetVertexColor(1,1,1) |
f.pa:SetAlpha(0.3) |
f.pa:Hide() |
f.pb = f:CreateTexture() |
f.pb:SetTexture("Interface\\AddOns\\Buffed!\\ConfTexture") |
f.pb:SetTexture("Interface\\AddOns\\Buffed!\\ConfTexture.tga") |
f.pb:SetPoint("TOPLEFT", f, "TOPLEFT", -f.padding, f.padding) |
f.pb:SetPoint("BOTTOMRIGHT", f, "BOTTOMRIGHT", f.padding, -f.padding) |
f.pb:SetVertexColor(1,1,1) |
f.bar:SetPoint("LEFT", f, "RIGHT", 3, 0) |
f.bar.tex = f.bar:CreateTexture(nil, "OVERLAY") |
f.bar.tex:SetAllPoints(f.bar) |
f.bar.tex:SetTexture("Interface\\AddOns\\Buffed!\\Flat") |
f.bar.tex:SetTexture("Interface\\AddOns\\Buffed!\\Flat.tga") |
f.bar.tex:SetVertexColor(FrameColours[FrameName].r,FrameColours[FrameName].g,FrameColours[FrameName].b, 0.6) |
f.bar:EnableMouse(true) |
f.bar:SetMovable(true) |
local y = sin((360/25)*count)*4*count |
f:SetPoint("CENTER", UIParent, "CENTER", x , y) |
f.t = f:CreateTexture() |
f.t:SetTexture("Interface\\AddOns\\Buffed!\\ConfTexture") |
f.t:SetTexture("Interface\\AddOns\\Buffed!\\ConfTexture.tga") |
f.t:SetAllPoints(f) |
f.t:SetVertexColor(FrameColours[FrameName].r,FrameColours[FrameName].g,FrameColours[FrameName].b) |
f.ti = f:CreateTexture() |
f.ti:SetTexture("Interface\\AddOns\\Buffed!\\ConfTexture") |
f.ti:SetTexture("Interface\\AddOns\\Buffed!\\ConfTexture.tga") |
f.ti:SetAllPoints(f) |
f.ti:SetVertexColor(0,0,0) |
f.ti:SetTexCoord(1,0,0,1); |
local function BuffedOnLoad(self, event, ...) |
if event == "ADDON_LOADED" then |
if select(1, ...) == "Buffed!" then |
if not BuffedSettings then |
BuffedSettings = {} |
BuffedSettings.FrameCreation = {TargetBuff = 7, Buff = 7, Debuff = 7, Wep = 2, TargetDebuff = 7, Master = 1, Filter = 20,} |
BuffedSettings.duration = false |
BuffedSettings.animation = false |
end |
CreateConfigFrames() |
CreateSettingsMenu() |
end |
f.bar.horiz = pos.bar.horiz |
f.bar:SetWidth(pos.bar.width) |
f.bar:SetHeight(pos.bar.height) |
f.bar.tex:SetTexture(pos.bar.texture) |
f.bar.tex:SetVertexColor(0,0,0) |
f.bar.tex:SetVertexColor(pos.bar.r, pos.bar.g, pos.bar.b, pos.bar.a) |
BSetPoint(f.bar, pos.bar.x-pos.x, pos.bar.y-pos.y, f, "CENTER") |
x, y = BGetPoint(f.bar) |
local r, g, b, a = f.bar.tex:GetVertexColor() |
width, height = floor(f.bar:GetWidth() + 0.5), floor(f.bar:GetHeight() + 0.5) |
BuffedProfiles[UnitName("player")].combat["Buffed"..FrameName..i].bar = {shown = f.bar:IsShown(), horiz = f.bar.horiz, width = width, height = height, x = x, y = y, r = r, g = g, b = b, a = a, texture = f.bar.tex:GetTexture()} |
BuffedProfiles[UnitName("player")].combat["Buffed"..FrameName..i].bar = {shown = f.bar:IsShown(), horiz = f.bar.horiz, width = width, height = height, x = x, y = y, r = r, g = g, b = b, a = a} |
x, y = BGetPoint(f.durationb) |
width, height = floor(f.durationb:GetWidth() + 0.5), floor(f.durationb:GetHeight() + 0.5) |
BuffedProfiles[UnitName("player")].combat["Buffed"..FrameName..i].durationb = {shown = f.durationb:IsShown(), width = width, height = height, x = x, y = y} |
BuffedProfiles[UnitName("player")].combat["Buffed"..FrameName..i].bar = {shown = f.durationb:IsShown(), width = width, height = height, x = x, y = y} |
end) |
end |
UIDropDownMenu_AddButton(info, level) |
x, y = BGetPoint(f.bar) |
local r, g, b, a = f.bar.tex:GetVertexColor() |
width, height = floor(f.bar:GetWidth() + 0.5), floor(f.bar:GetHeight() + 0.5) |
BuffedProfiles[UnitName("player")].nocombat["Buffed"..FrameName..i].bar = {shown = f.bar:IsShown(), horiz = f.bar.horiz, width = width, height = height, x = x, y = y, r = r, g = g, b = b, a = a, texture = f.bar.tex:GetTexture()} |
BuffedProfiles[UnitName("player")].nocombat["Buffed"..FrameName..i].bar = {shown = f.bar:IsShown(), horiz = f.bar.horiz, width = width, height = height, x = x, y = y, r = r, g = g, b = b, a = a} |
x, y = BGetPoint(f.durationb) |
width, height = floor(f.durationb:GetWidth() + 0.5), floor(f.durationb:GetHeight() + 0.5) |
BuffedProfiles[UnitName("player")].nocombat["Buffed"..FrameName..i].durationb = {shown = f.durationb:IsShown(), width = width, height = height, x = x, y = y} |
info.func = function() ActiveButton.bar.horiz = false end |
end |
UIDropDownMenu_AddButton(info, level) |
elseif value == "Texture" then |
for num, val in ipairs(BuffedSettings.texture) do |
local valshort = val:match("([^\\]+)$") |
info.text = valshort |
info.value = val |
info.tooltipTitle = val |
info.checked = ActiveButton.bar.tex:GetTexture() == val |
if (ActiveButton:GetName() == "BuffedMaster1") then |
info.func = function() ForAllFrames(function(f) f.bar.tex:SetTexture(val) end) end |
else |
info.func = function() ActiveButton.bar.tex:SetTexture(val) end |
end |
UIDropDownMenu_AddButton(info, level) |
end |
end |
end |
end |
buff.dbar:SetHeight(20) |
buff.dbar:SetPoint("LEFT", buff, "RIGHT", 3, 0) |
buff.dbar:SetOrientation("HORIZONTAL") |
buff.dbar:SetStatusBarTexture("Interface\\AddOns\\Buffed!\\Flat") |
buff.dbar:SetStatusBarTexture("Interface\\AddOns\\Buffed!\\Flat.tga") |
buff.dbar:SetStatusBarColor(0.2, 1, 0.2) |
buff.dbar:Hide() |
buff.icon = buff:CreateTexture(buff:GetName().."Icon", "HIGH") |
else |
buff.dbar:SetOrientation("VERTICAL") |
end |
buff.dbar:SetStatusBarTexture(parent.bar.tex:GetTexture()) |
buff.dbar:SetStatusBarColor(parent.bar.tex:GetVertexColor()) |
buff.dbar:SetAllPoints(parent.bar) |
buff.dbar:Show() |
f.bar.tex:SetVertexColor(0,0,0) |
f.bar.tex:SetVertexColor(pos.bar.r, pos.bar.g, pos.bar.b, pos.bar.a) |
BSetPoint(f.bar, pos.bar.x-pos.x, pos.bar.y-pos.y, f, "CENTER") |
BSetPoint(f.durationb, pos.durationb.x-pos.x, pos.durationb.y-pos.y, f, "CENTER") |
BSetPoint(f.durationb, pos.durationb.x, pos.durationb.y) |
end |
end) |
BuffedUpdate("force") |
f.bar.tex:SetVertexColor(0,0,0) |
f.bar.tex:SetVertexColor(pos.bar.r, pos.bar.g, pos.bar.b, pos.bar.a) |
BSetPoint(f.bar, pos.bar.x-pos.x, pos.bar.y-pos.y, f, "CENTER") |
BSetPoint(f.durationb, pos.durationb.x-pos.x, pos.durationb.y-pos.y, f, "CENTER") |
BSetPoint(f.durationb, pos.durationb.x, pos.durationb.y) |
end |
end) |
BuffedUpdate("force") |