GridStatusHealth - Absolute Health Hax
saedo — Wed, 11/25/2009 - 13:33
A while ago, I wondered if seeing absolute health values on Grid would help deal with P3 of Penetrating Cold. Like, just have to watch a number, keep those with it above 6K hp only. A deficit / percentage varies from person to person making it more ambigious to how much they need.
Attached is a bit of a hax to one of the Grid files to show absolute values. Replace this file in your Grid folder. And under configuration, it is "Unit Health" status text that you want turned on to whereever you want (i.e. Center Text 1 or 2), and set priorities to etc.
For the exact changes, all I did was mostly copy what it already did and tweaked it a bit...
Added new function:
function GridStatusHealth:FormatHealthText2(cur, max)
local healthText
local deficit = cur
if deficit > 999 then
healthText = string.format("%.1fk", deficit/1000.0)
else
healthText = string.format("%d", deficit)
end
return healthText
end
This just copies the another function, except I change the deficit text to current hp, and removed the minus sign from the formating.
In function GridStatusHealth:UpdateUnit
Added another variable: local healthText2
Added another line below original (the non 2 version) to get it called like the other: healthText2 = self:FormatHealthText2(cur,max)
Changed this line:
self.core:SendStatusGained(guid, "unit_health",
priority,
(ignoreRange ~= true and settings.range and 40),
(settings.useClassColors and
self.core:UnitColor(guid) or
settings.color),
healthText2,
cur, max,
settings.icon)
Only the healthText2 part, was healthText normally of course. Just gets it to print out the new variable.
| Attachment | Size |
|---|---|
| GridStatusHealth.lua | 9.8 KB |


Bump for those that haven't
saedo — Thu, 11/26/2009 - 11:35Bump for those that haven't seen.
Bump! Think any of this is
saedo — Wed, 11/25/2009 - 13:35Bump! Think any of this is useful?