Page 1 of 1
Allow Pop-ups to be attached to text labels

Posted:
Wed May 23, 2012 4:29 pm
by oracle3001
Would it be possible to make text labels "clickable" to enable one to attach pop-up menus, in the same way normal stats are?
I have a number of context pop-up menus, and want I am looking to do is have a row of text labels in an always visible panel, which I can then click a particular label to reveal a certain menu.
Yes I could have a label and a stat and attach the pop-up menu to the stat, but I am trying to compress the number / size of always visible element. Thus I would be able to attach the various pop-ups in half the space if I only need a label, rather than a label and a stat.
Re: Allow Pop-ups to be attached to text labels

Posted:
Wed May 23, 2012 4:49 pm
by kraada
That's an interesting suggestion - I'll make a note of it for possible future consideration.
In the meantime here's a workaround that may work for you - create a custom stat that shows just text (using format()) - then since it's a stat you'll be able to attach a popup to it. Since there's no database call, it should be instant even though it's custom.
Re: Allow Pop-ups to be attached to text labels

Posted:
Wed May 23, 2012 4:58 pm
by oracle3001
When I create the custom stat, I insert format() into Value Expression box and it validates ok. However, when I add this stat to the HUD is displays "XYZ"? Am I forgetting to do something?
Edit:- Although the preview window of the HUD panel shows XYZ, it doesn't actually show up on the actual HUD.
Re: Allow Pop-ups to be attached to text labels

Posted:
Wed May 23, 2012 5:57 pm
by kraada
You want to put the text in format(). Like:
format('XYZ')
Re: Allow Pop-ups to be attached to text labels

Posted:
Wed May 23, 2012 6:06 pm
by oracle3001
Sorry I wasn't been clear. That is what I have been doing, but no matter what I put in the string, where we have format(' string ') the HUD preview always contains string followed by XYZ e.f format('BvB') -> 'BvBXYZ' in the preview window. The actual HUD will just show BvB as required.
Re: Allow Pop-ups to be attached to text labels

Posted:
Thu May 24, 2012 4:05 am
by WhiteRider
That's correct - the preview doesn't display the value of stats, it displays a placeholder. Any stat which displays text will be shown as XYZ as the preview doesn't know the value of the stat. In this case it is a fixed string, but the preview doesn't know that.