View Single Post
09-07-10, 09:40 AM   #6
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 314
OK, you code is using custom update routines so, unless you want to rewrite your entire layout, do not look at Tags.

======

Going back to your original post:

The utf8sub function is a custom routine to handle special characters (certain accented characters and other non-standard latin characters). The standard Lua sub routine does not handle UTF8 characters gracefully, so it is effectively a direct replacement.
For what you are trying to do, it is not required.

change the following and it should do what you require:
Code:
local tmpunitname

if (unit=="pet" or unit == "focus") then
	tmpunitname = UnitName(unit)
	local count = 4

	tmpunitname = (string.len(tmpunitname) > count) and string.gsub(tmpunitname, "%s?(.)%S+%s", "%1. ") or tmpunitname

	if tmpunitname and tmpunitname:len() > count then
		tmpunitname = tmpunitname:sub(1, count, self)
	end
end


if (unit=="target" or unit == "targettarget") then
	tmpunitname = UnitName(unit)
	local count = 20

	tmpunitname = (string.len(tmpunitname) > count) and string.gsub(tmpunitname, "%s?(.)%S+%s", "%1. ") or tmpunitname

	if tmpunitname and tmpunitname:len() > count then
		tmpunitname = tmpunitname:sub(1, count, self)
	end
end
  Reply With Quote