Spacing of "Invisible" statistics in HUD Popup

Forum for users that want to write their own custom queries against the PT database either via the Structured Query Language (SQL) or using the PT3 custom stats/reports interface.

Moderator: Moderators

Spacing of "Invisible" statistics in HUD Popup

Postby ChicagoAl » Thu Jan 06, 2011 3:01 pm

I have a HUD Popup with the following settings: Type: Normal Separator: (Empty) Padding: 0

The statistics in this popup are in groups of 13, with each group separated by a "New Line"

Each of the 13 statistic on the line uses a format expression similar to the following: if(cnt_range_Raise_AA > 0, format('AA: {1} ', format_number(cnt_range_Raise_AA, 0, false, true)),''), which (as designed) puts up the value "AA: X " only if cnt_range_Raise_AA is >0, and leaves the spot blank if cnt_range_Raise_AA is <=0.

What I was hoping for was a neatly spaced, ordered list that looks something like this:
AKs: 1 AK: 1 A9: 1 A8s: 1 A8: 4 A4s: 1

Instead, it appears that the HUD is inserting spaces where the <=0 stats would go even though they should be blank and my padding is set to 0 - so I end up with something like this:
AKs: 1 AK: 1 A9: 1 A8s: 1 A8: 4 A4s: 1

So my question is this - Is there a way to eliminate the extra spaces to get the formatting I am looking for?

Thanks for your help!
ChicagoAl
 
Posts: 29
Joined: Thu Aug 05, 2010 10:31 am

Re: Spacing of "Invisible" statistics in HUD Popup

Postby WhiteRider » Thu Jan 06, 2011 4:08 pm

You'll still get a bit of space taken up by each stat, even if it is empty.

To get it really neat you could combine them all into one stat - it would make a pretty complicated (or long, at least) format expression.
You can use + to concatenate strings in a format expression, so you could append all of your existing expressions if you like.
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: Spacing of "Invisible" statistics in HUD Popup

Postby ChicagoAl » Thu Jan 06, 2011 4:19 pm

Oooooooh that would be interesting! I'll start working on a prototype of that! Is there a limit to the length of a format expression? Also, I assume in this case the Value Expression becomes irrelevant?
ChicagoAl
 
Posts: 29
Joined: Thu Aug 05, 2010 10:31 am

Re: Spacing of "Invisible" statistics in HUD Popup

Postby WhiteRider » Thu Jan 06, 2011 5:38 pm

I wouldn't expect there to be a limit to the length of the format expression, but it's possible I guess. I haven't built anything quite that long myself. I'd add a few parts at a time and check it works. If you hit a limit it will probably still look better as 2 or 3 stats rather than 13.. :)

The Value Expression is used for things like sorting in reports, and colouring using HUD Properties, but it is effectively irrellevant here, yes.
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: Spacing of "Invisible" statistics in HUD Popup

Postby ChicagoAl » Thu Jan 06, 2011 9:07 pm

WHITERIDER SAVES THE DAY!!!!!!

Not only did this work........and look much more elegant.........but it was also much easier and was accomplished with just a 13 custom stats rather than 169. Youdaman!

Now if you can figure out how I can have the text one color and the value(s) another inside a single result (my other post where u said i was basically hosed).......you will be even more da man!
ChicagoAl
 
Posts: 29
Joined: Thu Aug 05, 2010 10:31 am

Re: Spacing of "Invisible" statistics in HUD Popup

Postby WhiteRider » Fri Jan 07, 2011 4:42 am

Excellent!

I wish that we could colour different sections of stats independently, but I'm pretty sure we can't at the moment. I will mention this to the development team and see if it is possible for a future version.
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK


Return to Custom Stats, Reports, and SQL [Read Only]

Who is online

Users browsing this forum: No registered users and 1 guest