Originally Posted by Balkeep
Is there any actual way to hide 0 numbers on text fields when im using tag system?
Im creating fonstring like this
Code:
self.Health.mvalue = self.Health:CreateFontString(nil, "OVERLAY")
self.Health.mvalue:SetFont(font, fontS)
self:Tag(self.Health.mvalue, '-[missinghp]')
self.Health.mvalue:SetPoint("TOPRIGHT", self.Health, "TOPRIGHT", -3, -3)
works just fine, but is there any way to hide value of the field self.Health.mvalue if its == 0 ?
|
yes but you would have to make a custom tag
Code:
oUF.Tags["[custom]"] = function(unit)
local m, n = UnitHealthMax(unit), UnitHealth(unit)
return n == 0 and "" or string.format("-%s", m - n)
end
oUF.TagEvents["[custom]"] = "UNIT_HEALTH UNIT_MAXHEALTH"