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

Reply
 
Thread Tools
Old 06-13-2009   #121
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 somaru View Post
...Can I have some lua text and some dogtags and still see a performance increase?
...
Mixing LuaTexts and DogTags is what I imagine many of us did while we switched over. LuaTexts does require you to either hunt through this thread for code or learn a little Lua, but if you've done any programming before it should be relatively straight-forward. The beauty of the way Shefki has given us LuaTexts, is that there is already plenty of example code in the defaults. Just look at your texts one at a time, look at the default LuaTexts version and mess around with it.

I would hope even players who have never touched code before take a look at LuaTexts and experiment. If you have customised your DogTags, you are already a programmer! Who knows, maybe LuaTexts will be your window into the exciting and rewarding world of addon creation! Go forth and Lua! :P
__________________
Author: EggTimer, SavedInstances
jokeyrhyme is offline   Reply With Quote
Old 06-13-2009   #122
somaru
Member
 
Join Date: Sep 2008
Posts: 16
Default Re: PitBull 4.0

thank you! I have switched health over so far and it really seemed to make a big difference. I also switched over my buff display so I can see only hots and beacon of light and sacred shield and that seemed to go okay although I might try to figure out how to consolidate all the Healing over time spells into just one icon if any of them are present.

I was working on my debuffs and I definately can figure out how to do slag pot, etc... and am okay with those displaying as an icon.

However, for poison, magic, curse, and disease I have a custom dog tag to show these as little colored asterix.

Code:
[(if HasPoisonDebuff = true then
    "*":Green
end) (if HasMagicDebuff = true then
    "*":Color("00BFFF")
end) (if HasDiseaseDebuff = true then
    "*":Yellow
end) (if HasCurseDebuff = true then
    "*":Fuchsia
end)]
From what I can see here: http://www.wowace.com/projects/pitbu...ges/lua-texts/ there is nothing like that for the lua texts?

thanks again!
somaru is offline   Reply With Quote
Old 06-13-2009   #123
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

There is frame and/or border highlighting for each of those. I think if you want to do it with LuaTexts, you'll probably need to loop through all 40 possible auras with UnitDebuff()
Here's the basic framework for such a loop, I think you get the idea.
Code:
for i=1,40 do
  local type = UnitDebuff(unit, i, false)
  if type == "Poison" then
    -- do your poison colouring thing here
  end
  -- branch for other debuff types Magic, Disease, Curse...
end
-- use your colour on the asterisk
Note that this is probably the most awful way to do this, I haven't messed around with UnitAura/Buff/Debuff much. Just looking at this, the fact that the loop is run for every frame you put this LuaText on, it just looks terribly inefficient (although I think that DogTag you gave probably does a similar loop 4 times, so it's alot better).

Just remember that you need to have the right events toggled for this to be updated properly: UNIT_AURA
__________________
Author: EggTimer, SavedInstances
jokeyrhyme is offline   Reply With Quote
Old 06-13-2009   #124
Shefki
Hero Member
 
Join Date: Feb 2007
Posts: 558
Default Re: PitBull 4.0

Quote:
Originally Posted by jokeyrhyme View Post
There is frame and/or border highlighting for each of those. I think if you want to do it with LuaTexts, you'll probably need to loop through all 40 possible auras with UnitDebuff()
a) There is no 40 limit anymore so see the example code further back where I did it without a fixed limit.

b) I'd encourage you to use UnitAura() now. UnitDebuff() is just a wrapper for it anyway. No reason to incur an extra function call just to figure out the options for you. UnitDebuff(unit, i) == UnitAura(unit, i, "HARMFUL")
Shefki is offline   Reply With Quote
Old 06-13-2009   #125
Shefki
Hero Member
 
Join Date: Feb 2007
Posts: 558
Default Re: PitBull 4.0

Quote:
Originally Posted by jokeyrhyme View Post
although I think that DogTag you gave probably does a similar loop 4 times, so it's alot better
It actually doesn't there's a cache in DogTags for this.
Shefki is offline   Reply With Quote
Old 06-14-2009   #126
Ajuga
Junior Member
 
Join Date: Jun 2007
Posts: 82
Default Re: PitBull 4.0

I've started a thread about LuaTexts on the Elitist Jerks forum. Feel free to stop by

Link
Ajuga is offline   Reply With Quote
Old 06-14-2009   #127
jh032008
Newbie
 
Join Date: Jan 2009
Posts: 8
Default Re: PitBull 4.0

Is there any way of returning a Classification without the need for a gap if the target is a normal mob? At the moment I'm using the following for target class text:

Code:
if UnitIsPlayer(unit) then
  return "Level %s %s %s",Level(unit),SmartRace(unit),Class(unit)
else
  return "Level %s %s %s",Level(unit),Classification(unit) or '',SmartRace(unit)
end
For example, when selecting an elite mob, the text will read 'Level 80 Elite Humanoid', but when selecting a normal mob, it reads 'Level 80 Humanoid' with two spaces in the middle. I realise this is probably because of the [or ''] part of the code, but if I remove that, the class text only prints as {err}. I've got practically zero experience with Lua, so any help will be appreciated mightily.
jh032008 is offline   Reply With Quote
Old 06-15-2009   #128
Shefki
Hero Member
 
Join Date: Feb 2007
Posts: 558
Default Re: PitBull 4.0

Quote:
Originally Posted by Ajuga View Post
I've started a thread about LuaTexts on the Elitist Jerks forum. Feel free to stop by

Link
Thank you.
Shefki is offline   Reply With Quote
Old 06-15-2009   #129
Shefki
Hero Member
 
Join Date: Feb 2007
Posts: 558
Default Re: PitBull 4.0

Quote:
Originally Posted by jh032008 View Post
Is there any way of returning a Classification without the need for a gap if the target is a normal mob? At the moment I'm using the following for target class text:

Code:
if UnitIsPlayer(unit) then
  return "Level %s %s %s",Level(unit),SmartRace(unit),Class(unit)
else
  return "Level %s %s %s",Level(unit),Classification(unit) or '',SmartRace(unit)
end
For example, when selecting an elite mob, the text will read 'Level 80 Elite Humanoid', but when selecting a normal mob, it reads 'Level 80 Humanoid' with two spaces in the middle. I realise this is probably because of the [or ''] part of the code, but if I remove that, the class text only prints as {err}. I've got practically zero experience with Lua, so any help will be appreciated mightily.
I'd do it like so:
Code:
if UnitIsPlayer(unit) then
  return "Level %s %s %s",Level(unit),SmartRace(unit),Class(unit)
else
  local classification = Classification(unit)
  if classification then
    return "Level %s %s %s",Level(unit),classification,SmartRace(unit)
  else
    return "Level %s %s",Level(unit),SmartRace(unit)
  end
end
It's somewhat annoying to do it that way but it's better because it avoids the garbage creation of concatentating a space onto Classification.
Shefki is offline   Reply With Quote
Old 06-15-2009   #130
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

I'd be more inclined to create separate LuaTexts for each of Level, Classification and Race. That way, PitBull's layout system will automatically put spacing in there. I do have to wonder though if the spacing around texts/indicators is properly omitted for empty/absent ones, but everything looks fine on my layout.

Separate but properly ordered texts means you have (what I feel is) better mirror behaviour. If you always want Race to be closer to the centre of the frame than Level, no matter what way 'round the frame is mirrored, then this is the way to accomplish that. Of course, if you don't mirror horizontally for some frames then it's neither here nor there.
__________________
Author: EggTimer, SavedInstances
jokeyrhyme 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 07:46 AM.