Commit 37514334 authored by Blazeflack's avatar Blazeflack

Added 9 new tags

health:percent:hidedead
health:current:hidedead
health:current-percent:hidedead

power:percent:hidedead
power:current:hidedead
power:current-percent:hidedead

power:percent:hidefull:hidedead
power:current:hidefull:hidedead
power:current-percent:hidefull:hidedead
parent 7001a4df
......@@ -14,6 +14,8 @@ local format = string.format
local IsInGroup = IsInGroup
local IsInRaid = IsInRaid
local UnitIsUnit = UnitIsUnit
local UnitIsGhost = UnitIsGhost
local UnitIsDead = UnitIsDead
local GetNumGroupMembers = GetNumGroupMembers
local UnitHealth = UnitHealth
local UnitHealthMax = UnitHealthMax
......@@ -149,6 +151,51 @@ ElvUF.Tags.Methods["health:current-percent:hidefull"] = function(unit)
return String
end
ElvUF.Tags.Events["health:percent:hidedead"] = "UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION"
ElvUF.Tags.Methods["health:percent:hidedead"] = function(unit)
local min, max = UnitHealth(unit), UnitHealthMax(unit)
local deficit = max - min
local String
if (min == 0) or (UnitIsGhost(unit)) then
String = ""
else
String = GetFormattedText(min, max, "PERCENT", true)
end
return String
end
ElvUF.Tags.Events["health:current:hidedead"] = "UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH"
ElvUF.Tags.Methods["health:current:hidedead"] = function(unit)
local min, max = UnitHealth(unit), UnitHealthMax(unit)
local deficit = max - min
local String
if (min == 0) or (UnitIsGhost(unit)) then
String = ""
else
String = GetFormattedText(min, max, "CURRENT", true)
end
return String
end
ElvUF.Tags.Events["health:current-percent:hidedead"] = "UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH"
ElvUF.Tags.Methods["health:current-percent:hidedead"] = function(unit)
local min, max = UnitHealth(unit), UnitHealthMax(unit)
local deficit = max - min
local String
if (min == 0) or (UnitIsGhost(unit)) then
String = ""
else
String = GetFormattedText(min, max, "CURRENT_PERCENT", true)
end
return String
end
ElvUF.Tags.Events["health:percent:hidefull:hidedead"] = "UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION"
ElvUF.Tags.Methods["health:percent:hidefull:hidedead"] = function(unit)
local min, max = UnitHealth(unit), UnitHealthMax(unit)
......@@ -242,6 +289,102 @@ ElvUF.Tags.Methods["power:current-percent:hidefull"] = function(unit)
return String
end
ElvUF.Tags.Events["power:percent:hidedead"] = "UNIT_DISPLAYPOWER UNIT_POWER_FREQUENT UNIT_MAXPOWER UNIT_HEALTH"
ElvUF.Tags.Methods["power:percent:hidedead"] = function(unit)
local pType = UnitPowerType(unit)
local min, max = UnitPower(unit, pType), UnitPowerMax(unit, pType)
local deficit = max - min
local String
if (min == 0) or (UnitIsGhost(unit) or UnitIsDead(unit)) then
String = ""
else
String = GetFormattedText(min, max, "PERCENT", true)
end
return String
end
ElvUF.Tags.Events["power:current:hidedead"] = "UNIT_DISPLAYPOWER UNIT_POWER_FREQUENT UNIT_MAXPOWER UNIT_HEALTH"
ElvUF.Tags.Methods["power:current:hidedead"] = function(unit)
local pType = UnitPowerType(unit)
local min, max = UnitPower(unit, pType), UnitPowerMax(unit, pType)
local deficit = max - min
local String
if (min == 0) or (UnitIsGhost(unit) or UnitIsDead(unit)) then
String = ""
else
String = GetFormattedText(min, max, "CURRENT", true)
end
return String
end
ElvUF.Tags.Events["power:current-percent:hidedead"] = "UNIT_DISPLAYPOWER UNIT_POWER_FREQUENT UNIT_MAXPOWER UNIT_HEALTH"
ElvUF.Tags.Methods["power:current-percent:hidedead"] = function(unit)
local pType = UnitPowerType(unit)
local min, max = UnitPower(unit, pType), UnitPowerMax(unit, pType)
local deficit = max - min
local String
if (min == 0) or (UnitIsGhost(unit) or UnitIsDead(unit)) then
String = ""
else
String = GetFormattedText(min, max, "CURRENT_PERCENT", true)
end
return String
end
ElvUF.Tags.Events["power:percent:hidefull:hidedead"] = "UNIT_DISPLAYPOWER UNIT_POWER_FREQUENT UNIT_MAXPOWER UNIT_HEALTH"
ElvUF.Tags.Methods["power:percent:hidefull:hidedead"] = function(unit)
local pType = UnitPowerType(unit)
local min, max = UnitPower(unit, pType), UnitPowerMax(unit, pType)
local deficit = max - min
local String
if (deficit <= 0) or (min == 0) or (UnitIsGhost(unit) or UnitIsDead(unit)) then
String = ""
else
String = GetFormattedText(min, max, "PERCENT", true)
end
return String
end
ElvUF.Tags.Events["power:current:hidefull:hidedead"] = "UNIT_DISPLAYPOWER UNIT_POWER_FREQUENT UNIT_MAXPOWER UNIT_HEALTH"
ElvUF.Tags.Methods["power:current:hidefull:hidedead"] = function(unit)
local pType = UnitPowerType(unit)
local min, max = UnitPower(unit, pType), UnitPowerMax(unit, pType)
local deficit = max - min
local String
if (deficit <= 0) or (min == 0) or (UnitIsGhost(unit) or UnitIsDead(unit)) then
String = ""
else
String = GetFormattedText(min, max, "CURRENT", true)
end
return String
end
ElvUF.Tags.Events["power:current-percent:hidefull:hidedead"] = "UNIT_DISPLAYPOWER UNIT_POWER_FREQUENT UNIT_MAXPOWER UNIT_HEALTH"
ElvUF.Tags.Methods["power:current-percent:hidefull:hidedead"] = function(unit)
local pType = UnitPowerType(unit)
local min, max = UnitPower(unit, pType), UnitPowerMax(unit, pType)
local deficit = max - min
local String
if (deficit <= 0) or (min == 0) or (UnitIsGhost(unit) or UnitIsDead(unit)) then
String = ""
else
String = GetFormattedText(min, max, "CURRENT_PERCENT", true)
end
return String
end
ElvUF.Tags.Events["deficit:name:colors"] = "UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_NAME_UPDATE"
ElvUF.Tags.Methods["deficit:name:colors"] = function(unit)
local missinghp = _TAGS['missinghp'](unit)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment