Commit 90643a09 authored by Blazeflack's avatar Blazeflack

Added 6 new power tags.

power:percent:hidezero
power:current:hidezero
power:current-percent:hidezero
power:percent:hidefull:hidezero
power:current:hidefull:hidezero
power:current-percent:hidefull:hidezero

This closes #2
parent c7fea3af
......@@ -323,6 +323,99 @@ ElvUF.Tags.Methods["power:current-percent:hidefull"] = function(unit)
return String
end
ElvUF.Tags.Events["power:percent:hidezero"] = "UNIT_DISPLAYPOWER UNIT_POWER_FREQUENT UNIT_MAXPOWER"
ElvUF.Tags.Methods["power:percent:hidezero"] = function(unit)
local pType = UnitPowerType(unit)
local min, max = UnitPower(unit, pType), UnitPowerMax(unit, pType)
local String
if min <= 0 then
String = ""
else
String = GetFormattedText(min, max, "PERCENT", true)
end
return String
end
ElvUF.Tags.Events["power:current:hidezero"] = "UNIT_DISPLAYPOWER UNIT_POWER_FREQUENT UNIT_MAXPOWER"
ElvUF.Tags.Methods["power:current:hidezero"] = function(unit)
local pType = UnitPowerType(unit)
local min, max = UnitPower(unit, pType), UnitPowerMax(unit, pType)
local String
if min <= 0 then
String = ""
else
String = GetFormattedText(min, max, "CURRENT", true)
end
return String
end
ElvUF.Tags.Events["power:current-percent:hidezero"] = "UNIT_DISPLAYPOWER UNIT_POWER_FREQUENT UNIT_MAXPOWER"
ElvUF.Tags.Methods["power:current-percent:hidezero"] = function(unit)
local pType = UnitPowerType(unit)
local min, max = UnitPower(unit, pType), UnitPowerMax(unit, pType)
local String
if min <= 0 then
String = ""
else
String = GetFormattedText(min, max, "CURRENT_PERCENT", true)
end
return String
end
ElvUF.Tags.Events["power:percent:hidefull:hidezero"] = "UNIT_DISPLAYPOWER UNIT_POWER_FREQUENT UNIT_MAXPOWER"
ElvUF.Tags.Methods["power:percent:hidefull:hidezero"] = 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) then
String = ""
else
String = GetFormattedText(min, max, "PERCENT", true)
end
return String
end
ElvUF.Tags.Events["power:current:hidefull:hidezero"] = "UNIT_DISPLAYPOWER UNIT_POWER_FREQUENT UNIT_MAXPOWER"
ElvUF.Tags.Methods["power:current:hidefull:hidezero"] = 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) then
String = ""
else
String = GetFormattedText(min, max, "CURRENT", true)
end
return String
end
ElvUF.Tags.Events["power:current-percent:hidefull:hidezero"] = "UNIT_DISPLAYPOWER UNIT_POWER_FREQUENT UNIT_MAXPOWER"
ElvUF.Tags.Methods["power:current-percent:hidefull:hidezero"] = 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) then
String = ""
else
String = GetFormattedText(min, max, "CURRENT_PERCENT", true)
end
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)
......
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