Skip to content

Menus 5.6

Rushfan edited this page Nov 8, 2020 · 1 revision

What to do with Menus in 5.6

Right now Menus are the same as 4.3, with a couple of cleanups.
Here's what's going to happen to menus.

New dataformat

struct menu_action_56_t {
  // MenuCommand to execute
  std::string cmd;
  // Data to pass to menu command
  std::string data;
  // ACS needed to execute this menu action
  std::string acs;
};

struct menu_item_56_t {
  // KEY of the item (such as 'C' or "CHAINEDIT")
  std::string item_key;
  // Text for the item (i.e. "Chain Edit")
  std::string item_text;
  // Help text to display in help screen
  std::string help_text;
  // What to log to sysops log when this menu item is invoked
  std::string log_text;
  // What to set for the instance message when this menu item is invoked.
  std::string instance_message;
  // ACS needed to invoke this command
  std::string acs;
  // password needed to invoke this menu item
  std::string password;
  // All of the actions to run when invoking this menu item
  std::vector<menu_action_56_t> actions;
};

struct menu_header_56_t {
   /* What does a number do?  Set sub#, Set dir#, nothing? */
  int num_action;
   /* Types of logging, Key, None, command, desc */
  int logging_action;
  /* force, display always, display on entrance only */
  int help_type;

  // Colors
  int color_title;
  int color_item_text;
  int color_item_key;
  int color_item_braces;

  // Title of this menu
  std::string title;
  // ACS needed to execute this menu
  std::string acs;
  // password needed to execute this menu
  std::string password;

  // Actions to invoke when entering this menu
  std::vector<menu_action_56_t> enter_actions;
  // Actions to invoke when exiting this menu
  std::vector<menu_action_56_t> exit_actions;
};

Other TODO

  • Make the menus JSON so it's easier to edit and version control
  • Make the matrix logoff (logoff.mat) into a menu we provide by default. This way you can run scripts on entering this menu easily.
  • Add help in the menu editor for what are the available commands