ZScript menus

As of GZDoom 2.4, most of the internal menu handling has been exported to ZScript, allowing for modders to create flexible and highly customizable menus. However, menus are also (one of) the most complex systems to work with in ZScript. Knowledge on the workings and mechanics of ZScript itself may help.

Note: This feature is for ZScript only.

General Information

Before starting, knowing the scope system is highly recommended. Every menu and function except for Menu.SetMenu has a ui scope. This means only approved functions can access actors such as CountInv, which are marked within actors.txt as 'clearscope'.

Menus themselves are the very base foundations which hold items (see below), displaying and interacting them all on screen. Several types of menus are available:

NameDescription
MenuThe super class, inherited from by all menus internally.
ListMenuUsed for Doom's main menu.
OptionMenuUsed for most menus under the Options submenu.
GenericMenuA completely blank template for modders who wish to redesign menus in their own way.

NOTE: For completely custom menus, inheritance must be done with GenericMenu, NOT the base menu!

Each of these can be inherited by a child class to gain functions and properties. GenericMenu simply inherits and does not change anything from the base Menu class except for initialization, while ListMenu and OptionMenu come with a plethora of menu items and pre-programmed functionality.

Items are referred to the objects being displayed on screen while inside a menu, regardless of interactive or static. All items inherit from the super class MenuItemBase.

For a more exhaustive listing of items, see the class pages directly.

NameParametersParentMenu TypeDescription
MenuItemBase--SuperThe super class, inherited from by all menu items internally.
OptionMenuItem
  • string label
  • name command
  • bool center = false
MenuItemBase OptionMenu The base class for all items used in OptionMenus. Not usable by itself.
ListMenuItem
  • double xofs
  • double yofs
  • TextureID tex
MenuItemBase ListMenu The base class for all items used in ListMenus. Not usable by itself.
This article is issued from Zdoom. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.