yj589794, Mischback and Rostok have already helped you quite a lot. I'm honestly amazed that yj589794 and Mischback have lasted this long. To me the thread has pretty much followed the following pattern:
1. That didn't help, I get an error.
2. Can you post the error?
3. <error />; how do I fix?
4. <solution>
5. GOTO 1;
Not having the most recent version of the code doesn't help the case much either, as all error messages get further and further offset from their reported line numbers.
If you want to fix your layout for 1.4 I'd suggest that you follow at least some of Mischback suggestions. Reading and attempting to understand some of the oUF element update could would be a tremendous help for your understanding. It generally is pretty straight forward.
Saying that neither the Lua manual, nor the WoW API has anything to do with oUF is also.. quite wrong. I can understand your discomfort with the Lua manual because it's written in a very terse from, and mainly aimed at people with prior knowledge about programming. The WoW API is however highly related, since it's pretty much what oUF works as a wrapper on top of.
There isn't too much about "health/power text" on the pages because it's simply values returned from API calls. You call UnitPower(unit) to fetch the current power value and UnitPowerMax(unit) to fetch the maximum. This then just get formatted and displayed into a fontstring. There isn't really much more to it than that.
The easiest way to do text is just to abuse tags, as it disconnects you from much of the update handling:
Lua Code:
local siValue = function(val)
if(val >= 1e6) then
return ('%.1f'):format(val / 1e6):gsub('%.', 'm')
elseif(val >= 1e4) then
return ("%.1f"):format(val / 1e3):gsub('%.', 'k')
else
return val
end
end
oUF.Tags['lily:health'] = function(unit)
if(not UnitIsConnected(unit) or UnitIsDead(unit) or UnitIsGhost(unit)) then return end
local min, max = UnitHealth(unit), UnitHealthMax(unit)
if(not UnitIsFriend('player', unit)) then
return siValue(min)
elseif(min ~= 0 and min ~= max) then
return '-' .. siValue(max - min)
else
return max
end
end
oUF.TagEvents['lily:health'] = oUF.TagEvents.missinghp
All that being said. oUF puts the bar damn high. It was never meant as a "easy" and "straightforward" solution to making unit frames in WoW. It was written to I didn't have to copy/paste code between my various layout experiments.
If you don't want to invest time and brain power into writing/updating your own layout, then I suggest you change to another
unit frame add-on or hire someone who will.
I'm trying to not be an ass about this, but you aren't really in the group of intended users (which in all honestly consists of one person; me).