---------------------------------------------------------
-- Buff Frame
---------------------------------------------------------
local _G = _G
font, fsize, ftags = "Interface\\AddOns\\media\\font1.ttf", 14, 'THINOUTLINE'
space = 5
btsize = 30
DebuffTypeColor = { };
DebuffTypeColor["none"] = { r = 0.80, g = 0, b = 0 };
DebuffTypeColor["Magic"] = { r = 0.20, g = 0.60, b = 1.00 };
DebuffTypeColor["Curse"] = { r = 0.60, g = 0.00, b = 1.00 };
DebuffTypeColor["Disease"] = { r = 0.60, g = 0.40, b = 0 };
DebuffTypeColor["Poison"] = { r = 0.00, g = 0.60, b = 0 };
DebuffTypeColor[""] = DebuffTypeColor["none"];
color = DebuffTypeColor[debuffType]
local function StyleBuffs()
for i = 1, BUFF_ACTUAL_DISPLAY do
_G["BuffButton"..i.."Icon"]:SetTexCoord(.1, .9, .1, .9)
_G["BuffButton"..i.."Icon"]:SetDrawLayer("OVERLAY")
_G["BuffButton"..i]:ClearAllPoints()
_G["BuffButton"..i]:SetHeight(btsize)
_G["BuffButton"..i]:SetWidth(btsize)
CreateBorder(_G["BuffButton"..i], 12, 1,1,1, 1, 1, 1, 1, 1, 1, 1, 1)
if debuff then _G["BuffButton"..i]:SetBackdropColor(color.r, color.g, color.b)
else _G["BuffButton"..i]:SetBackdropColor(0,0,0,1) end
_G["BuffButton"..i.."Count"]:SetFont(font, fsize, ftags)
_G["BuffButton"..i.."Duration"]:SetFont(font, fsize, ftags)
if _G["BuffButton"..i.."Border"] then _G["BuffButton"..i.."Border"]:Hide() end
end
end
local function UpdateBuff()
for i = 1, BUFF_ACTUAL_DISPLAY do
StyleBuffs("BuffButton", i, false)
if i == 20 then _G["BuffButton"..i]:SetPoint("TOPLEFT", Minimap, -25, 0)
elseif i == 1 then _G["BuffButton"..i]:SetPoint("TOPLEFT", Minimap, -25, 0)
else _G["BuffButton"..i]:SetPoint("RIGHT", _G["BuffButton"..i-1], "LEFT", -(space), 0) end
end
for i = 1, 3 do
StyleBuffs("TempEnchant", i, false)
if i == 1 then _G["TempEnchant"..i]:SetPoint("BOTTOMRIGHT", Minimap, 0, -15)
else _G["TempEnchant"..i]:SetPoint("RIGHT", _G["TempEnchant"..i-1], "LEFT", -(space), 0)end
end
end
local function UpdateDebuff(buttonName, index)
StyleBuffs(buttonName, index, true)
if index == 1 then _G[buttonName..index]:SetPoint("BOTTOMLEFT", Minimap, -25, -10)
else _G[buttonName..index]:SetPoint("RIGHT", _G[buttonName .. (index-1)], "LEFT", -(space), 0) end
end
hooksecurefunc("BuffFrame_UpdateAllBuffAnchors", UpdateBuff)
hooksecurefunc("DebuffButton_UpdateAnchors", UpdateDebuff)
SetCVar("consolidateBuffs", 0)