Thread Tools Display Modes
10-30-11, 09:30 AM   #1
Tari-en
A Fallenroot Satyr
Join Date: May 2009
Posts: 22
Pitbull 4 - lua Texts

Heyja!
Is it possible to shorten the name so ...?

"Veressa Windrunner" -> "V. Windrunner"
or
"Veressa Windrunner" only "Veressa"

Currently, I have this:
Alpha(0.7) Outline() local r,g,b = ClassColor(unit)
return '|cff%02x%02x%02x%s|r %s%s%s',r,g,b,string.sub(Name(unit),1,9),Angle(AFK(unit) or DND(unit))
  Reply With Quote
10-30-11, 10:00 AM   #2
Nibelheim
local roygbi-
 
Nibelheim's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 1,600
Originally Posted by Tari-en View Post
Heyja!
Is it possible to shorten the name so ...?

"Veressa Windrunner" -> "V. Windrunner"
or
"Veressa Windrunner" only "Veressa"

Currently, I have this:
Code:
return '|cff%02x%02x%02x%s|r %s%s%s', r, g, b, gsub(Name(unit), "%s?(.[\128-\191]*)%S+%s", "%1. "), Angle(AFK(unit) or DND(unit))
  Reply With Quote
10-30-11, 03:05 PM   #3
Taryble
A Molten Giant
 
Taryble's Avatar
Join Date: Jan 2009
Posts: 811
The lua I use to shorten names (the first kind that you listed - V. Windrunner) looks like this:
lua Code:
  1. return "||cff%02x%02x%02x%s||r",cc.r*255,cc.g*255,cc.b*255,string.gsub(name, '%s?(.)%S+%s', '%1. ')
__________________
-- Taryble
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Pitbull 4 - lua Texts


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off