fix ArenaX option being overwritten by unit name
This commit is contained in:
parent
df58544f6e
commit
5e42a9b51f
@ -98,8 +98,9 @@ function Healthbar.OnEvent(self, event, unit)
|
|||||||
if event == "UNIT_HEALTH" then
|
if event == "UNIT_HEALTH" then
|
||||||
local health = UnitHealth(unit)
|
local health = UnitHealth(unit)
|
||||||
local healthMax = UnitHealthMax(unit)
|
local healthMax = UnitHealthMax(unit)
|
||||||
Healthbar:SetHealthText(self, health, healthMax)
|
self.hp:SetMinMaxValues(0, healthMax)
|
||||||
self.hp:SetValue(UnitHealth(unit))
|
self.hp:SetValue(UnitHealth(unit))
|
||||||
|
Healthbar:SetHealthText(self, health, healthMax)
|
||||||
elseif event == "UNIT_MAXHEALTH" then
|
elseif event == "UNIT_MAXHEALTH" then
|
||||||
local health = UnitHealth(unit)
|
local health = UnitHealth(unit)
|
||||||
local healthMax = UnitHealthMax(unit)
|
local healthMax = UnitHealthMax(unit)
|
||||||
@ -109,7 +110,9 @@ function Healthbar.OnEvent(self, event, unit)
|
|||||||
elseif event == "UNIT_NAME_UPDATE" then
|
elseif event == "UNIT_NAME_UPDATE" then
|
||||||
local name = UnitName(unit)
|
local name = UnitName(unit)
|
||||||
Gladdy.buttons[unit].name = name
|
Gladdy.buttons[unit].name = name
|
||||||
self.nameText:SetText(name)
|
if Gladdy.db.healthName and not Gladdy.db.healthNameToArenaId then
|
||||||
|
self.nameText:SetText(name)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
if not Gladdy.buttons[unit].class then
|
if not Gladdy.buttons[unit].class then
|
||||||
Gladdy:SpotEnemy(unit, true)
|
Gladdy:SpotEnemy(unit, true)
|
||||||
|
Loading…
Reference in New Issue
Block a user