# Is there a way to use Restrict Command traits to disable or hide Sub Menu commands for certain sides? I’m playerSide Yellow and I want Green, Purple and Orange disabled or hidden when I right click on piece

**URL:** <https://forum.vassalengine.org/t/is-there-a-way-to-use-restrict-command-traits-to-disable-or-hide-sub-menu-commands-for-certain-sides-i-m-playerside-yellow-and-i-want-green-purple-and-orange-disabled-or-hidden-when-i-right-click-on-piece/83828>\
**Category:** Module Design\
**Created:** [October 25, 2024, 9:56pm UTC](https://forum.vassalengine.org/t/is-there-a-way-to-use-restrict-command-traits-to-disable-or-hide-sub-menu-commands-for-certain-sides-i-m-playerside-yellow-and-i-want-green-purple-and-orange-disabled-or-hidden-when-i-right-click-on-piece/83828 "2024-10-25T21:56:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bhfredjenni](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/bhfredjenni/32/7601_2.png) [@bhfredjenni](https://forum.vassalengine.org/u/bhfredjenni)\
**Post date:** [October 25, 2024, 9:56pm UTC](https://forum.vassalengine.org/t/is-there-a-way-to-use-restrict-command-traits-to-disable-or-hide-sub-menu-commands-for-certain-sides-i-m-playerside-yellow-and-i-want-green-purple-and-orange-disabled-or-hidden-when-i-right-click-on-piece/83828/1 "2024-10-25T21:56:29Z")

</div>

![sub_menu](https://forum.vassalengine.org/uploads/default/original/2X/4/4151f4e114f90122e67f311641efd3fb6c7c421f.png)

---

<div class="post-metadata">

**Author:** ![marktb1961](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/marktb1961/32/231_2.png) [@marktb1961](https://forum.vassalengine.org/u/marktb1961)\
**Post date:** [October 25, 2024, 10:35pm UTC](https://forum.vassalengine.org/t/is-there-a-way-to-use-restrict-command-traits-to-disable-or-hide-sub-menu-commands-for-certain-sides-i-m-playerside-yellow-and-i-want-green-purple-and-orange-disabled-or-hidden-when-i-right-click-on-piece/83828/2 "2024-10-25T22:35:25Z")

</div>

You can hide any Key Command-driven traits within the sub-menus with Restrict Commands but it is not possible to hide even an empty sub-menu. It’s a feature that has been requested [before](https://github.com/vassalengine/vassal/issues/5529).

Have you considered doing without sub-menus here and instead designing some command set based on PlayerSide?

For example, you could have a user-facing set of Trigger Actions (ie. traits that make up the Menus on the pieces), and these Trigger Actions in turn call another set of Triggers (one set per PlayerSide).

The PlayerSide triggers then perform the player-specific actions that you have in mind.

is that any help?

---

<div class="post-metadata">

**Author:** ![bhfredjenni](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/bhfredjenni/32/7601_2.png) [@bhfredjenni](https://forum.vassalengine.org/u/bhfredjenni)\
**Post date:** [October 25, 2024, 10:56pm UTC](https://forum.vassalengine.org/t/is-there-a-way-to-use-restrict-command-traits-to-disable-or-hide-sub-menu-commands-for-certain-sides-i-m-playerside-yellow-and-i-want-green-purple-and-orange-disabled-or-hidden-when-i-right-click-on-piece/83828/3 "2024-10-25T22:56:02Z")

</div>

Are you aware of a module off hand that uses your recommendation? The sub-menu I’m using speeds up the game pretty well, I was just trying to clean it up a little better. Thanks!

---

<div class="post-metadata">

**Author:** ![marktb1961](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/marktb1961/32/231_2.png) [@marktb1961](https://forum.vassalengine.org/u/marktb1961)\
**Post date:** [October 26, 2024, 12:05pm UTC](https://forum.vassalengine.org/t/is-there-a-way-to-use-restrict-command-traits-to-disable-or-hide-sub-menu-commands-for-certain-sides-i-m-playerside-yellow-and-i-want-green-purple-and-orange-disabled-or-hidden-when-i-right-click-on-piece/83828/4 "2024-10-26T12:05:19Z")

</div>

I’ve knocked up a module with a couple of examples showing how Restrict Commands can be used to present a set of common menu Commands with the availability & effect variable by PlayerSide.

To use the example, start a new “Game” and switch between the Player sides observing how the command menu changes and the different effect of “Move & Report”.

Download from Dropbox [here](https://www.dropbox.com/scl/fi/rlrbdmepbivwhekpm0y6u/FlexCommandsDemo.vmod?rlkey=cb9dfgh0vxowuiltzvkqag9ws&dl=0).

If there’s more to what you are trying to achieve, please shout.

---

<div class="post-metadata">

**Author:** ![bhfredjenni](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/bhfredjenni/32/7601_2.png) [@bhfredjenni](https://forum.vassalengine.org/u/bhfredjenni)\
**Post date:** [October 26, 2024, 6:18pm UTC](https://forum.vassalengine.org/t/is-there-a-way-to-use-restrict-command-traits-to-disable-or-hide-sub-menu-commands-for-certain-sides-i-m-playerside-yellow-and-i-want-green-purple-and-orange-disabled-or-hidden-when-i-right-click-on-piece/83828/5 "2024-10-26T18:18:51Z")

</div>

Thanks for the example, that’s a much cleaner way to do it. I was able to use a restrict command to hide the key commands for now. That way a player can’t click on the wrong players commands. It won’t hide the sub-menu but it resolved the problem. I will have to rework the module to your examples but in the meantime this will work.

 ![2024-10-26 (1)](https://forum.vassalengine.org/uploads/default/original/2X/6/6bc2193681e8ffc25bdab096720b941b4cdaee44.jpeg)  
 ![sub-menu_key-commands](https://forum.vassalengine.org/uploads/default/original/2X/a/af5e38b799ea05ada632cb7165b940d1564d65c5.png)
