Go Back   WowAce Forums > Official Addon Threads > Unit Frames
Unit Frames ag_UnitFrames, Grid, Pitbull, X-Perl, etc., and modules

Reply
 
Thread Tools
Old 05-22-2009   #1
Shefki
Hero Member
 
Join Date: Feb 2007
Posts: 558
Wink LuaTexts Official Thread

So I'm renaming my SimpleTexts to LuaTexts. All that's really left is to finish up the config and put in the lua for all the default codes. Basic design is you can choose the events to trigger an update and have lua code that generates the parameters to SetFormattedText() on the fontstring.

This design should produce significantly less garbage than DogTags does, run faster than dogtags since it has no need for a parser. However, this comes at the cost of ease of configurability. While it can pretty much do anything including things that DogTags can't do. It's going to be much more difficult to make it do things that seem simple in DogTags.

However, the goal here is to provide performance improvements for people that primarily only use built in tags with the current DogTagTexts. If you're a heavy user of DogTags you probably won't like it. If all you ever did was select prebuilt tags you'll probably think it's swimmingly better.
Shefki is offline   Reply With Quote
Old 05-23-2009   #2
Allara
Senior Member
 
Allara's Avatar
 
Join Date: Feb 2005
Posts: 444
Default Re: PitBull 4.0

Sweet, I can't wait! I wonder what the feasibility is of going in and customizing the Lua for a text? Should we clone the LuaTexts module and make our own? (Not wanting to merge in my custom Lua changes during an update.)
Allara is offline   Reply With Quote
Old 05-23-2009   #3
Shefki
Hero Member
 
Join Date: Feb 2007
Posts: 558
Default Re: PitBull 4.0

Quote:
Originally Posted by Allara View Post
Sweet, I can't wait! I wonder what the feasibility is of going in and customizing the Lua for a text? Should we clone the LuaTexts module and make our own? (Not wanting to merge in my custom Lua changes during an update.)
Actually the code is exposed to edit in the config UI. Similar to how DogTags are exposed. The only difference is you have to manage your own events that are needed to trigger updates (there's a dropdown boxes with a list of events you can check to turn on updates from) and another checkbox to turn on fast updates for things like the PowerBar on player and pet frames.

Most people will just want to ignore the event drop down and the code box and select stuff from the drop down list of already written codes.

For all practical purposes this is a rewrite of LibDogTag without the language that requires parsing and using raw Lua instead. I have included a special environment each script gets and am writing some functions that replace some of the features of DogTags. For example Name - Long looks like so:

Code:
if unit then local r,g,b = ClassColor(unit) return '%s |cff%02x%02x%02x%s|r%s',Level(unit),r,g,b,UnitName(unit),AFK(unit) or DND(unit) or '' end
The first return is the format string to put together the text and everything after that is a value that goes in. Level(unit), AFK(unit) and DND(unit) were functions I wrote that essentially replace the [Level] [AFK] and [DND] tags in LibDogTag.

Anyway to directly answer your question, you won't need to duplicate the module.
Shefki is offline   Reply With Quote
Old 05-24-2009   #4
Allara
Senior Member
 
Allara's Avatar
 
Join Date: Feb 2005
Posts: 444
Default Re: PitBull 4.0

Quote:
Originally Posted by Shefki View Post
*snip*

Anyway to directly answer your question, you won't need to duplicate the module.
That is the coolest thing I have possibly ever heard. This is going to hands down make Pitbull 4 the best thing since sliced bread! Thanks for working on it.
Allara is offline   Reply With Quote
Old 05-26-2009   #5
jokeyrhyme
Senior Member
 
jokeyrhyme's Avatar
 
Join Date: Aug 2008
Posts: 430
Send a message via ICQ to jokeyrhyme Send a message via Yahoo to jokeyrhyme Send a message via Skype™ to jokeyrhyme
Default Re: PitBull 4.0

Quote:
Originally Posted by Shefki View Post
So I'm renaming my SimpleTexts to LuaTexts. All that's really left is to finish up the config and put in the lua for all the default codes. Basic design is you can choose the events to trigger an update and have lua code that generates the parameters to SetFormattedText() on the fontstring.
I can't wait for this. I see applications far beyond PitBull4 though. I know lots of people are lamenting the DogTag-related issues with CowTip, for instance. Imagine a tooltip addon that uses LuaTexts! Hot! We could even have LDB tickers that show us exactly what we want to see. Mmmmm.
__________________
Author: EggTimer, SavedInstances
jokeyrhyme is offline   Reply With Quote
Old 05-27-2009   #6
Shefki
Hero Member
 
Join Date: Feb 2007
Posts: 558
Default Re: PitBull 4.0

Push I just did added LuaTexts. It's complete as far as the default tags are concerned. I'll try to get a page up with some degree of documentation.

Ohh I should note, the module is disabled by default. If you're looking to switch probably the most logical thing to do is to disable DogTagTexts and load LuaTexts. If you're running embeded all you should need to do to prevent LibDogTag from being load is to reload your ui. Unless of course you're running some other mod that needs it or you have it separately installed.

My limited testing earlier tonight showed a 10 fps improvement over DogTagTexts in Ulduar. YMMV. Bugs are likely to abound.

Last edited by Shefki; 05-27-2009 at 07:04 AM.
Shefki is offline   Reply With Quote
Old 05-27-2009   #7
Shefki
Hero Member
 
Join Date: Feb 2007
Posts: 558
Default Re: PitBull 4.0

Quote:
Originally Posted by jokeyrhyme View Post
I can't wait for this. I see applications far beyond PitBull4 though. I know lots of people are lamenting the DogTag-related issues with CowTip, for instance. Imagine a tooltip addon that uses LuaTexts! Hot! We could even have LDB tickers that show us exactly what we want to see. Mmmmm.
Just to be clear, I didn't write this to be a generalized text provider. It's pretty much designed to be attached at the hip to PitBull4. Separating it out to be a separate library is going to probably add some overhead.
Shefki is offline   Reply With Quote
Old 05-27-2009   #8
jokeyrhyme
Senior Member
 
jokeyrhyme's Avatar
 
Join Date: Aug 2008
Posts: 430
Send a message via ICQ to jokeyrhyme Send a message via Yahoo to jokeyrhyme Send a message via Skype™ to jokeyrhyme
Default Re: PitBull 4.0

Quote:
Originally Posted by Shefki View Post
Push I just did added LuaTexts.
...
It's missing the load.xml file to make it load. Easy enough to just copy from another module and edit though. Checking this awesomeness out now!

UPDATE: This is really really complicated. I don't think I can replace all my DogTags in the 20 minutes before my raid. LOL! It'll be worth it later though.
__________________
Author: EggTimer, SavedInstances

Last edited by jokeyrhyme; 05-27-2009 at 08:09 AM.
jokeyrhyme is offline   Reply With Quote
Old 05-27-2009   #9
Shefki
Hero Member
 
Join Date: Feb 2007
Posts: 558
Default Re: PitBull 4.0

I told you it would be. Thanks for catching that I missed that one file. Did another push to put it in.

Some of the complexity of the provided codes is that I'm avoiding doing concatentation or string formatting and trying to pass it all through to SetFormattedText(). The reason for this is if SetFormattedText does it then no garbage is produced, since it's done by the C++ code of WoW rather than Lua. The function was added specifically to help us avoid churning memory.

You can write a heck of a lot simpler looking stuff without that constraint.

That said, I avoided adding conveience functions that would encourage you to do that. This module is really about performance. Not about easy tinkering.
Shefki is offline   Reply With Quote
Old 05-27-2009   #10
siemal
Member
 
siemal's Avatar
 
Join Date: Oct 2007
Posts: 12
Default Re: PitBull 4.0

Is there a chance for some reference sheet of custom functions in lua module?
Reverse engineering from built-in sample texts is a bit tough;P

For now could anyone help me with checking if unit is in combat and retrieving reaction colors?;P
I have strange feeling that we have to implement all DogTag colors from scratch now ><
siemal is offline   Reply With Quote
Reply

Tags
luatexts


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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

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

Forum Jump


All times are GMT. The time now is 03:30 AM.