local function SetupNameplates(self, unit)
local Scale = UIParent:GetEffectiveScale()
local Nameplates = C_NamePlate.GetNamePlateForUnit(unit)
local NameplatesPanel = CreateFrame("Frame", "ANameplatesPanel", self)
NameplatesPanel:SetWidth(unpack(C.UnitFrames.NameplateWidth))
NameplatesPanel:SetHeight(24)
NameplatesPanel:SetPoint("CENTER", self, 0, -2)
NameplatesPanel:SetFrameLevel(self:GetFrameLevel() + 2)
A.CreateBorder(NameplatesPanel)
self:SetScale(Scale)
self:SetWidth(unpack(C.UnitFrames.NameplateWidth))
self:SetHeight(unpack(C.UnitFrames.NameplateHeight))
self:SetPoint("CENTER", Nameplates, 0, -6)
local Health = CreateFrame("StatusBar", nil, self)
Health:SetStatusBarTexture("Interface\\Buttons\\WHITE8x8")
Health:SetAllPoints(self)
if C.UnitFrames.CustomHealtBarColor == true then
Health:SetStatusBarColor(unpack(C.UnitFrames.HealthBarColor))
Health.colorClass = false
Health.colorReaction = false
else
Health.colorClass = true
Health.colorReaction = true
end
Health.frequentUpdates = true
if C.UnitFrames.Smooth then
Health.Smooth = true
end
Health.PostUpdate = UpdateHealth
local HealthBG = Health:CreateTexture(nil, "BORDER")
HealthBG:SetTexture("Interface\\Buttons\\WHITE8x8")
HealthBG:SetAllPoints(Health)
HealthBG:SetVertexColor(unpack(C.UnitFrames.HealthBackdropColor))
local Power = CreateFrame("StatusBar", nil, self)
Power:SetStatusBarTexture("Interface\\Buttons\\WHITE8x8")
Power:SetHeight(4)
Power:SetPoint("TOPLEFT", Health, "BOTTOMLEFT")
Power:SetPoint("TOPRIGHT", Health, "BOTTOMRIGHT")
Power.frequentUpdates = true
if C.UnitFrames.Smooth then
Power.Smooth = true
end
local PowerBG = Power:CreateTexture(nil, "BORDER")
PowerBG:SetAllPoints(Power)
PowerBG:SetTexture("Interface\\Buttons\\WHITE8x8")
if C.UnitFrames.CustomPowerColor == true then
Power:SetStatusBarColor(unpack(C.UnitFrames.PowerBarColor))
Power.colorClass = false
Power.colorReaction = false
PowerBG:SetVertexColor(unpack(C.UnitFrames.PowerBarColorBG))
else
Power.colorClass = true
Power.colorReaction = true
PowerBG.multiplier = .5
end
local Debuffs = CreateFrame("Frame", nil, self)
Debuffs:SetSize(270, 270)
Debuffs.size = 28, 24
Debuffs.spacing = 4
Debuffs["growth-x"] = "RIGHT"
Debuffs.initialAnchor = "LEFT"
Debuffs.PostCreateIcon = CreateAura
Debuffs.PostUpdateIcon = UpdateAura
Debuffs:SetPoint("BOTTOMLEFT", self, "TOPLEFT", 0, -98)
Debuffs.num = 5
Debuffs.onlyShowPlayer = true
if C.UnitFrames.CastBarMod then
local Castbar = CreateFrame("StatusBar", nil, self)
Castbar:SetStatusBarTexture(C.Media.Texture)
Castbar:SetStatusBarColor(unpack(C.UnitFrames.CastBarColor))
Castbar:SetPoint("TOPLEFT", Health, "BOTTOMLEFT", 0, -8)
Castbar:SetPoint("BOTTOMRIGHT", Health, "BOTTOMRIGHT", 0, -28)
A.Skin(Castbar)
local CastbarIcon = Castbar:CreateTexture(nil, "ARTWORK")
CastbarIcon:SetSize(28, 28)
CastbarIcon:SetTexCoord(unpack(A.TexCoords))
CastbarIcon:SetPoint("LEFT", -34, 12)
local ACastBarIconOverlayNamePlate = CreateFrame("Frame", nil, Castbar)
ACastBarIconOverlayNamePlate:SetAllPoints(CastbarIcon)
A.CreateBorder(ACastBarIconOverlayNamePlate, true, 28, 28)
local CastbarTime = Castbar:CreateFontString(nil, "OVERLAY")
CastbarTime:SetFont(C.Media.Font, 12, "THINOUTLINE")
CastbarTime:SetShadowOffset(1, -1)
CastbarTime:SetShadowColor(0,0,0)
CastbarTime:SetPoint("RIGHT", Castbar, -4, 0)
CastbarTime:SetJustifyH("RIGHT")
local CastbarText = Castbar:CreateFontString(nil, "OVERLAY")
CastbarText:SetFont(C.Media.Font, 12, "THINOUTLINE")
CastbarText:SetShadowOffset(1, -1)
CastbarText:SetShadowColor(0,0,0)
CastbarText:SetPoint("LEFT", Castbar, 4, 0)
CastbarText:SetPoint("RIGHT", CastbarTime, "LEFT")
CastbarText:SetJustifyH("LEFT")
self.Castbar = Castbar
self.Castbar.Icon = CastbarIcon
self.Castbar.Time = CastbarTime
self.Castbar.Text = CastbarText
Castbar.CustomDelayText = UpdateCustomDelayText
Castbar.CustomTimeText = UpdateCustomTimeText
Castbar.PostChannelStart = UpdateInterruptColor
Castbar.PostCastStart = UpdateInterruptColor
end
local InvisFrame = CreateFrame("Frame", nil, self)
InvisFrame:SetFrameLevel(Health:GetFrameLevel() + 10)
InvisFrame:SetAllPoints()
local Name = self:CreateFontString(nil, "OVERLAY")
Name:SetPoint("TOP", 0, 18)
Name:SetFont(C.Media.Font, 13, "THINOUTLINE")
Name:SetShadowOffset(1, -1)
Name:SetShadowColor(0,0,0)
local HealthText = InvisFrame:CreateFontString(nil, "OVERLAY")
HealthText:SetPoint("LEFT", Health, 4.5, 0.5)
HealthText:SetFont(C.Media.Font2, 12, "THINOUTLINE")
HealthText:SetShadowOffset(1, -1)
HealthText:SetShadowColor(0,0,0)
local HealthPerText = InvisFrame:CreateFontString(nil, "OVERLAY")
HealthPerText:SetPoint("RIGHT", Health, -2, 0.5)
HealthPerText:SetFont(C.Media.Font2, 12, "THINOUTLINE")
HealthPerText:SetShadowOffset(1, -1)
HealthPerText:SetShadowColor(0,0,0)
local RaidIcon = InvisFrame:CreateTexture(nil, "OVERLAY", 7)
RaidIcon:SetSize(28, 28)
RaidIcon:SetPoint("CENTER", Health, "TOP")
--table.insert(self.__elements, UpdateThreatNameplate)
--self:RegisterEvent("PLAYER_TARGET_CHANGED", UpdateThreatNameplate)
--self:RegisterEvent("UNIT_THREAT_LIST_UPDATE", UpdateThreatNameplate)
--self:RegisterEvent("UNIT_THREAT_SITUATION_UPDATE", UpdateThreatNameplate)
-- Register with oUF
self:Tag(Name, "[raidcolor][Aftermathh:Name]")
self:Tag(HealthText, "|cff559655[Aftermathh:Health]")
self:Tag(HealthPerText, "|cff559655[perhp]%")
self.Health = Health
self.Health.bg = HealthBG
self.Power = Power
self.Power.bg = PowerBG
self.Debuffs = Debuffs
self.RaidIcon = RaidIcon
end
oUF:RegisterStyle("AftermathhNameplate", SetupNameplates)
oUF:SpawnNamePlates("AftermathhNameplate", "AftermathhNameplate")