Silent Creating Custom Menu

From MyGamingTalk
Revision as of 12:51, 13 September 2015 by Gaoesa (talk | contribs)

Customized Server Menus

Starting from silEnT 0.9.0, server admins have the option to have a second, server customized menu. This is opposed to editing the official menus.

The second menu is always opened automatically if present when player opens the menus by pressing ESC. If the user clicks either menu, the official or the server custom menu, the other menu automatically closes. The server custom menus have the same commands as the official menus, with the exception that onOpen event can not be defined. If onOpen is defined, it is ignored.

Following is an example of a server custom menu:

Example

Customized server menu has one requirement, there must be a file called menus_server_custom.txt. This file is used exactly like the old menus.txt. It defines the .menu files that are laded for the custom menu. An example:

// menu defs
// 
{
	loadMenu { "ui/custom_main.menu" }
	loadMenu { "ui/rules.menu" }
}

The resulting files need to be packed into a zip file that is renamed to pk3 so that all the menu files and the "menus_server_custom.txt" are in and under ui directory.

Properties

  • When user opens themenus, both the official menu and the server customized menu are opened. The menus are opened in a way that the official menu is always on top in case the two menus overlap.
  • If user clicks a button in either menu, the other menu is automatically closed by the mod. This also includes the case when user presses ESC to close the menus.
  • The onOpen event is ignored in the custom menus.
  • Menu files in the etmain directory or the official menus can not be modified and the server refuses to start if it detects such modifications.