Silent Creating Custom Menu: Difference between revisions
No edit summary |
|||
Line 13: | Line 13: | ||
== Example == | == 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 | 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 loaded for the custom menu. An example: | ||
<pre> | <pre> | ||
// menu defs | // menu defs |
Revision as of 12:52, 13 September 2015
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 loaded 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.