## VASSAL Reference Manual

Home > Module > Game Piece Palette > Game Piece > Restrict Commands

### Restrict Commands

This trait allows you to either grey out or hide completely particular items from the right-click context menu of a piece when specified conditions apply. Hiding or disabling a key command *also* prevents that key command from being triggered by other traits, Global Key Commands, etc.

Example: A piece may remove certain commands based on where it is on the map by matching the CurrentZone property. A piece with a Layer specifying a damage level may disable commands based on the Level property of that Layer.

Description:

  A brief description of this trait that will appear in the piece’s Trait list in the Editor, and is mainly used to distinguish different Restrict Commands trait from each other. Typically, the command to be disabled or hidden is referenced here.

Restriction:

  Select Hide to remove a command from the right-click context menu entirely.

  Select Disable to disable (grey out) the command. In either case, the restricted key command(s) will not be invoked when the corresponding Keystroke or Named Command is received.

Restrict when properties match:

  The commands will be restricted when the Properties of this piece match the given Property Match Expression. If this is left blank they will always be restricted.

Restrict these Key Commands:

  Specify the Keystroke and/or Named Commands that will be restricted. The corresponding right-click context menu item(s), if any, will be hidden or greyed out.