Menu Command Grayed Out but Shortcut Key Command Still Works

I’ve got a Layer trait defined as below. Using VASSAL 3.5.3

As you can see, it’s always active but does not loop through levels. I also have a Report Action trait that reports level changes.

If the currently active level is Level 1 or 6, the min and max in this example, the Menu Command is grayed out and clicking it does nothing. No level change and no action reported as desired.

However if you use the shortcut key command, it tries to change the level and does report the action.

Is there a way to deactivate the shortcut key command when the menu command is grayed out?

[attachment=0]Layer-Problem.png[/attachment]

Use a Trigger Action that checks if the current level is already at the minimum (or maximum), and then only forwards the command to the Level trait if not. In otherwords, Alt+D would now be set to a Trigger Action with Restriction {Steps_Level > 1},
which would then fire a DecreaseSteps command (changing the Decrease Steps command in the Layer to DecreaseSteps named key command instead of Alt-D). Similarly for Alt-I.

Just noticed you seem to have Increase and Decrease backwards in your level definition, BTW…

With your Increase/Decrease backwards like they are, the Trigger when Properties match for Alt+D would actually be {Steps_Level < 6}, rather than > 1.

However, it occurs to me you could probably just use a Restrict Commands trait, instead of a Trigger Action…Restrict Alt+D when {Steps_Level > 5}, and Restrict Alt+I when {Steps_Level < 2}.

Thanks for responding, JR

First, the reversal of increase/decrease was done since the default starting level is 1 and I want that to show the maximum steps so as I go up in levels, the image number decreases.

I can get the trigger to work but its command wasn’t grayed out when it was restricted so even when you can’t decrease a level, it indicated you can.

And actually, I’ve got a different problem but VASSAL is working properly for that, I just don’t have the configuration correct. Yet. :wink:

Again, thanks for your input.