Skip to content

Commit

Permalink
Add classification to nameplates
Browse files Browse the repository at this point in the history
  • Loading branch information
greven committed Nov 26, 2020
1 parent 46ba436 commit 9bb3456
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
9 changes: 9 additions & 0 deletions functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,15 @@ local function AdditionalPowerPostUpdate(self, cur, max)
else
self:Show()
end

-- Hide if dead
local isPlayerDead = UnitIsDead("player") or UnitIsGhost(unit)
print(isPlayerDead)
if isPlayerDead then
self:Hide()
else
self:Show()
end
end

function lum:CreateAdditionalPower(self)
Expand Down
15 changes: 10 additions & 5 deletions units/nameplates.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ local function OnTargetChanged(self)
end
end

local function AddTargetIndicators(self)
local function CreateTargetIndicators(self)
local selectedColor = self.cfg.selectedColor
local glowColor = self.cfg.glowColor

Expand Down Expand Up @@ -149,10 +149,14 @@ local PostUpdatePlates = function(self, event, unit)
OnTargetChanged(self)
end

if not self.isPlayer then
lum:CreateNameString(self, font, cfg.fontsize - 5, "THINOUTLINE", 0, 4,
"CENTER", self.cfg.width - 4)
lum:CreateNameString(self, font, cfg.fontsize - 5, "THINOUTLINE", 0, 4,
"CENTER", self.cfg.width - 4)

if self.isPlayer then
self:Tag(self.Name, "[lum:levelplus] [lum:name]")
else
self:Tag(self.Name,
"[lum:classificationshort] [lum:levelplus] [lum:name]")
end
end

Expand Down Expand Up @@ -192,6 +196,7 @@ local function CreateNameplate(self, unit)

local health = lum:CreateHealthBar(self, "nameplate")
health:SetAllPoints()

health.percent = api:CreateFontstring(self.Health, font, cfg.fontsize - 4,
"THINOUTLINE", "BACKGROUND")
health.percent:SetPoint("LEFT", self.Health, "RIGHT", 4, 0)
Expand All @@ -208,7 +213,7 @@ local function CreateNameplate(self, unit)
lum:CreateCastbar(self)
CreateNameplateClassPower(self)
CreateRaidIcons(self)
AddTargetIndicators(self)
CreateTargetIndicators(self)

-- Auras
local debuffs = lum:SetDebuffAuras(self, frame, 6, 1, 16, 4, "BOTTOMLEFT",
Expand Down

0 comments on commit 9bb3456

Please sign in to comment.