View Single Post
04-30-09, 07:53 AM   #15
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by Druidicbeast View Post
Code:
oUF.Tags["[name]"] = function(u)
    Local o = ""
    if not(u == nil) then
        local n =  UnitName(u)
        if UnitIsDead(u) then
            o = "Dead"
        elseif not UnitIsConnected(u) then
            o = "D/C"
        elseif UnitIsAFK(u) then
            o = "AFK"
        elseif UnitIsGhost(u) then
            o = "Ghost"
        elseif (Abbreviate(self.Name)~=self.Name) and (Length(self.Name)>10) then
            Abbreviate(self.Name):Substring(1, (Length(Abbreviate(self.Name)) - 1)):Append(".")
            self.Name:Replace(" ", "                                   "):Substring(-15,-1):Replace(" ", ""):Truncate(10,nil)
        else
            self.Name:Truncate(10,nil)
        end
    end
    return o
end
oUF.TagEvents["[name]"] = "UNIT_HEALTH UNIT_MAXHEALTH PLAYER_FLAGS_CHANGED"
After messing around with this a little last night, it appears that Abbreviate isn't something that is recognized by oUF. So the

I thought I could find the abbreviate function from DogTag3.0 Lib and copy it over, but I was unable to find any reference to it. I could only find Abbrev and it was for "shortclassification" "shortclass" and "shortsex" .

There is something that I am overlooking in my search, and I for the life of me I am unable to figure it out.
'local' is case sensitive.
Functions must be valid, i guess that 'Abbreviate' and 'Length' etc is made by DogTag and Im not sure what they actually do to the string.

Also, custom tags should have custom names, overriding the '[name]' tag can mess up other layouts.
  Reply With Quote