View Single Post
07-14-14, 06:07 AM   #17
Kygo
A Theradrim Guardian
 
Kygo's Avatar
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 64
Originally Posted by Phanx View Post
oUF uses its own tag system, unrelated to the tag systems used by SUF or other addons. It doesn't provide any "short value" tags by default, but it's easy to add your own. Put this somewhere in your file, outside of your spawn/style function, but before you call oUF:Spawn to create any frames:

Code:
oUF.Tags.Events["shorthp"] = "UNIT_HEALTH"
oUF.Tags.Methods["shorthp"] = function(unit)
	if not UnitIsDeadOrGhost(unit)
		local hp = UnitHealth(unit)
		return AbbreviateLargeNumbers(hp)
	end
end
You can easily add similar tags for mana or any other long values you want to abbreviate.



Your code formatting leaves a lot to be desired. Pick either tabs or a specific number of spaces to use for indentation, and use it consistently. I'd recommend tabs, unless you have an editor that helps you manage using spaces for indentation. Either way, it'll be a lot easier to read your code if it's consistently indented.

I cleaned it up for you, and fixed the combo points (you were attaching the CPoints key to the health bar, instead of the frame, so oUF didn't see it as an element at all) and fixed all your hardcoded sizes and position offsets. There are some comments in the code to explain some of the changes.

http://pastebin.com/Z6mbsVpc
Neat! I did not know that !
CPoints is working now! Did swap out "BACKGROUND" for "OVERLAY" otherwise the CPoints was behind everything ^^

-----

Did add the short tag code for health and for power

-----
The reason why I have split the portrait code up into two blocks, is because "player" and "target" have diffrent anchors
  Reply With Quote