Commit aec0ce1c authored by Blazeflack's avatar Blazeflack

Added 3 new tags

health:percent:hidefull:hidezero
health:current:hidefull:hidezero
health:current-percent:hidefull:hidezero
parent cc14a8c5
......@@ -119,6 +119,21 @@ ElvUF.Tags.Methods["health:percent:hidefull"] = function(unit)
return String
end
ElvUF.Tags.Events["health:percent:hidefull:hidezero"] = "UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION"
ElvUF.Tags.Methods["health:percent:hidefull:hidezero"] = function(unit)
local min, max = UnitHealth(unit), UnitHealthMax(unit)
local deficit = max - min
local String
if (deficit <= 0) or (min == 0) then
String = ""
else
String = GetFormattedText(min, max, "PERCENT", true)
end
return String
end
ElvUF.Tags.Events["health:current:hidefull"] = "UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH"
ElvUF.Tags.Methods["health:current:hidefull"] = function(unit)
local min, max = UnitHealth(unit), UnitHealthMax(unit)
......@@ -134,6 +149,21 @@ ElvUF.Tags.Methods["health:current:hidefull"] = function(unit)
return String
end
ElvUF.Tags.Events["health:current:hidefull:hidezero"] = "UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH"
ElvUF.Tags.Methods["health:current:hidefull:hidezero"] = function(unit)
local min, max = UnitHealth(unit), UnitHealthMax(unit)
local deficit = max - min
local String
if (deficit <= 0) or (min == 0) then
String = ""
else
String = GetFormattedText(min, max, "CURRENT", true)
end
return String
end
ElvUF.Tags.Events["health:current-percent:hidefull"] = "UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH"
ElvUF.Tags.Methods["health:current-percent:hidefull"] = function(unit)
local min, max = UnitHealth(unit), UnitHealthMax(unit)
......@@ -149,6 +179,21 @@ ElvUF.Tags.Methods["health:current-percent:hidefull"] = function(unit)
return String
end
ElvUF.Tags.Events["health:current-percent:hidefull:hidezero"] = "UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH"
ElvUF.Tags.Methods["health:current-percent:hidefull:hidezero"] = function(unit)
local min, max = UnitHealth(unit), UnitHealthMax(unit)
local deficit = max - min
local String
if (deficit <= 0) or (min == 0) then
String = ""
else
String = GetFormattedText(min, max, "CURRENT_PERCENT", true)
end
return String
end
ElvUF.Tags.Events["power:percent:hidefull"] = "UNIT_DISPLAYPOWER UNIT_POWER_FREQUENT UNIT_MAXPOWER"
ElvUF.Tags.Methods["power:percent:hidefull"] = function(unit)
local pType = UnitPowerType(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