local statusbar = "Interface\\AddOns\\oUF_Barbol\\media\\statusbar.tga"
local statusbar2 = "Interface\\AddOns\\oUF_Barbol\\media\\status.tga"
local fontn = "Interface\\AddOns\\oUF_Barbol\\media\\Prototype.ttf"
local font = "Interface\\AddOns\\oUF_Barbol\\media\\Font.ttf"
local iconborder = "Interface\\AddOns\\oUF_Barbol\\media\\iconborder.tga"
local backdrop = {
bgFile = "Interface\\AddOns\\oUF_Barbol\\media\\back.tga",
insets = {top = -1.3, left = -1.3, bottom = -1.3, right = -1.3},
}
local backdrop2 = {
bgFile = "Interface\\AddOns\\oUF_Barbol\\media\\back.tga",
insets = {top = -1, left = -1, bottom = -1, right = -1},
}
local statusback = {
bgFile = "Interface\\AddOns\\oUF_Barbol\\media\\statusbar.tga",
insets = {top = 0, left = 0, bottom = 0, right = 0},
}
local statusback2 = {
bgFile = "Interface\\AddOns\\oUF_Barbol\\media\\status.tga",
insets = {top = 0, left = 0, bottom = 0, right = 0},
}
local castback = {
bgFile = "Interface\\AddOns\\oUF_Barbol\\media\\status.tga",
edgeFile = "Interface\\Buttons\\WHITE8x8",
tile = false, tileSize = 0, edgeSize = 4,
insets = { left = -1, right = -1, top = -1, bottom = -1}
}
local backdrop3 = {
bgFile = [=[Interface\ChatFrame\ChatFrameBackground]=],
edgeFile = "Interface\\Buttons\\WHITE8x8",
tile = false, tileSize = 0, edgeSize = 1,
insets = { left = -1, right = -1, top = -1, bottom = -1}
}
local buffborder = "Interface\\AddOns\\oUF_Barbol\\media\\Border.tga"
local buffer = "Interface\\AddOns\\oUF_Barbol\\media\\overlay.tga"
local bordertwo = "Interface\\AddOns\\oUF_Barbol\\media\\buffborder.tga"
local threatbord = {edgeFile = "Interface\\Buttons\\WHITE8x8", edgeSize = 1}
------------- TAGS -------
--------------------------
oUF.Tags["My_PerHP"] = function(unit)
local curhp, maxhp = UnitHealth(unit), UnitHealthMax(unit);
if ((maxhp > 0) and (curhp < maxhp)) then
return math.floor((curhp / maxhp * 100 + 0.05) * 10)/10 .. '%'; -- by myno
end
end;
oUF.TagEvents["My_PerHP"] = oUF.TagEvents.perhp;
oUF.Tags["target_CurHP"] = function(unit)
local curhp = UnitHealth(unit);
if (curhp >= 1e6) then
return string.format("%.1fm", curhp / 1e6);
elseif (curhp >= 1e3) then
return string.format("%.1fk", curhp / 1e3);
else
return curhp;
end
end;
oUF.TagEvents["target_CurHP"] = oUF.TagEvents.perhp;
oUF.Tags["My_CurHP"] = function(unit)
local curhp = UnitHealth(unit);
if (curhp >= 1e6) then
return string.format(curhp);
elseif (curhp >= 1e3) then
return string.format(curhp);
else
return curhp;
end
end;
oUF.TagEvents["My_CurHP"] = oUF.TagEvents.perhp;
oUF.Tags["My_MaxHP"] = function(unit)
local curhp = UnitHealthMax(unit);
if (curhp >= 1e6) then
return string.format("%.1fm", curhp / 1e6);
elseif (curhp >= 1e3) then
return string.format("%.1fk", curhp / 1e3);
else
return curhp;
end
end;
oUF.TagEvents["My_MaxHP"] = oUF.TagEvents.perhp;
oUF.Tags["My_HP"] = function(unit)
local s = Status(unit)
if s then return s end
return "%s",HP(unit)
end;
oUF.TagEvents["My_HP"] = oUF.TagEvents.perhp;
------- ICONS -----
-------------------
local createRaidIcon = function(self)
self.RaidIcon = self.Health:CreateTexture(nil, "OVERLAY")
self.RaidIcon:SetTexture("Interface\\AddOns\\oUF_Barbol\\media\\raidicons.blp")
self.RaidIcon:SetSize(15, 15)
end
------- FREQ UPDATE ----
-----------------------
local FreqUpdate = 0.1
------- MENU ----
-----------------
local dropdown = CreateFrame("Frame", "MyAddOnUnitDropDownMenu", UIParent, "UIDropDownMenuTemplate")
UIDropDownMenu_Initialize(dropdown, function(self)
local unit = self:GetParent().unit
if not unit then return end
local menu, name, id
if UnitIsUnit(unit, "player") then
menu = "SELF"
elseif UnitIsUnit(unit, "vehicle") then
menu = "VEHICLE"
elseif UnitIsUnit(unit, "pet") then
menu = "PET"
elseif UnitIsPlayer(unit) then
id = UnitInRaid(unit)
if id then
menu = "RAID_PLAYER"
name = GetRaidRosterInfo(id)
elseif UnitInParty(unit) then
menu = "PARTY"
else
menu = "PLAYER"
end
else
menu = "TARGET"
name = RAID_TARGET_ICON
end
if menu then
UnitPopup_ShowMenu(self, menu, unit, name, id)
end
end, "MENU")
menu = function(self)
dropdown:SetParent(self)
ToggleDropDownMenu(1, nil, dropdown, "cursor", 0, 0)
end
---------- AGGRO -----
----------------------
updateAggro = function(self, event, unit)
if (self.unit ~= unit) then return end
local status = UnitThreatSituation(unit)
unit = unit or self.unit
if status and status > 1 then
local r, g, b = GetThreatStatusColor(status)
self.Threat:Show()
self.Threat:SetBackdropBorderColor(r, g, b, 1)
else
self.Threat:SetBackdropBorderColor(r, g, b, 0)
self.Threat:Hide()
end
end
---------- BUFFBORDER ---
-------------------------
local PostCreateIcon = function(this, aura)
aura.overlay:SetTexture(buffborder)
aura.overlay:SetTexCoord(0.948, 0.05, 0.93, 0.06)
aura.overlay.Hide = function(self) self:SetVertexColor(.4,.4,.4) end
end
------- LAYOUT ------
---------------------
local Shared = function(self, unit, isSingle)
self.colors = colors
self.menu = menu
self:RegisterForClicks('AnyDown')
self:SetAttribute('*type2', 'menu')
self:SetScript('OnEnter', UnitFrame_OnEnter)
self:SetScript('OnLeave', UnitFrame_OnLeave)
if(isSingle) then
self:SetSize(220, 35)
end
end
local Player = function(self)
self:SetSize(230, 40)
------ BACKGROUND ---
---------------------
Back = CreateFrame('Frame', nil, self)
Back:SetPoint('TOPRIGHT', self)
Back:SetPoint('TOPLEFT', self)
Back:SetFrameStrata('BACKGROUND')
Back:SetBackdrop(backdrop3)
Back:SetBackdropColor(0.05, 0.05, 0.05)
Back:SetBackdropBorderColor(0.4, 0.4, 0.4)
Back:SetHeight(40)
---------- HEALTH -------
-------------------------
------ BAR ------
-----------------
self.Health = CreateFrame('StatusBar', nil, Back)
self.Health:SetBackdrop(statusback2)
self.Health:SetBackdropColor(0.7, 0.7, 0.7)
self.Health:SetFrameStrata('LOW')
self.Health:SetPoint('TOPRIGHT', self, -2, -2)
self.Health:SetPoint('TOPLEFT', self, 2, -2)
self.Health:SetStatusBarTexture(statusbar2)
self.Health:SetStatusBarColor(0.28,0.28,0.28)
self.Health.frequentUpdates = FreqUpdate
self.Health.Smooth = cSmooth
self.Health:SetHeight(28)
self.Health.colorClass = false
------- TEXT BOTTOM NUMBER ----
-------------------------------
self.Health.Text = self.Health:CreateFontString(nil, 'OVERLAY')
self.Health.Text:SetFont(fontn, 24, 'THINOUTLINE')
self:Tag(self.Health.Text,'[My_CurHP]|r')
self.Health.Text:SetShadowOffset(1, -1)
self.Health.Text.frequentUpdates = FreqUpdate
self.Health.Text:SetJustifyH('LEFT')
self.Health.Text:SetPoint('TOPLEFT',self.Health,'BOTTOMLEFT', 0, -11)
--------TEXT PERCENT ----
-------------------------
self.Health.Text = self.Health:CreateFontString(nil, 'OVERLAY')
self.Health.Text:SetFont(fontn, 16, 'THINOUTLINE')
self.Health.Text:SetShadowOffset(1, -1)
self.Health.Text.frequentUpdates = FreqUpdate
self:Tag(self.Health.Text,'[My_PerHP]|r')
self.Health.Text:SetJustifyH('CENTER')
self.Health.Text:SetPoint('RIGHT',self, -14, 3)
----------------- POWER ----------
----------------------------------
--------- BAR ------
--------------------
self.Power = CreateFrame('StatusBar', nil, Back)
self.Power:SetFrameStrata('LOW')
self.Power:SetPoint('TOPRIGHT', self.Health, 'BOTTOMRIGHT', 0, -1)
self.Power:SetPoint('TOPLEFT', self.Health, 'BOTTOMLEFT', 0, -1)
self.Power:SetStatusBarTexture(statusbar2)
self.Power:SetStatusBarColor(0.28, 0.28, 0.28)
self.Power.frequentUpdates = FreqUpdate
self.Power.Smooth = cSmooth
self.Power:SetHeight(7)
self.Power.colorClass = true
powerback = self.Power:CreateTexture(nil,'BORDER')
powerback:SetAllPoints(self.Power)
powerback:SetTexture(statusbar2)
powerback:SetAlpha(0.54)
powerback.multiplier = 1
self.Power.bg = powerback
------ POWER TEXT ----
----------------------
self.Power.Text = self.Health:CreateFontString(nil, 'OVERLAY')
self.Power.Text:SetFont(fontn, 20, 'THINOUTLINE')
self.Power.Text:SetShadowOffset(1, -1)
self.Power.Text.frequentUpdates = FreqUpdate
self:Tag(self.Power.Text,'[raidcolor] [curpp]|r')
self.Power.Text:SetJustifyH('LEFT')
self.Power.Text:SetPoint('TOPLEFT',self.Health,'BOTTOMLEFT', -5, -31)
--------- AGGRO -----
---------------------
self.Threat = CreateFrame("Frame", nil, self)
self.Threat:SetPoint('TOPRIGHT', self)
self.Threat:SetPoint('TOPLEFT', self)
self.Threat:SetBackdrop(threatbord)
self.Threat:SetFrameLevel(1)
self.Threat:SetHeight(40)
self.Threat:Show()
self:RegisterEvent("UNIT_THREAT_LIST_UPDATE", updateAggro)
self:RegisterEvent("UNIT_THREAT_SITUATION_UPDATE", updateAggro)
----------------- ICONS ----------
----------------------------------
--------- LEADER -------
------------------------
self.Leader = self.Health:CreateTexture(nil, 'OVERLAY')
self.Leader:SetPoint('RIGHT', self, 1, -5 )
self.Leader:SetHeight(14)
self.Leader:SetWidth(14)
------- MASTERLOOTER ------
---------------------------
self.MasterLooter = self.Health:CreateTexture(nil, 'OVERLAY')
self.MasterLooter:SetPoint('RIGHT', self, 9, -14 )
self.MasterLooter:SetHeight(11)
self.MasterLooter:SetWidth(11)
------- PVP FLAG -----
----------------------
self.PvP = self.Health:CreateTexture(nil, 'OVERLAY')
self.PvP:SetPoint('BOTTOMLEFT', self, 0, 0)
self.PvP:SetHeight(25)
self.PvP:SetWidth(25)
------- COMBAT -------
----------------------
self.Combat = self.Health:CreateTexture(nil, 'OVERLAY')
self.Combat:SetPoint('RIGHT', self, 9, -20)
self.Combat:SetHeight(25)
self.Combat:SetWidth(25)
--------- COMBO POINTS ---------
--------------------------------
self.CPoints = CreateFrame("Frame", nil, self)
self.CPoints:SetPoint("TOPLEFT", self.Health, "TOPLEFT",0, 0)
self.CPoints:SetHeight(5)
self.CPoints:SetWidth(165/5)
for i = 1, 5 do
self.CPoints[i] = CreateFrame("StatusBar", nil, self)
self.CPoints[i]:SetStatusBarTexture(statusbar)
self.CPoints[i]:SetHeight(5)
self.CPoints[i]:SetWidth(165/5)
self.CPoints[i]:SetBackdrop(backdrop2)
self.CPoints[i]:SetBackdropColor(0, 0, 0)
if i == 1 then
self.CPoints[i]:SetPoint("TOPRIGHT", self.Health, "TOPRIGHT", 0, 0)
else
self.CPoints[i]:SetPoint("RIGHT", self.CPoints[i-1], "LEFT", -1, 0)
end
if i == 5 then
self.CPoints[i]:SetStatusBarColor(1, 0.3, 0)
else
self.CPoints[i]:SetStatusBarColor(1, 0.3, 0)
end
end
local _, class = UnitClass("player")
if class == "DEATHKNIGHT" then
self.Runes = CreateFrame("Frame", nil, self)
self.Runes:SetPoint("TOPLEFT", self.Health, "TOPLEFT", 0, 0)
self.Runes:SetHeight(5)
self.Runes:SetWidth(95/6)
for i = 1, 6 do
self.Runes[i] = CreateFrame("StatusBar", nil, self)
self.Runes[i]:SetStatusBarTexture(statusbar)
self.Runes[i]:SetHeight(5)
self.Runes[i]:SetWidth(221/6)
self.Runes[i]:SetBackdrop(backdrop2)
self.Runes[i]:SetBackdropColor(0, 0, 0)
if i == 1 then
self.Runes[i]:SetPoint("TOPLEFT", self.Health, "TOPLEFT", 189, 0)
else
self.Runes[i]:SetPoint("RIGHT", self.Runes[i-1], "LEFT", -1, 0)
end
self.Runes[i].bg = self.Runes[i]:CreateTexture(nil, "BORDER")
self.Runes[i].bg:SetAllPoints(self.Runes[i])
self.Runes[i].bg:SetTexture(statusbar)
self.Runes[i].bg.multiplier = 0.3
end
end
---------- SOULSHARDS --------
------------------------------
local _, class = UnitClass('player')
if class == "WARLOCK" then
self.SoulShards = CreateFrame("Frame", nil, self)
self.SoulShards:SetPoint("TOPLEFT", self.Health, "TOPLEFT", 0, 0)
self.SoulShards:SetSize((120/3), 5)
for i = 1, 3 do
self.SoulShards[i] = CreateFrame("StatusBar", nil, self)
self.SoulShards[i]:SetStatusBarTexture(statusbar)
self.SoulShards[i]:SetStatusBarColor(0.8, 0.3, .86)
self.SoulShards[i]:SetSize((120/3), 5)
self.SoulShards[i]:SetBackdrop(backdrop2)
self.SoulShards[i]:SetBackdropColor(0, 0, 0)
if i == 1 then
self.SoulShards[i]:SetPoint("TOPRIGHT", self.Health, "TOPRIGHT", 0, 0)
else
self.SoulShards[i]:SetPoint("RIGHT", self.SoulShards[i-1], "LEFT", -1, 0)
end
end
end
-------- HOLYPOWER -------
--------------------------
local _, class = UnitClass('player')
if class == "PALADIN" then
self.HolyPower = CreateFrame("Frame", nil, self)
self.HolyPower:SetPoint("TOPRIGHT", self.Health, "TOPRIGHT", 0, 0)
self.HolyPower:SetSize((120/3), 5)
for i = 1, 3 do
self.HolyPower[i] = CreateFrame("StatusBar", nil, self)
self.HolyPower[i]:SetStatusBarTexture(statusbar)
self.HolyPower[i]:SetStatusBarColor(1, 0.9, 0.45)
self.HolyPower[i]:SetSize((120/3), 5)
self.HolyPower[i]:SetBackdrop(backdrop2)
self.HolyPower[i]:SetBackdropColor(0, 0, 0)
if i == 1 then
self.HolyPower[i]:SetPoint("TOPRIGHT", self.Health, "TOPRIGHT", 0, 0)
else
self.HolyPower[i]:SetPoint("RIGHT", self.HolyPower[i-1], "LEFT", -1, 0)
end
end
end
--------- ECLIPSE BAR -------
-----------------------------
local _, class = UnitClass('player')
if class == 'DRUID' then
self.EclipseBar = CreateFrame('Frame', nil, self)
self.EclipseBar:SetPoint("TOPLEFT", self.Health, "TOPLEFT", 0, 0)
self.EclipseBar:SetSize(150, 5)
self.EclipseBar:SetBackdrop(backdrop)
self.EclipseBar:SetBackdropColor(0, 0, 0)
self.EclipseBar.LunarBar = CreateFrame('StatusBar', nil, self.EclipseBar)
self.EclipseBar.LunarBar:SetPoint('LEFT', self.EclipseBar, 'LEFT', 0, 0)
self.EclipseBar.LunarBar:SetSize(150, 5)
self.EclipseBar.LunarBar:SetStatusBarTexture(statusbar)
self.EclipseBar.LunarBar:SetStatusBarColor(0, .7, 1)
self.EclipseBar.LunarBar.frequentUpdates = FreqUpdate
self.EclipseBar.SolarBar = CreateFrame('StatusBar', nil, self.EclipseBar)
self.EclipseBar.SolarBar:SetPoint('LEFT', self.EclipseBar.LunarBar:GetStatusBarTexture(), 'RIGHT', 0, 0)
self.EclipseBar.SolarBar:SetSize(150, 5)
self.EclipseBar.SolarBar:SetStatusBarTexture(statusbar)
self.EclipseBar.SolarBar:SetStatusBarColor(1, 3/5, 0)
self.EclipseBar.SolarBar.frequentUpdates = FreqUpdate
self.EclipseBarText = self.EclipseBar.SolarBar:CreateFontString(nil, 'OVERLAY')
self.EclipseBarText:SetPoint('CENTER', self.EclipseBar, 'CENTER', 0, 0)
self.EclipseBarText:SetFont(fontn, 9, 'THINOUTLINE')
self:Tag(self.EclipseBarText, '[pereclipse]')
end
-------- TOTEMBAR -------
-------------------------
local _, class = UnitClass('player')
if IsAddOnLoaded("oUF_TotemBar") and class == "SHAMAN" then
self.TotemBar = {}
self.TotemBar.Destroy = true
for i = 1, 4 do
self.TotemBar[i] = CreateFrame("StatusBar", nil, self)
self.TotemBar[i]:SetStatusBarTexture(statusbar)
self.TotemBar[i]:SetBackdrop(backdrop2)
self.TotemBar[i]:SetBackdropColor(0, 0, 0)
self.TotemBar[i]:SetHeight(5)
self.TotemBar[i]:SetWidth(160/4)
self.TotemBar[i]:SetMinMaxValues(0, 1)
if i == 1 then
self.TotemBar[i]:SetPoint("TOPLEFT", self.Health, "TOPLEFT", 123, 0)
else
self.TotemBar[i]:SetPoint("RIGHT", self.TotemBar[i-1], "LEFT", -1, 0)
end
self.TotemBar[i].bg = self.TotemBar[i]:CreateTexture(nil, "BORDER")
self.TotemBar[i].bg:SetAllPoints(self.TotemBar[i])
self.TotemBar[i].bg:SetTexture(statusbar)
self.TotemBar[i].bg.multiplier = 0.3
end
end
------------- CASTBAR -------
-----------------------------
------- BAR -----
-----------------
local cb = CreateFrame('StatusBar', nil, self)
cb:SetBackdrop(statusback2)
cb:SetBackdropColor( .7,.7,.7)
cb:SetFrameStrata('BACKGROUND')
cb:SetFrameLevel(10)
cb:SetWidth(283)
cb:SetHeight(20)
cb:SetPoint('CENTER', self, 295, -155)
cb:SetStatusBarTexture(statusbar2)
cb:SetStatusBarColor(0.28,0.28,0.28)
self.Castbar = cb
cb.bg = CreateFrame('Frame', nil, cb)
cb.bg:SetBackdrop(backdrop3)
cb.bg:SetBackdropColor(.05,.05,.05)
cb.bg:SetBackdropBorderColor(.4,.4,.4)
cb.bg:SetPoint('TOPRIGHT', cb, 2, 2)
cb.bg:SetPoint('BOTTOMLEFT', cb, -2, -2)
cb.bg:SetFrameStrata('BACKGROUND')
cb.bg:SetFrameLevel(5)
------ ICON -----
-----------------
iconbg = CreateFrame('Frame', nil, cb)
iconbg:SetBackdrop(backdrop3)
iconbg:SetBackdropColor(.05,.05,.05)
iconbg:SetBackdropBorderColor(.4,.4,.4)
iconbg:SetPoint('LEFT', cb, 'LEFT', -28, 0)
iconbg:SetWidth(24)
iconbg:SetHeight(24)
self.Castbar.Icon = iconbg:CreateTexture(nil, 'ARTWORK')
self.Castbar.Icon:SetPoint('BOTTOMLEFT', iconbg, 1, 1)
self.Castbar.Icon:SetPoint('TOPRIGHT', iconbg, -1, -1)
self.Castbar.Icon:SetTexCoord(0.08, 0.92, 0.08, .92)
------- SPELL TEXT ----
-----------------------
self.Castbar.Text = self.Castbar:CreateFontString(nil, 'OVERLAY')
self.Castbar.Text:SetFont(fontn, 11, 'THINOUTLINE')
self.Castbar.Text:SetPoint('LEFT', cb,'LEFT', 0, 0)
self.Castbar.Text:SetWidth(200)
self.Castbar.Text:SetTextColor(1,1,1)
self.Castbar.Text:SetJustifyH('LEFT')
---------- TIME ------
----------------------
self.Castbar.Time = self.Castbar:CreateFontString(nil, 'OVERLAY')
self.Castbar.Time:SetFont(fontn, 12, 'THINOUTLINE')
self.Castbar.Time:SetPoint('RIGHT', cb,'RIGHT',0, 0)
self.Castbar.Time:SetWidth(50)
self.Castbar.Time:SetTextColor(1,1,1)
self.Castbar.Time:SetJustifyH('RIGHT')
end
local Party = function(self)
self:SetSize(220, 35)
------ BACKGROUND ---
---------------------
Back = CreateFrame('Frame', nil, self)
Back:SetPoint('TOPRIGHT', self)
Back:SetPoint('TOPLEFT', self)
Back:SetFrameStrata('BACKGROUND')
Back:SetBackdrop(backdrop3)
Back:SetBackdropColor(0.05, 0.05, 0.05)
Back:SetBackdropBorderColor(0.4, 0.4, 0.4)
Back:SetHeight(35)
---------- HEALTH -------
-------------------------
------ BAR ------
-----------------
self.Health = CreateFrame('StatusBar', nil, Back)
self.Health:SetBackdrop(statusback2)
self.Health:SetBackdropColor(0.7,0.7,0.7)
self.Health:SetFrameStrata('LOW')
self.Health:SetPoint('TOPRIGHT', self, -2, -2)
self.Health:SetPoint('TOPLEFT', self, 2, -2)
self.Health:SetStatusBarTexture(statusbar2)
self.Health:SetStatusBarColor(0.28,0.28,0.28)
self.Health.frequentUpdates = FreqUpdate
self.Health.Smooth = cSmooth
self.Health:SetHeight(23)
self.Health.colorClass = false
--------TEXT PERCENT ----
-------------------------
self.Health.Text = self.Health:CreateFontString(nil, 'OVERLAY')
self.Health.Text:SetFont(fontn, 15, 'THINOUTLINE')
self.Health.Text:SetShadowOffset(1, -1)
self.Health.Text.frequentUpdates = FreqUpdate
self:Tag(self.Health.Text,'[My_PerHP]|r')
self.Health.Text:SetJustifyH('CENTER')
self.Health.Text:SetPoint('CENTER',self, 10, 4)
-------- OFFLINE ----
---------------------
self.Health.Text = self.Health:CreateFontString(nil, 'OVERLAY')
self.Health.Text:SetFont(fontn, 13, 'THINOUTLINE')
self.Health.Text:SetShadowOffset(1, -1)
self.Health.Text.frequentUpdates = FreqUpdate
self:Tag(self.Health.Text,'[offline]|r')
self.Health.Text:SetJustifyH('CENTER')
self.Health.Text:SetPoint('BOTTOMRIGHT',self.Health,'BOTTOMRIGHT', 0, -17)
----------------- POWER ----------
----------------------------------
--------- BAR ------
--------------------
self.Power = CreateFrame('StatusBar', nil, Back)
self.Power:SetFrameStrata('LOW')
self.Power:SetPoint('TOPRIGHT', self.Health, 'BOTTOMRIGHT', 0, -1)
self.Power:SetPoint('TOPLEFT', self.Health, 'BOTTOMLEFT', 0, -1)
self.Power:SetStatusBarTexture(statusbar2)
self.Power:SetStatusBarColor(0.28,0.28,0.28)
self.Power.frequentUpdates = FreqUpdate
self.Power.Smooth = cSmooth
self.Power:SetHeight(7)
self.Power.colorClass = true
powerback = self.Power:CreateTexture(nil,'BORDER')
powerback:SetAllPoints(self.Power)
powerback:SetTexture(statusbar2)
powerback:SetAlpha(0.54)
powerback.multiplier = 1
self.Power.bg = powerback
--------- AGGRO -----
---------------------
self.Threat = CreateFrame("Frame", nil, Back)
self.Threat:SetPoint('TOPRIGHT', self)
self.Threat:SetPoint('TOPLEFT', self)
self.Threat:SetBackdrop(threatbord)
self.Threat:SetHeight(35)
self.Threat:SetBackdropBorderColor(.4,.4,.4)
self.Threat.frequentUpdates = FreqUpdate
self.Threat:Show()
self:RegisterEvent("UNIT_THREAT_LIST_UPDATE", updateAggro)
self:RegisterEvent("UNIT_THREAT_SITUATION_UPDATE", updateAggro)
--------- NAME -------
----------------------
self.Info = self.Health:CreateFontString(nil, 'OVERLAY')
self.Info:SetShadowOffset(1, -1)
self.Info:SetAlpha(1)
self.Info:SetFont(fontn, 15, 'THINOUTLINE')
self:Tag(self.Info,'[raidcolor] [name]' )
self.Info:SetJustifyH('LEFT')
self.Info:SetPoint('LEFT',self.Health,'LEFT', -1, 12)
--------- RANGE ------
----------------------
self.Range = { insideAlpha = 1, outsideAlpha = .4 }
----------------- ICONS ----------
----------------------------------
--------- LEADER -------
------------------------
self.Leader = self.Health:CreateTexture(nil, 'OVERLAY')
self.Leader:SetPoint("BOTTOMLEFT", self.Health,'BOTTOMLEFT', 0, 0)
self.Leader:SetHeight(14)
self.Leader:SetWidth(14)
------- RAID ICONS ------
-------------------------
createRaidIcon(self)
self.RaidIcon:SetPoint("TOP", self.Health, "TOP", 9, 8)
------- READY CHECK ------
--------------------------
self.ReadyCheck = self.Health:CreateTexture(nil, 'OVERLAY')
self.ReadyCheck:SetPoint("BOTTOMLEFT", self.Health,'RIGHT', 0, 0)
self.ReadyCheck:SetHeight(18)
self.ReadyCheck:SetWidth(18)
------- LFD ROLE ------
-----------------------
self.LFDRole = self.Health:CreateTexture(nil, 'OVERLAY')
self.LFDRole:SetPoint("RIGHT", self.Health,'LEFT', 0, 0)
self.LFDRole:SetHeight(17)
self.LFDRole:SetWidth(17)
end
local Target = function(self)
self:SetSize(230, 40)
------ BACKGROUND ---
---------------------
Back = CreateFrame('Frame', nil, self)
Back:SetPoint('TOPRIGHT', self)
Back:SetPoint('TOPLEFT', self)
Back:SetFrameStrata('BACKGROUND')
Back:SetBackdrop(backdrop3)
Back:SetBackdropColor(0.05, 0.05, 0.05)
Back:SetBackdropBorderColor(.4,.4,.4)
Back:SetHeight(40)
---------- HEALTH -------
-------------------------
------ BAR ------
-----------------
self.Health = CreateFrame('StatusBar', nil, Back)
self.Health:SetBackdrop(statusback2)
self.Health:SetBackdropColor(0.7,0.7,0.7)
self.Health:SetFrameStrata('LOW')
self.Health:SetPoint('TOPLEFT', self, 2, -2)
self.Health:SetPoint('TOPRIGHT', self, -2, -2)
self.Health:SetStatusBarTexture(statusbar2)
self.Health:SetStatusBarColor(0.28,0.28,0.28)
self.Health.frequentUpdates = FreqUpdate
self.Health.Smooth = cSmooth
self.Health:SetHeight(28)
self.Health.colorClass = false
-------- TEXT NUMBER ---
------------------------
self.Health.Text = self.Health:CreateFontString(nil, 'OVERLAY')
self.Health.Text:SetFont(fontn, 14, 'THINOUTLINE')
self:Tag(self.Health.Text,'[target_CurHP] / [My_MaxHP]|r')
self.Health.Text:SetShadowOffset(1, -1)
self.Health.Text.frequentUpdates = FreqUpdate
self.Health.Text:SetJustifyH('LEFT')
self.Health.Text:SetPoint('TOPRIGHT',self.Health,'RIGHT', 0, -25)
-------- TEXT PERCENT ---
-------------------------
self.Health.Text = self.Health:CreateFontString(nil, 'OVERLAY')
self.Health.Text:SetFont(fontn, 16, 'THINOUTLINE')
self.Health.Text:SetShadowOffset(1, -1)
self.Health.Text.frequentUpdates = FreqUpdate
self:Tag(self.Health.Text,'[My_PerHP]|r')
self.Health.Text:SetJustifyH('CENTER')
self.Health.Text:SetPoint('RIGHT',self, 0, 4)
-------- POWER ----
-------------------
-------- BAR ----
-----------------
self.Power = CreateFrame('StatusBar', nil, Back)
self.Power:SetFrameStrata('LOW')
self.Power:SetPoint('TOPRIGHT', self.Health, 'BOTTOMRIGHT', 0, -1)
self.Power:SetPoint('TOPLEFT', self.Health, 'BOTTOMLEFT', 0, -1)
self.Power:SetStatusBarTexture(statusbar2)
self.Power:SetStatusBarColor(0.28,0.28,0.28)
self.Power.frequentUpdates = FreqUpdate
self.Power.Smooth = cSmooth
self.Power:SetHeight(7)
self.Power.colorClass = true
powerback = self.Power:CreateTexture(nil,'BORDER')
powerback:SetAllPoints(self.Power)
powerback:SetTexture(statusbar2)
powerback:SetAlpha(0.54)
powerback.multiplier = 1
self.Power.bg = powerback
-------- NAME ----
------------------
self.Info = self.Health:CreateFontString(nil, 'OVERLAY')
self.Info:SetShadowOffset(1, -1)
self.Info:SetAlpha(1)
self.Info:SetFont(fontn, 15, 'THINOUTLINE')
self:Tag(self.Info,'[raidcolor] [name]' )
self.Info:SetJustifyH('LEFT')
self.Info:SetPoint('TOPLEFT',self.Health,'LEFT', -8, 23)
-------- BUFFS ---
------------------
self.Buffs = CreateFrame('Frame', nil, self)
self.Buffs.size = 4.5 * 4.5
self.Buffs.spacing = 2
self.Buffs:SetWidth(100)
self.Buffs:SetHeight(100)
self.Buffs:SetFrameStrata("BACKGROUND")
self.Buffs.initialAnchor = 'TOPLEFT'
self.Buffs['growth-x'] = 'RIGHT'
self.Buffs['growth-y'] = 'DOWN'
self.Buffs.num = 12
self.Buffs.Filter = false
self.Buffs:SetPoint('TOPLEFT',self.Health,'BOTTOMLEFT', -2, -12)
self.Buffs.PostCreateIcon = PostCreateIcon
-------- DEBUFFS ----
---------------------
self.Debuffs = CreateFrame('Frame', nil, self)
self.Debuffs.size = 4.7 * 4.7
self.Debuffs.spacing = 2
self.Debuffs:SetWidth(100)
self.Debuffs:SetHeight(150)
self.Debuffs:SetFrameStrata("BACKGROUND")
self.Debuffs.initialAnchor = 'TOPLEFT'
self.Debuffs['growth-x'] = 'RIGHT'
self.Debuffs['growth-y'] = 'DOWN'
self.Debuffs.num = 12
self.Debuffs.Filter = false
self.Debuffs:SetPoint('TOPLEFT',self.Health,'TOPRIGHT', 5, 1)
self.Debuffs.PostCreateIcon = PostCreateIcon
-------- ICONS ----
-------------------
-------- RAID ICONS ----
------------------------
createRaidIcon(self)
self.RaidIcon:SetPoint("CENTER", self.Health, "CENTER", 0, 9)
-------- CAST BAR ----
----------------------
-------- BAR ----
-----------------
local cb = CreateFrame('StatusBar', nil, self)
cb:SetBackdrop(statusback2)
cb:SetBackdropColor( .7,.7,.7)
cb:SetFrameStrata('BACKGROUND')
cb:SetFrameLevel(10)
cb:SetWidth(283)
cb:SetHeight(20)
cb:SetPoint('CENTER', self, -265, -123)
cb:SetStatusBarTexture(statusbar2)
cb:SetStatusBarColor(0.28,0.28,0.28)
self.Castbar = cb
cb.bg = CreateFrame('Frame', nil, cb)
cb.bg:SetBackdrop(backdrop3)
cb.bg:SetBackdropColor(.05,.05,.05)
cb.bg:SetBackdropBorderColor(.4,.4,.4)
cb.bg:SetPoint('TOPRIGHT', cb, 2, 2)
cb.bg:SetPoint('BOTTOMLEFT', cb, -2, -2)
cb.bg:SetFrameStrata('BACKGROUND')
cb.bg:SetFrameLevel(5)
-------- SPELL NAME ----
------------------------
self.Castbar.Text = self.Castbar:CreateFontString(nil, 'OVERLAY')
self.Castbar.Text:SetFont(fontn, 11, 'THINOUTLINE')
self.Castbar.Text:SetPoint('LEFT', cb,'LEFT', 0, 0)
self.Castbar.Text:SetWidth(200)
self.Castbar.Text:SetTextColor(1,1,1)
self.Castbar.Text:SetJustifyH('LEFT')
-------- NUMBER ----
--------------------
self.Castbar.Time = self.Castbar:CreateFontString(nil, 'OVERLAY')
self.Castbar.Time:SetFont(fontn, 12, 'THINOUTLINE')
self.Castbar.Time:SetPoint('RIGHT', cb,'RIGHT',0, 0)
self.Castbar.Time:SetWidth(50)
self.Castbar.Time:SetTextColor(1,1,1)
self.Castbar.Time:SetJustifyH('RIGHT')
------ ICON -----
-----------------
iconbg = CreateFrame('Frame', nil, cb)
iconbg:SetBackdrop(backdrop3)
iconbg:SetBackdropColor(.05,.05,.05)
iconbg:SetBackdropBorderColor(.4,.4,.4)
iconbg:SetPoint('LEFT', cb, 'LEFT', -28, 0)
iconbg:SetWidth(24)
iconbg:SetHeight(24)
self.Castbar.Icon = iconbg:CreateTexture(nil, 'ARTWORK')
self.Castbar.Icon:SetPoint('BOTTOMLEFT', iconbg, 1, 1)
self.Castbar.Icon:SetPoint('TOPRIGHT', iconbg, -1, -1)
self.Castbar.Icon:SetTexCoord(0.08, 0.92, 0.08, .92)
end
local ToTarget = function(self)
self:SetSize(115, 25)
-------- BACKGROUND ----
------------------------
Back = CreateFrame('Frame', nil, self)
Back:SetPoint('TOPRIGHT', self)
Back:SetPoint('TOPLEFT', self)
Back:SetFrameStrata('BACKGROUND')
Back:SetBackdrop(backdrop3)
Back:SetBackdropColor(0.05, 0.05, 0.05)
Back:SetBackdropBorderColor(.4,.4,.4)
Back:SetHeight(25)
-------- HEALTH ----
--------------------
-------- BAR ----
-----------------
self.Health = CreateFrame('StatusBar', nil, Back)
self.Health:SetBackdrop(statusback2)
self.Health:SetBackdropColor(0.7,0.7,0.7)
self.Health:SetFrameStrata('LOW')
self.Health:SetPoint('TOPRIGHT', self, -2, -2)
self.Health:SetPoint('TOPLEFT', self, 2, -2)
self.Health:SetStatusBarTexture(statusbar2)
self.Health:SetStatusBarColor(0.28,0.28,0.28)
self.Health.frequentUpdates = FreqUpdate
self.Health.Smooth = cSmooth
self.Health:SetHeight(22)
-------- TEXT PERCENT ----
-------------------------
self.Health.Text = self.Health:CreateFontString(nil, 'OVERLAY')
self.Health.Text:SetFont(fontn, 15, 'THINOUTLINE')
self.Health.Text:SetShadowOffset(1, -1)
self.Health.Text.frequentUpdates = FreqUpdate
self:Tag(self.Health.Text,'[My_PerHP]|r')
self.Health.Text:SetJustifyH('CENTER')
self.Health.Text:SetPoint('CENTER',self.Health,'CENTER', 0, 0)
-------- NAME ----
------------------
self.Info = self.Health:CreateFontString(nil, 'OVERLAY')
self.Info:SetShadowOffset(1, -1)
self.Info:SetAlpha(1)
self.Info:SetFont(fontn, 16, 'THINOUTLINE')
self:Tag(self.Info,'[raidcolor] [name]' )
self.Info:SetJustifyH('CENTER')
self.Info:SetPoint('LEFT',self.Health,'RIGHT', 2, 1)
end
local Pet = function(self)
self:SetSize(110, 27)
-------- BACKGROUND ----
------------------------
Back = CreateFrame('Frame', nil, self)
Back:SetPoint('TOPRIGHT', self)
Back:SetPoint('TOPLEFT', self)
Back:SetFrameStrata('BACKGROUND')
Back:SetBackdrop(backdrop3)
Back:SetBackdropColor(0.05, 0.05, 0.05)
Back:SetBackdropBorderColor(.4,.4,.4)
Back:SetHeight(27)
-------- HEALTH ----
--------------------
-------- BAR ----
-----------------
self.Health = CreateFrame('StatusBar', nil, Back)
self.Health:SetBackdrop(statusback2)
self.Health:SetBackdropColor(0.7,0.7,0.7)
self.Health:SetFrameStrata('LOW')
self.Health:SetPoint('TOPRIGHT', self, -2, -2)
self.Health:SetPoint('TOPLEFT', self, 2, -2)
self.Health:SetStatusBarTexture(statusbar2)
self.Health:SetStatusBarColor(0.28,0.28,0.28)
self.Health.frequentUpdates = FreqUpdate
self.Health.Smooth = cSmooth
self.Health:SetHeight(23)
-------- TEXT PERCENT --
------------------------
self.Health.Text = self.Health:CreateFontString(nil, 'OVERLAY')
self.Health.Text:SetFont(font, 15, 'THINOUTLINE')
self.Health.Text:SetShadowOffset(1, -1)
self.Health.Text.frequentUpdates = FreqUpdate
self:Tag(self.Health.Text,'[My_PerHP]|r')
self.Health.Text:SetJustifyH('CENTER')
self.Health.Text:SetPoint('RIGHT',self.Health, 'RIGHT', 0, 0)
-------- NAME ----
------------------
self.Info = self.Health:CreateFontString(nil, 'OVERLAY')
self.Info:SetShadowOffset(1, -1)
self.Info:SetAlpha(1)
self.Info:SetFont(fontn, 12, 'THINOUTLINE')
self:Tag(self.Info,'[raidcolor] [name]' )
self.Info:SetJustifyH('RIGHT')
self.Info:SetPoint('TOPLEFT',self.Health,'LEFT', -3, -2)
end
local Focus = function(self)
self:SetSize(116, 32)
-------- BACKGROUND ----
------------------------
Back = CreateFrame('Frame', nil, self)
Back:SetPoint('TOPRIGHT', self)
Back:SetPoint('TOPLEFT', self)
Back:SetFrameStrata('BACKGROUND')
Back:SetBackdrop(backdrop3)
Back:SetBackdropColor(0.05, 0.05, 0.05)
Back:SetBackdropBorderColor(.4,.4,.4)
Back:SetHeight(32)
-------- HEALTH ----
--------------------
-------- BAR ----
-----------------
self.Health = CreateFrame('StatusBar', nil, Back)
self.Health:SetBackdrop(statusback2)
self.Health:SetBackdropColor(0.7,0.7,0.7)
self.Health:SetFrameStrata('LOW')
self.Health:SetPoint('TOPRIGHT', self, -2, -2)
self.Health:SetPoint('TOPLEFT', self, 2, -2)
self.Health:SetStatusBarTexture(statusbar2)
self.Health:SetStatusBarColor(0.28,0.28,0.28)
self.Health.frequentUpdates = FreqUpdate
self.Health.Smooth = cSmooth
self.Health:SetHeight(23)
--------TEXT PERCENT ----
-------------------------
self.Health.Text = self.Health:CreateFontString(nil, 'OVERLAY')
self.Health.Text:SetFont(font, 15, 'THINOUTLINE')
self.Health.Text:SetShadowOffset(1, -1)
self.Health.Text.frequentUpdates = FreqUpdate
self:Tag(self.Health.Text,'[My_PerHP]|r')
self.Health.Text:SetJustifyH('CENTER')
self.Health.Text:SetPoint('RIGHT',self.Health, 'RIGHT', 0, 0)
-------- NAME ----
------------------
self.Info = self.Health:CreateFontString(nil, 'OVERLAY')
self.Info:SetShadowOffset(1, -1)
self.Info:SetAlpha(1)
self.Info:SetFont(fontn, 12, 'THINOUTLINE')
self:Tag(self.Info,'[raidcolor] [name]' )
self.Info:SetJustifyH('LEFT')
self.Info:SetPoint('TOPRIGHT',self.Health,'TOPRIGHT', -2, 7)
-------- POWER ----
-------------------
-------- BAR ----
-----------------
self.Power = CreateFrame('StatusBar', nil, self)
self.Power:SetFrameStrata('LOW')
self.Power:SetPoint('TOPRIGHT', self.Health, 'BOTTOMRIGHT', 0, -1)
self.Power:SetPoint('TOPLEFT', self.Health, 'BOTTOMLEFT', 0, -1)
self.Power:SetStatusBarTexture(statusbar2)
self.Power:SetStatusBarColor(0.28,0.28,0.28)
self.Power.frequentUpdates = FreqUpdate
self.Power.Smooth = cSmooth
self.Power:SetHeight(4)
self.Power.colorClass = true
powerback = self.Power:CreateTexture(nil,'BORDER')
powerback:SetAllPoints(self.Power)
powerback:SetTexture(statusbar2)
powerback:SetAlpha(0.54)
powerback.multiplier = 1
self.Power.bg = powerback
end
local boss = function(self, unit)
self:SetSize(130, 16)
------ BACKGROUND ---
---------------------
Back = CreateFrame('Frame', nil, self)
Back:SetPoint('TOPRIGHT', self)
Back:SetPoint('TOPLEFT', self)
Back:SetFrameStrata('BACKGROUND')
Back:SetBackdrop(backdrop3)
Back:SetBackdropColor(0.05, 0.05, 0.05)
Back:SetBackdropBorderColor(0.4, 0.4, 0.4)
Back:SetHeight(16)
---------- HEALTH -------
-------------------------
------ BAR ------
-----------------
self.Health = CreateFrame('StatusBar', nil, Back)
self.Health:SetBackdrop(statusback2)
self.Health:SetBackdropColor(0.7, 0.7, 0.7)
self.Health:SetFrameStrata('LOW')
self.Health:SetPoint('TOPLEFT', 2, -2)
self.Health:SetPoint('TOPRIGHT', -2, -2)
self.Health:SetPoint('BOTTOMLEFT', 2, 2)
self.Health:SetPoint('BOTTOMRIGHT', -2, 2)
self.Health:SetStatusBarTexture(statusbar2)
self.Health:SetStatusBarColor(0.28,0.28,0.28)
self.Health.frequentUpdates = FreqUpdate
self.Health.Smooth = cSmooth
self.Health:SetHeight(16)
self.Health.colorClass = false
--------TEXT PERCENT ----
-------------------------
self.Health.Text = self.Health:CreateFontString(nil, 'OVERLAY')
self.Health.Text:SetFont(fontn, 11, 'THINOUTLINE')
self.Health.Text:SetShadowOffset(1, -1)
self.Health.Text.frequentUpdates = FreqUpdate
self:Tag(self.Health.Text,'[My_PerHP]|r')
self.Health.Text:SetJustifyH('CENTER')
self.Health.Text:SetPoint('RIGHT',self, -10, 0)
--------- NAME -------
----------------------
self.Info = self.Health:CreateFontString(nil, 'OVERLAY')
self.Info:SetShadowOffset(1, -1)
self.Info:SetAlpha(1)
self.Info:SetFont(fontn, 10, 'THINOUTLINE')
self:Tag(self.Info,'[raidcolor] [name]' )
self.Info:SetJustifyH('LEFT')
self.Info:SetPoint('LEFT',self.Health,'LEFT', -1, 12)
end
local Raid = function(self, unit)
self:SetSize(62, 34)
-------- BACKGROUND ----
------------------------
Back = CreateFrame('Frame', nil, self)
Back:SetPoint('TOPRIGHT', self)
Back:SetPoint('TOPLEFT', self)
Back:SetFrameStrata('BACKGROUND')
Back:SetBackdrop(backdrop3)
Back:SetBackdropColor(0.05, 0.05, 0.05)
Back:SetBackdropBorderColor(.4,.4,.4)
Back:SetHeight(34)
-------- HEALTH ----
--------------------
-------- BAR ----
-----------------
self.Health = CreateFrame('StatusBar', nil, Back)
self.Health:SetBackdrop(statusback2)
self.Health:SetBackdropColor(0.7,0.7,0.7)
self.Health:SetFrameStrata('LOW')
self.Health:SetPoint('TOPRIGHT', self, -2, -2)
self.Health:SetPoint('TOPLEFT', self, 2, -2)
self.Health:SetStatusBarTexture(statusbar2)
self.Health:SetStatusBarColor(0.28,0.28,0.28)
self.Health.frequentUpdates = FreqUpdate
self.Health.Smooth = cSmooth
self.Health:SetHeight(25)
--------TEXT PERCENT ----
-------------------------
self.Health.Text = self.Health:CreateFontString(nil, 'OVERLAY')
self.Health.Text:SetFont(font, 15, 'THINOUTLINE')
self.Health.Text:SetShadowOffset(1, -1)
self.Health.Text.frequentUpdates = FreqUpdate
self:Tag(self.Health.Text,'[My_PerHP]|r')
self.Health.Text:SetJustifyH('CENTER')
self.Health.Text:SetPoint('RIGHT',self.Health, 'RIGHT', 0, -5)
-------- NAME ----
------------------
self.Info = self.Health:CreateFontString(nil, 'OVERLAY')
self.Info:SetShadowOffset(1, -1)
self.Info:SetAlpha(1)
self.Info:SetFont(fontn, 9, 'THINOUTLINE')
self:Tag(self.Info,'[raidcolor] [name]' )
self.Info:SetJustifyH('LEFT')
self.Info:SetPoint('TOPLEFT',self.Health,'TOPLEFT', -3, 1)
-------- POWER ----
-------------------
-------- BAR ----
-----------------
self.Power = CreateFrame('StatusBar', nil, self)
self.Power:SetFrameStrata('LOW')
self.Power:SetPoint('TOPRIGHT', self.Health, 'BOTTOMRIGHT', 0, -1)
self.Power:SetPoint('TOPLEFT', self.Health, 'BOTTOMLEFT', 0, -1)
self.Power:SetStatusBarTexture(statusbar2)
self.Power:SetStatusBarColor(0.28,0.28,0.28)
self.Power.frequentUpdates = FreqUpdate
self.Power.Smooth = cSmooth
self.Power:SetHeight(4)
self.Power.colorClass = true
powerback = self.Power:CreateTexture(nil,'BORDER')
powerback:SetAllPoints(self.Power)
powerback:SetTexture(statusbar2)
powerback:SetAlpha(0.54)
powerback.multiplier = 1
self.Power.bg = powerback
-----------
--RANGE----
-----------
self.Range = { insideAlpha = 1, outsideAlpha = .4 }
end
-----------------------
--/ SPECIFIC LAYOUT \--
-----------------------
local UnitSpecific = {
player = function(self, ...)
Shared(self, ...)
Player(self)
end,
party = function(self, ...)
Shared(self, ...)
Party(self)
end,
target = function(self, ...)
Shared(self, ...)
Target(self)
end,
targettarget = function(self, ...)
Shared(self, ...)
ToTarget(self)
end,
pet = function(self, ...)
Shared(self, ...)
Pet(self)
end,
focus = function(self, ...)
Shared(self, ...)
Focus(self)
end,
boss = function(self, ...)
Shared(self, ...)
Focus(self)
end,
Raid = function(self, ...)
Shared(self, ...)
Raid(self)
end,
}
---------------------------------------
-- register style(s) and spawn units --
---------------------------------------
oUF:RegisterStyle("Barbol", Shared)
oUF:RegisterStyle("Barbol - boss", boss)
oUF:RegisterStyle("Barbol - Raid", Raid)
for unit,layout in next, UnitSpecific do
-- Capitalize the unit name, so it looks better.
oUF:RegisterStyle('Barbol - ' .. unit:gsub("^%l", string.upper), layout)
end
local spawnHelper = function(self, unit, ...)
if(UnitSpecific[unit]) then
self:SetActiveStyle('Barbol - ' .. unit:gsub("^%l", string.upper))
local object = self:Spawn(unit)
object:SetPoint(...)
return object
else
self:SetActiveStyle'Barbol'
local object = self:Spawn(unit)
object:SetPoint(...)
return object
end
end
oUF:Factory(function(self)
spawnHelper(self, 'player', "CENTER", -280, -163)
spawnHelper(self, 'target', "CENTER", 280, -163)
spawnHelper(self, 'targettarget', "CENTER", 338, -127)
spawnHelper(self, 'pet', "CENTER", -458, -157)
spawnHelper(self, 'focus', "CENTER", -221, -247)
self:SetActiveStyle('Barbol - boss')
local boss1 = oUF:Spawn("boss1", "oUF_Boss1")
boss1:SetPoint("BOTTOMLEFT", UIParent, "RIGHT", -160, -10)
local boss2 = oUF:Spawn("boss2", "oUF_Boss2")
boss2:SetPoint("BOTTOMLEFT", UIParent, "RIGHT", -160, -50)
local boss3 = oUF:Spawn("boss3", "oUF_Boss3")
boss3:SetPoint("BOTTOMLEFT", UIParent, "RIGHT", -160, -90)
local boss4 = oUF:Spawn("boss4", "oUF_Boss4")
boss4:SetPoint("BOTTOMLEFT", UIParent, "RIGHT", -160, -130)
self:SetActiveStyle('Barbol - Party')
local party = self:SpawnHeader(
nil, nil, 'party,solo',
'showParty', true,
'showPlayer', false,
'showSolo', false,
'yOffset', -30
)
party:SetPoint("TOPLEFT", 20, -200)
CompactRaidFrameManager:UnregisterAllEvents()
CompactRaidFrameManager:Hide()
CompactRaidFrameContainer:UnregisterAllEvents()
CompactRaidFrameContainer:Hide()
self:SetActiveStyle('Barbol - Raid')
if BarbolRaid.smallraid then
local raid = oUF:SpawnHeader("oUF_Raid", nil, 'solo,party,raid10,raid25,raid40',
'showRaid', true,
'showPlayer', true,
'showSolo', false,
'showParty', false,
'xoffset', 0,
'yOffset', -3,
'groupFilter', "1,2,3,4,5,6,7,8",
'groupingOrder', "1,2,3,4,5,6,7,8",
'groupBy', "GROUP",
'maxColumns', 5,
'unitsPerColumn', 5,
'columnSpacing', 3,
'point', "TOP",
'columnAnchorPoint', "LEFT"
)
raid:SetPoint("CENTER", 0, -177)
elseif BarbolRaid.bigraid then
local raid = oUF:SpawnHeader("oUF_Raid", nil, 'solo,party,raid10,raid25,raid40',
'showRaid', true,
'showPlayer', true,
'showSolo', false,
'showParty', false,
'xoffset', 0,
'yOffset', -3,
'groupFilter', "1,2,3,4,5,6,7,8",
'groupingOrder', "1,2,3,4,5,6,7,8",
'groupBy', "GROUP",
'maxColumns', 8,
'unitsPerColumn', 5,
'columnSpacing', 3,
'point', "TOP",
'columnAnchorPoint', "RIGHT"
)
raid:SetPoint("LEFT", 16, 40)
else
local raid = oUF:SpawnHeader("oUF_Raid", nil, 'solo,party,raid10,raid25,raid40',
'showRaid', true,
'showPlayer', true,
'showSolo', false,
'showParty', false,
'xoffset', 0,
'yOffset', -3,
'groupFilter', "1,2,3,4,5,6,7,8",
'groupingOrder', "1,2,3,4,5,6,7,8",
'groupBy', "GROUP",
'maxColumns', 5,
'unitsPerColumn', 5,
'columnSpacing', 3,
'point', "TOP",
'columnAnchorPoint', "LEFT"
)
raid:SetPoint("CENTER", 0, -177)
end
end)
---- functions for raid ----
loader = CreateFrame("Frame")
loader:RegisterEvent("PLAYER_ENTERING_WORLD")
loader:SetScript("OnEvent", function(self, event)
self:UnregisterEvent("PLAYER_ENTERING_WORLD")
if (BarbolRaid == nil) then BarbolRaid = {} end
if not BarbolRaid.smallraid then
BarbolRaid.smallraid = true
elseif not BarbolRaid.bigraid then
BarbolRaid.smallraid = true
end
end)
function raid25()
BarbolRaid = {}
BarbolRaid.smallraid = true
end
function raid40()
BarbolRaid = {}
BarbolRaid.bigraid = true
end
StaticPopupDialogs["RAID_SMALL"] = {
text = "Do you want to load raid-25 layout?",
button1 = YES,
button2 = NO,
OnAccept = function(self)
if (BarbolRaid == nil) then BarbolRaid = {} end;
raid25();
ReloadUI();
end,
timeout = 0,
whileDead = 1,
hideOnEscape = 1
}
StaticPopupDialogs["RAID_BIG"] = {
text = "Do you want to raid-40 layout",
button1 = YES,
button2 = NO,
OnAccept = function(self)
if (BarbolRaid == nil) then BarbolRaid = {} end;
raid40();
ReloadUI();
end,
timeout = 0,
whileDead = 1,
hideOnEscape = 1
}
SLASH_RAIDSMALL1 = "/Barbol25"
SlashCmdList["RAIDSMALL"] = function() StaticPopup_Show("RAID_SMALL") end
SLASH_RAIDBIG1 = "/Barbol40"
SlashCmdList["RAIDBIG"] = function() StaticPopup_Show("RAID_BIG") end