i'm not realy into LUA programming, and i dont want to code a complete addon.
Anyway, i need your help =)
I was looking around at wowwiki and some other LUA-Overview sites, but i cant really find what im looking for.
All i want do to is to change the class text in Pitbull4. (i think thats LUA and no more Dogtags like in version 3).
The Default setup is e.g. 80 Druid Tauren ("Druid" colored depending on the class)
I want it to be just 80 colored in classcolor. (so for this example an orange 80)
I tried around by copy&paste some stuff from other premade textlayouts in the configmenu, but i'm getitng lua errors all the time.
I would be so pleased if anyone could tell me that few lines i have to add
Personally I still use DogTags. Just click modules, and enable dogtags. You can optionally use both at the same time
But you can do...
if UnitIsPlayer(unit) then
local cr,cg,cb = ClassColor(unit)
the |cff is for Compact Font Format, the %02x gets the hex values in 2 digits (in order) of the variables to the right of the end quote
if you were looking at it via a table view
If the Unit is a hunter the Hex classcolor value = #AAD372
Class Color Definition For the Unit
170.85, 211.65, 114.75 (initial value of cr,cg,cb)
cr cg cb
%02x %02x %02x ( in order left to right cr, cg, cb)
aa d3 72 (Hex conversion of cr, cg, cb)
*Technically the initial values of cr,cg,cb should be rounded up to 171, 212, 115*
by using cr = math.ceil(cr)
And then the %s gets the string value of Level(Unit)
Making the end result if the unit was an 80 hunter |cffaad37280|r
And finally the |r is the end (|) and return (r) (I'm assuming)
See http://lua-users.org/wiki/StringLibraryTutorial for more information on string formats
Also to get a barring on the functions you can use with LUATexts module, open Pitbull4\Modules\LuaTexts\ScriptEnv.lua
Which will list the functions and their result sets.
Actually no. |c is the escape to change the color. After the |c the game takes the next 8 characters as values for setting the color. They are in 2 character pairs and are expected to be hexidecimal representations. The parameters are:
For the alpha channel 00 would be transparent and ff would be opaque. However, the game also entirely ignores the alpha channel parameter and uses a separate API to set the alpha of the FontString. As a result everyone uses ff for fully opaque, just in case they ever change this.
I was under the impression since earlier versions used a CFF driver, that it was somehow derived from there. Familiar with escaping strings as I've written vbscript functions to behave like bb code and to strip out HTML code to be stored as ISO values which would display as text in a browser using regular expressions.