Thread Tools Display Modes
01-21-12, 04:17 PM   #1
archyo
A Kobold Labourer
Join Date: Jan 2012
Posts: 1
Pitbull / DogTag help

I have a question regarding a pretty basic command;

[if HasMP then
FractionalMP ' ' PercentMP:Percent
end]
How do i make the % independent from the actual value?

It would usually look like something like this '5000/5000 100%' the problem occurs when my % goes into 95.5% for example, I made the spacing so that my full mana wouldn't move. It's a minor thing, but for some reason I get well pissed in raids when my mana bar keeps moving a tad to the left and right when my % changes. The spacing in the actual command is larger than the spacing in the quote, this forum doesnt allow several spaces tho.
  Reply With Quote
01-21-12, 10:48 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Why are you still using DogTag syntax? The DogTag parser library is pretty much abandoned; all of the current PitBull devs work with LuaTexts instead, another parser that's included with PitBull. The LuaTexts syntax is more like regular Lua programming, so it doesn't require learning a new language to use it (at least for addon authors), it doesn't require searching through a separate set of documentation (you can just use regular Lua/WoW programming references to find the function you want), and it isn't limited to tags the library author thought might be useful (you can use any Lua/WoW functions you want).

As for your actual question, it's been years since I did anything with DogTag, but I don't think you can do what you want with only one text field, since DogTag can't tell how wide each character in the font you're using is and adjust the spacing accordingly. You'll probably have to make a separate text field for the actual value, and position it relative to the health bar (or whatever) with appropriate space for any possible percent value.

Alternatively, using a monospaced font would mostly work, though it would move again for whole number percents (eg. 40%) and for low percents (eg. 4.7%) since there would be fewer characters.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Pitbull / DogTag help


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