Create account / Log in

Hide blank options from Dynamic Property lists

Suggestions for additional features for the module editor and Vassal engine.

Moderators: uckelman, Tim M

Hide blank options from Dynamic Property lists

Postby m3tan » August 19th, 2020, 1:58 am

Since you can utilize BeanShell expressions when creating lists for Dynamic Properties, it would be helpful to be able to hide blank entries. For instance, if one of the list values was defined as {LocationName=~"Berlin|Hamburg|Munich"?"Germany":""}, then it would list "Germany" as the value if the selected Piece was in Berlin, Hamburg, or Munich, but hide the entry entirely instead of displaying a blank value.
User avatar
m3tan
 
Posts: 209
Joined: August 12th, 2018, 11:49 pm

Re: Hide blank options from Dynamic Property lists

Postby Cattlesquat » August 19th, 2020, 9:00 pm

You can currently do that w/ a Restrict Properties for whatever the key command or named key command is for that action, an expression for when you want it hidden.
User avatar
Cattlesquat
 
Posts: 947
Joined: December 2nd, 2019, 4:57 pm
Location: Baltimore, Maryland, USA

Re: Hide blank options from Dynamic Property lists

Postby m3tan » August 19th, 2020, 9:19 pm

Are you saying the Restrict Command propegates down to the Dynamic Property lists that are generated when you choose "Prompt user to select from list"? I've never noticed that, but I haven't explictily tested for it either...
User avatar
m3tan
 
Posts: 209
Joined: August 12th, 2018, 11:49 pm

Re: Hide blank options from Dynamic Property lists

Postby Cattlesquat » August 19th, 2020, 9:35 pm

It should hide anything on the piece that has a key command assigned. If it doesn't, let me know!
User avatar
Cattlesquat
 
Posts: 947
Joined: December 2nd, 2019, 4:57 pm
Location: Baltimore, Maryland, USA

Re: Hide blank options from Dynamic Property lists

Postby m3tan » August 20th, 2020, 1:25 am

I had a look at this and I logically I don't see any way this could possibly be implementing. The Restrict Command hides an entire key command, not each list entry. For instance, let's say CTRL-D deploys a new unit in Germany. If I want the player to be able to choose the deploy location, I'd create a Dynamic Property called DeployName that is initiated by CTRL-D. The Type is "Prompt user to select from list". There is no key command associated with each entry on that list. Therefore there is no way Restrict Command can affect each of those list entries other than hiding the entire CTRL-D command, which is not what I'm asking for. If the list consisted of the entries Berlin, Breslau, Hamburg, Königsberg, and Munich but Breslau and Königsberg were illegal choices based on whatever expression, I'd want the list to show "Berlin, Hamburg, Munich" but presently it displays as "Berlin, , Hamburg, , and Munich". It doesn't affect play but it's an ugly UI thing.
User avatar
m3tan
 
Posts: 209
Joined: August 12th, 2018, 11:49 pm


Return to Feature Requests

Who is online

Users browsing this forum: No registered users and 1 guest