In-Game Context Menu

Menus available upon right-clicking or pressing the "context menu" for the currently highlighted item/vehicle/door/computer in the world.

The ideal implementation would accept a list of items that are to be displayed. Each list item should have the following properties:

  1. The text to display.
  2. The hotkey that can be pressed (I think in Infantry these are numbers 1-9)
  3. Whether the item is enabled or disabled
  4. The function to call when this option is chosen.

Because the source of the list can come from anywhere (right-click on a player, or pressing the "Action" key on an item or vehicle in the world), it's best for those events to construct the list, rather than having the context menu have anything internal. This will make the context useful throughout the game application.