Below the lua text.
---------- Post added 2011-03-27 at 04:22 PM ----------
I just checked, and apparently there is no "self" reference available in the PB4 lua text code. However there is a dedicated IsMouseOver() function for this purpose.
Code:
local s = Status(unit)
if s then return s end
if IsMouseOver() then
return "%s/%s",Short(HP(unit),true),Short(MaxHP(unit),true)
else
return "%s%%",Percent(HP(unit),MaxHP(unit))
end
And according to the LuaText doc, it will even auto-update on mouse status update if the code contains an IsMouseOver call. Awesome!