/trunk
--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, } |
local FontColour = {r = 1, g = 1, b = 1, a = 1} |
local scale = UIParent:GetScale() |
local BuffedSorter = {} |
local ConfigShown |
local ActiveButton |
local BuffedSorter = {} |
local ConfigShown |
local ActiveButton |
BuffedProfiles = {} |
local function BGetPoint(frame) |
frame:SetPoint("CENTER", relativeTo, relativePoint, x, y) |
end |
local FrameColours = {TargetBuff = {r = 0, g = 0.4, b = 0}, |
Buff = {r = 0, g = 1, b = 0}, |
local FrameColours = {TargetBuff = {r = 0, g = 0.4, b = 0}, |
Buff = {r = 0, g = 1, b = 0}, |
Debuff = {r = 1, g = 0, b = 0}, |
Wep = {r = 1, g = 0, b = 1}, |
TargetDebuff = {r = 0.4, g = 0, b = 0}, |
Master = {r = 1, g = 1, b = 1}, |
Wep = {r = 1, g = 0, b = 1}, |
TargetDebuff = {r = 0.4, g = 0, b = 0}, |
Master = {r = 1, g = 1, b = 1}, |
Filter = {r = 0, g = 0, b = 1}, } |
local LoadOrder = { "Buff", "Debuff","TargetBuff", "TargetDebuff", "Wep", "Master", "Filter", } |
local LoadOrder = { "Buff", "Debuff","TargetBuff", "TargetDebuff", "Wep", "Master", "Filter", } |
local function BuffedOnDragStart(self, index, button) -- start dragging config frames |
local BuffButton = _G[self..index] |
if (button == "LeftButton") then |
if (button == "LeftButton") then |
BuffButton:StartMoving() |
if (BuffButton.padding == 10) then |
if (BuffButton.padding == 10) then |
BuffButton.pa:Show() |
BuffButton.pb:Show() |
end |
elseif (button == "RightButton") then |
elseif (button == "RightButton") then |
ActiveButton = BuffButton |
ToggleDropDownMenu(1, nil, _G["BuffedBuffConfig"], BuffButton, 30, 20) |
end |
local function ForAllFrames(func1, func2) |
for FrameName, FrameNum in pairs(BuffedSettings.FrameCreation) do |
for i = 1, FrameNum do |
for i = 1, FrameNum do |
local f = _G["Buffed"..FrameName..i] |
if f then |
if f then |
func1(f, FrameName, FrameNum, i) |
end |
end |
end |
local function ToggleLock(msg) -- show/hide config frames and hide the extra frames if the number has changed |
if not ConfigShown then |
if not ConfigShown then |
ForAllFrames(function(f) if f.enabled then f:Show() end end) |
ConfigShown = 1 |
else |
local f = _G["Buffed"..FrameName..i] |
local x, y = BGetPoint(f) |
local width, height = floor(f:GetWidth() + 0.5), floor(f:GetHeight() + 0.5) |
if not BuffedProfiles[UnitName("player")].nocombat["Buffed"..FrameName..i] then |
if not BuffedProfiles[UnitName("player")].nocombat["Buffed"..FrameName..i] then |
BuffedProfiles[UnitName("player")].nocombat["Buffed"..FrameName..i] = {bar = {}, durationb = {}} |
end |
local t = BuffedProfiles[UnitName("player")].nocombat["Buffed"..FrameName..i] |
t.width = width t.height = height t.x = x t.y = y t.alpha = f.alpha 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) |
t.bar.shown = f.bar:IsShown() |
t.bar.shown = f.bar:IsShown() |
t.bar.horiz = f.bar.horiz |
t.bar.width = width |
t.bar.width = width |
t.bar.height = height |
t.bar.x = x t.bar.y = y t.bar.r = r t.bar.g = g t.bar.b = b t.bar.a = a |
t.bar.texture = f.bar.tex:GetTexture() |
ForAllFrames(function(f, FrameName, FrameNum, i) f:Hide() |
if (i > FrameNum) then |
f = _G["Buffed"..FrameName.."Button"..i] |
if f then |
if f then |
f:Hide() |
end |
end |
BuffButton:StopMovingOrSizing() |
local left, right, top, bottom = BuffButton:GetLeft(), BuffButton:GetRight(), BuffButton:GetTop(), BuffButton:GetBottom() |
local width, height = BuffButton:GetWidth(), BuffButton:GetHeight() |
for FrameName, FrameNum in pairs(BuffedSettings.FrameCreation) do |
for FrameName, FrameNum in pairs(BuffedSettings.FrameCreation) do |
for i = 1, FrameNum do |
local frame = _G["Buffed"..FrameName..i] |
if not (frame:GetName() == BuffButton:GetName()) then |
local BBCenterX = (right+left)/2 |
local BBCenterY = (top+bottom)/2 |
local FCenterX = (BRight+BLeft)/2 |
local FCenterY = (BTop+BBottom)/2 |
local FCenterY = (BTop+BBottom)/2 |
if (BBCenterX < (FCenterX + 100)) and (BBCenterX > (FCenterX - 100)) and (BBCenterY < (FCenterY + 100)) and (BBCenterY > (FCenterY - 100)) then |
if BuffButton.StickySize then |
BuffButton:SetWidth(BWidth) |
end |
end |
end |
if (BuffButton.padding ~= 0) then |
if (BuffButton.padding ~= 0) then |
if ((left > (BLeft - BuffButton.padding) and left < (BRight + BuffButton.padding)) or (right > (BLeft - BuffButton.padding) and right < (BRight + BuffButton.padding) )) and ((top > (BBottom - BuffButton.padding) and top < (BTop + BuffButton.padding)) or (bottom > (BBottom - BuffButton.padding) and bottom < (BTop + BuffButton.padding)) ) then |
local Xdir = (BBCenterX - FCenterX)/abs(BBCenterX - FCenterX) |
local Ydir = (BBCenterY - FCenterY)/abs(BBCenterY - FCenterY) |
local FrameName = LoadOrder[j] |
local FrameNum = BuffedSettings.FrameCreation[LoadOrder[j]] |
--print(LoadOrder[j]) |
for i = 1, FrameNum do |
for i = 1, FrameNum do |
count = count + 1 |
if not _G["Buffed"..FrameName..i] then |
local f = CreateFrame("Button", "Buffed"..FrameName..i, UIParent) |
local fr = _G["Buffed"..FrameName..i] |
fr:SetWidth(f:GetWidth()) |
fr:SetHeight(f:GetHeight()) |
end |
end |
end |
end |
end |
end |
end) |
f.fs = f:CreateFontString( FrameName.."FS"..i, "OVERLAY", "GameFontNormal") |
f.bar = CreateFrame("Frame", nil, f) |
f.fs:SetText(i) |
if (FrameName == "Master" )then -- make the master frame larger, change its label |
f.fs:SetWidth(20) |
f.fs:SetText("M") |
f.durationb:SetScript("OnMouseUp", function(self) |
self:StopMovingOrSizing() |
local x, y = BGetPoint(self) |
local Bx, By = BGetPoint(f) |
for FrameName, FrameNum in pairs(BuffedSettings.FrameCreation) do |
f.fs:SetText("M") |
f.durationb:SetScript("OnMouseUp", function(self) |
self:StopMovingOrSizing() |
local x, y = BGetPoint(self) |
local Bx, By = BGetPoint(f) |
for FrameName, FrameNum in pairs(BuffedSettings.FrameCreation) do |
for i = 1, FrameNum do |
local frame = _G["Buffed"..FrameName..i] |
BSetPoint(frame.durationb, x-Bx, y-By, frame, "CENTER") |
BSetPoint(frame.durationb, x-Bx, y-By, frame, "CENTER") |
end |
end |
end) |
f.bar:SetScript("OnMouseUp", function(self, button) |
self:StopMovingOrSizing() |
local x, y = BGetPoint(self) |
local Bx, By = BGetPoint(f) |
for FrameName, FrameNum in pairs(BuffedSettings.FrameCreation) do |
f.bar:SetScript("OnMouseUp", function(self, button) |
self:StopMovingOrSizing() |
local x, y = BGetPoint(self) |
local Bx, By = BGetPoint(f) |
for FrameName, FrameNum in pairs(BuffedSettings.FrameCreation) do |
for i = 1, FrameNum do |
local frame = _G["Buffed"..FrameName..i] |
BSetPoint(frame.bar, x-Bx, y-By, frame, "CENTER") |
BSetPoint(frame.bar, x-Bx, y-By, frame, "CENTER") |
frame.bar:SetHeight(self:GetHeight()) |
frame.bar:SetWidth(self:GetWidth()) |
end |
end |
end |
end |
local function CreateSettingsMenu() |
local ConFrame = CreateFrame("Frame") |
local ConfigLayout = { |
local ConfigLayout = { |
BuffSlider = { Ftype = "Slider", Inherits = "OptionsSliderTemplate", |
FName = "BuffedBuffSlider", Location = "CENTER", Xoff = 0,Yoff = 150, Parent = ConFrame, |
Min = 0, Max = 32, Step = 1, StartVal = BuffedSettings.FrameCreation.Buff,LowText = 0, HighText = 32, |
Script2 = {event = "OnMouseUp", func = function() CreateConfigFrames(); ToggleLock("config"); ToggleLock("config"); end,} |
}, |
BuffString = { Ftype = "FontString", Location = "CENTER", Xoff = 110, Yoff = 150, Parent = ConFrame["BuffSlider"], |
R = 1, G = 1, B = 1, Width = 60, Height = 15, |
R = 1, G = 1, B = 1, Width = 60, Height = 15, |
}, |
DebuffString = { Ftype = "FontString", Location = "CENTER", Xoff = 110, Yoff = 100, Parent = ConFrame, |
R = 1, G = 1, B = 1, Width = 60, Height = 15, |
R = 1, G = 1, B = 1, Width = 60, Height = 15, |
}, |
TargBuffString = { Ftype = "FontString", Location = "CENTER", Xoff = 110, Yoff = 50, Parent = ConFrame, |
R = 1, G = 1, B = 1, Width = 60, Height = 15, |
R = 1, G = 1, B = 1, Width = 60, Height = 15, |
}, |
TargDebuffString = { Ftype = "FontString", Location = "CENTER", Xoff = 110, Yoff = 0, Parent = ConFrame, |
R = 1, G = 1, B = 1, Width = 60, Height = 15, |
R = 1, G = 1, B = 1, Width = 60, Height = 15, |
}, |
TitleString = { Ftype = "FontString", Location = "CENTER", Xoff = 0, Yoff = 200, Parent = ConFrame, |
R = 1, G = 1, B = 1, Width = 150, Height = 15, StringVal = "Buffed! Options", |
}, |
WepEnchLabel = { Ftype = "FontString", Location = "CENTER", Xoff = -120, Yoff = -50, Parent = ConFrame, |
R = 1, G = 1, B = 1, Width = 200, Height = 15, StringVal = "Show Weapon Enchants:", |
}, |
}, |
WepEnchToggle = { Ftype = "CheckButton", Inherits = "InterfaceOptionsCheckButtonTemplate", |
FName = "BuffedTargetDebuffSlider", Location = "CENTER", Xoff = 0, Yoff = -50, Parent = ConFrame, |
Script1 = {event = "OnMouseUp", func = function(self) if TemporaryEnchantFrame:IsShown() then BuffedSettings.FrameCreation.Wep = 0; TemporaryEnchantFrame:Hide() else BuffedSettings.FrameCreation.Wep = 2; TemporaryEnchantFrame:Show() BuffedUpdate("force") end; |
ToggleLock("config"); ToggleLock("config"); |
Script1 = {event = "OnMouseUp", func = function(self) if TemporaryEnchantFrame:IsShown() then BuffedSettings.FrameCreation.Wep = 0; TemporaryEnchantFrame:Hide() else BuffedSettings.FrameCreation.Wep = 2; TemporaryEnchantFrame:Show() BuffedUpdate("force") end; |
ToggleLock("config"); ToggleLock("config"); |
end, variable = TemporaryEnchantFrame:IsShown()}, |
}, |
} |
local Text = {} |
for Name, values in pairs(ConfigLayout) do |
for Name, values in pairs(ConfigLayout) do |
if ( values.Ftype == "Frame" ) or ( values.Ftype == "Slider" ) or ( values.Ftype == "CheckButton" ) then |
ConFrame[Name] = CreateFrame(values.Ftype, values.FName, values.Parent, values.Inherits) |
if ( values.Ftype == "Slider" ) then |
if values["Script2"] then |
ConFrame[Name]:SetScript(values["Script2"].event, values["Script2"].func) |
end |
end |
if ( values.Ftype == "FontString" ) then |
ConFrame[Name] = ConFrame:CreateFontString(Name, "OVERLAY", "GameFontNormal") |
end |
local function SetConfigVars(pos, f) |
if not pos then return end |
if not pos then return end |
BSetPoint(f, pos.x, pos.y) |
f:SetWidth(pos.width) |
f:SetHeight(pos.height) |
end |
elseif event == "PLAYER_ENTERING_WORLD" then |
for FrameName, FrameNum in pairs(BuffedSettings.FrameCreation) do |
for i = 1, 32 do |
for i = 1, 32 do |
local f = _G["Buffed"..FrameName..i] |
if f then |
if not BuffedProfiles[UnitName("player")] then |
info.func = function() if ActiveButton.StickyPos then ActiveButton.StickyPos = nil else ActiveButton.StickyPos = 1 end end |
end |
UIDropDownMenu_AddButton(info, level) |
info.text = "Sticky Sizing" |
info.value = 2 |
info.checked = ActiveButton.StickySize |
info.tooltipText = "Sets the size of the buff to other nearby buffs" |
if (ActiveButton:GetName() == "BuffedMaster1") then |
info.func = function() if ActiveButton.StickySize then |
ForAllFrames(function(f)f.StickySize = nil end) |
ForAllFrames(function(f)f.StickySize = nil end) |
else |
ForAllFrames(function(f)f.StickySize = 1 end) |
end end |
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" |
info.value = 3 |
info.checked = function() if (ActiveButton.padding == 10) then return true else return false end end |
info.tooltipTitle = "Sticky Padding" |
info.tooltipText = "Attempts to even out the padding between nearby buffs" |
if (ActiveButton:GetName() == "BuffedMaster1") then |
info.func = function() |
if (ActiveButton.padding == 10) then |
info.func = function() |
if (ActiveButton.padding == 10) then |
ForAllFrames(function(f)f.padding = 0 end) |
else |
ForAllFrames(function(f)f.padding = 10 end) |
info.func = function() if (ActiveButton.padding == 10) then ActiveButton.padding = 0 else ActiveButton.padding = 10 end end |
end |
UIDropDownMenu_AddButton(info, level) |
info.text = "Alpha" |
info.value = "Alpha" |
info.checked = nil |
else |
info.opacityFunc = function() local A = OpacitySliderFrame:GetValue() ActiveButton.ti:SetAlpha(A) ActiveButton.alpha = A end |
end |
UIDropDownMenu_AddButton(info, level) |
local duration = _G[ActiveButton:GetName().."Duration"] |
info.hasOpacity = nil |
info.hasArrow = false |
info.text = "Show Dummy Timers" |
info.value = 3 |
info.checked = duration:IsShown() |
info.checked = ActiveButton.duration:IsShown() |
info.tooltipTitle = "Show Dummy Timer" |
info.tooltipText = "Show a fake timer to help with positioning." |
if (ActiveButton:GetName() == "BuffedMaster1") then |
info.func = function() |
if duration:IsShown() then |
ForAllFrames(function(f) f:Hide() end) |
info.func = function() |
if ActiveButton.duration:IsShown() then |
ForAllFrames(function(f) f.duration:Hide() end) |
else |
ForAllFrames(function(f) f:Show() end) |
ForAllFrames(function(f) f.duration:Show() end) |
end |
end |
else |
info.func = function() if duration:IsShown() then duration:Hide() else duration:Show() end end |
info.func = function() if ActiveButton.duration:IsShown() then ActiveButton.duration:Hide() else ActiveButton.duration:Show() end end |
end |
UIDropDownMenu_AddButton(info, level) |
info.text = "Resizable" |
info.value = 4 |
info.checked = ActiveButton.corner:IsShown() |
info.tooltipTitle = "Resizable" |
info.tooltipText = "Shows a draggable icon to allow buff resizing" |
if (ActiveButton:GetName() == "BuffedMaster1") then |
info.func = function() |
if ActiveButton.corner:IsShown() then |
info.func = function() |
if ActiveButton.corner:IsShown() then |
ForAllFrames(function(f) f.corner:Hide() end) |
else |
ForAllFrames(function(f) f.corner:Show() end) |
info.func = function() if ActiveButton.corner:IsShown() then ActiveButton.corner:Hide() else ActiveButton.corner:Show() end end |
end |
UIDropDownMenu_AddButton(info, level) |
info.text = "Reset Size" |
info.value = 5 |
info.checked = nil |
info.func = function() ActiveButton:SetWidth(30) ActiveButton:SetHeight(30) end |
end |
UIDropDownMenu_AddButton(info, level) |
info.text = "Buff Bars" |
info.value = "Bars" |
info.checked = ActiveButton.bar:IsShown() |
info.tooltipText = "Show timer bars alongside the buff icon." |
info.func = function() if ActiveButton.bar:IsShown() then ActiveButton.bar:Hide() else ActiveButton.bar:Show() end end |
if (ActiveButton:GetName() == "BuffedMaster1") then |
info.func = function() |
if ActiveButton.bar:IsShown() then |
info.func = function() |
if ActiveButton.bar:IsShown() then |
ForAllFrames(function(f) f.bar:Hide() end) |
else |
ForAllFrames(function(f) f.bar:Show() end) |
end |
info.hasArrow = true |
UIDropDownMenu_AddButton(info, level) |
for i = 1, 16 do |
if (ActiveButton:GetName() == "BuffedFilter"..i) then |
info.text = "Delete Filter" |
info.tooltipTitle = "Delete Filter" |
info.tooltipText = "Deletes the filter, sending the buff back to the default stack" |
info.hasArrow = false |
info.func = function() |
info.func = function() |
ActiveButton.enabled = false |
BuffedProfiles[UnitName()].filterframes[ActiveButton.Btype][ActiveButton.name] = nil |
print(ActiveButton.name.." filter deleted") |
end |
end |
if (ActiveButton:GetName() == "BuffedMaster1") then |
info.text = "Sort By Duration" |
info.value = 3 |
info.checked = BuffedSettings.duration |
info.hasArrow = false |
info.func = function() if BuffedSettings.duration then BuffedSettings.duration = false; BuffedUpdate("force"); else BuffedSettings.duration = true BuffedUpdate("force") end end |
UIDropDownMenu_AddButton(info, level) |
info.text = "Filter Target Buffs" |
info.value = 3 |
info.checked = BuffedSettings.BuffIsMine |
info.checked = BuffedSettings.BuffIsMine |
info.tooltipTitle = "Filter Target Buffs" |
info.tooltipText = "Only show the target buffs that are yours." |
info.hasArrow = false |
info.func = function() |
info.func = function() |
if BuffedSettings.BuffIsMine then |
BuffedSettings.BuffIsMine = false |
else |
BuffedSettings.BuffIsMine = true |
end |
end |
BuffedUpdate("force") |
end |
UIDropDownMenu_AddButton(info, level) |
info.text = "Filter Target Debuffs" |
info.value = 3 |
info.checked = BuffedSettings.DebuffIsMine |
info.checked = BuffedSettings.DebuffIsMine |
info.tooltipTitle = "Filter Target Debuffs" |
info.tooltipText = "Only show the target debuffs that are yours." |
info.func = function() |
info.func = function() |
if BuffedSettings.DebuffIsMine then |
BuffedSettings.DebuffIsMine = false |
else |
BuffedSettings.DebuffIsMine = true |
end |
end |
BuffedUpdate("force") |
end |
UIDropDownMenu_AddButton(info, level) |
info.text = "Save Combat Positions" |
info.value = 3 |
info.checked = nil |
info.tooltipTitle = "Save Combat Positions" |
info.tooltipText = "Save the current buff position as the location for buffs in combat" |
info.func = function() |
info.func = function() |
ForAllFrames(function(f, FrameName, FrameNum, i) |
local f = _G["Buffed"..FrameName..i] |
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 |
if not BuffedProfiles[UnitName("player")].combat["Buffed"..FrameName..i] then |
BuffedProfiles[UnitName("player")].combat["Buffed"..FrameName..i] = {} |
end |
local t = BuffedProfiles[UnitName("player")].combat["Buffed"..FrameName..i] |
end) |
end |
UIDropDownMenu_AddButton(info, level) |
info.text = "Load Profile" |
info.tooltipTitle = "Load Character Profile" |
info.tooltipText = "Load the settings from another Character" |
info.value = "Profiles" |
info.hasArrow = true |
UIDropDownMenu_AddButton(info, level) |
info.text = "Load Presets" |
info.tooltipTitle = "Load Preset" |
info.tooltipText = "Load Presetconfigurations" |
info.tooltipText = "" |
info.hasArrow = true |
UIDropDownMenu_AddButton(info, level) |
info.text = "Texture" |
info.value = "Texture" |
info.tooltipTitle = "" |
info.tooltipText = "" |
UIDropDownMenu_AddButton(info, level) |
info.text = "Direction" |
info.value = "Direction" |
info.tooltipTitle = "" |
info.tooltipText = "" |
UIDropDownMenu_AddButton(info, level) |
info.text = "Colour" |
info.value = "Colour" |
info.tooltipTitle = "Colour" |
info.swatchFunc = function() local R,G,B = ColorPickerFrame:GetColorRGB() ActiveButton.bar.tex:SetVertexColor(R,G,B) end |
info.opacityFunc = function() local A = OpacitySliderFrame:GetValue() local R,G,B = ColorPickerFrame:GetColorRGB() ActiveButton.bar.tex:SetVertexColor(R,G,B, 1-A) end |
UIDropDownMenu_AddButton(info, level) |
elseif value == "Profiles" then |
for name, tables in pairs(BuffedProfiles) do |
for name, tables in pairs(BuffedProfiles) do |
info.text = name |
info.func = function() |
info.func = function() |
for FrameName, FrameNum in pairs(BuffedSettings.FrameCreation) do |
for i = 1, 32 do |
for i = 1, 32 do |
local f = _G["Buffed"..FrameName..i] |
if f then |
print("this bit") |
end) |
end |
UIDropDownMenu_AddButton(info, level) |
end |
elseif level == 3 then |
if value == "Orientation" then |
info.value = "Horizontal" |
info.tooltipTitle = "" |
info.tooltipText = "" |
info.checked = ActiveButton.bar.horiz |
info.checked = ActiveButton.bar.horiz |
if (ActiveButton:GetName() == "BuffedMaster1") then |
info.func = function() ForAllFrames(function(f) f.bar.horiz = true end) end |
else |
info.func = function() ActiveButton.bar.horiz = true end |
end |
UIDropDownMenu_AddButton(info, level) |
info.text = "Vertical" |
info.value = "Vertical" |
info.tooltipTitle = "" |
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 |
--------------------------------- anchor all buff frames --------------------------------- |
local function BuffedBuffButtonAnchors(buttonName, index, IsMine, buffname, tag) |
local function BuffedBuffButtonAnchors(buttonName, index, IsMine, buffname, tag) |
local buff = _G[buttonName..index] |
local confbuff = _G[tag..index-HiddenCount] |
if BuffedSettings.BuffIsMine and not (IsMine == "player") then |
local duration = _G[confbuff:GetName().."Duration"] |
local bduration = _G[buttonName..index.."Duration"] |
bduration:SetAllPoints(duration) |
buff:ClearAllPoints() |
buff:ClearAllPoints() |
if confbuff.alpha then |
buff:SetAlpha(confbuff.alpha) |
end |
local hours = floor(timer/3600) |
local minutes = floor((timer-hours*3600)/60) |
local seconds = floor((timer-hours*3600 -minutes*60)) |
if self.verbose then |
if self.verbose then |
else |
if hours > 0 and minutes > 0 then |
if minutes >= 10 then |
if minutes >= 10 then |
return hours..":"..minutes |
else |
return hours..":0"..minutes |
if minutes > 10 then |
return minutes.."m" |
else |
if seconds >= 10 then |
if seconds >= 10 then |
return minutes..":"..seconds |
else |
return minutes..":0"..seconds |
end |
local function BuffedButtonOnUpdate(self, elapsed, unit, index) |
if not self.divider then |
if not self.divider then |
self.divider = 0 |
end |
self.divider = self.divider + elapsed |
end |
local function BuffedRightClick(self, button) |
if ( button == "RightButton" ) then |
if ( button == "RightButton" ) then |
CancelUnitBuff(self.unit, self:GetID(), self.filter) |
elseif ( button == "LeftButton" ) then |
if IsShiftKeyDown() then |
if IsShiftKeyDown() then |
if not BuffedProfiles[UnitName("player")].filterframes[self.namePrefix][self.name] then |
for i = 1, 16 do |
local frame = _G["BuffedFilter"..i] |
return |
end |
end |
end |
end |
end |
end |
end |
buff.dbar:SetMinMaxValues(0, duration) |
if not buff.timeLeft then |
buff.timeLeft = expirationTime - GetTime(); |
buff:SetScript("OnUpdate", function(self, elapsed) |
buff:SetScript("OnUpdate", function(self, elapsed) |
BuffedButtonOnUpdate(self, elapsed, unit, index) end); |
else |
buff.timeLeft = expirationTime - GetTime(); |
g:SetScript("OnEvent", BuffedPositioning) |
function BuffFrame_Update() end |
function TargetFrame_UpdateAuras (self) end |