LS: UI

LS: UI

146k Downloads

Better display of absorbs

p5hema2 opened this issue ยท 3 comments

commented

Numbers over 1.000.000 Absorb are not displayed in a meaningful way.

Can you please Change the Numberformating functions to the code below.

So we can see if the absorbshields are 1,0001 mil or 1,99999 mil.

Former:
1.000.000 Absorb displayed as 1M
1.999.999 Absorb displayed as 1M

Later:
1.000.000 Absorb displayed as 1.0M
1.999.999 Absorb displayed as 1.9M

modules\unitframes\elements\tags.lua:74ff

oUF.Tags.Methods["ls:healabsorb"] = function(unit)
	local healAbsorb = UnitGetTotalHealAbsorbs("player") or 0
	local color = E:RGBToHEX(M.colors.healprediction.healabsorb)

	if healAbsorb > 0 and healAbsorb < 1000000 then
		return "|cff"..color.."+|r"..E:NumberFormat(healAbsorb)
	elseif healAbsorb >= 1000000 then
		return "|cff"..color.."-|r"..E:NumberFormat(healAbsorb,1)
	else
		return " "
	end
end

oUF.Tags.Events["ls:healabsorb"] = "UNIT_HEAL_ABSORB_AMOUNT_CHANGED"

oUF.Tags.Methods["ls:damageabsorb"] = function(unit)
	local damageAbsorb = UnitGetTotalAbsorbs(unit) or 0
	local color = E:RGBToHEX(M.colors.healprediction.damageabsorb)

	if damageAbsorb > 0 and damageAbsorb < 1000000 then
		return "|cff"..color.."+|r"..E:NumberFormat(damageAbsorb)
	elseif damageAbsorb >= 1000000 then
		return "|cff"..color.."+|r"..E:NumberFormat(damageAbsorb,1)
	else
		return " "
	end
end

oUF.Tags.Events["ls:damageabsorb"] = "UNIT_ABSORB_AMOUNT_CHANGED"
commented

Hm.. Makes sense o_O

I'll take a look at all number-ish tags, there might be something else that needs tweaking :D

commented

Done, I'll release an update within a week, need to fix/finish some other things first :D

And thank you!

commented

ty