-
Notifications
You must be signed in to change notification settings - Fork 17
Menu System
DoDoCat edited this page Jul 4, 2020
·
7 revisions
<Menu id="mnu_start_game">
<Title>Welcome to OpenMB, please choose the game difficult before starting game.</Title>
<Logic>mnu_start_game.script</Logic>
<Children>
<MenuItem id="mni_start_game_easy">Easy</MenuItem>
<MenuItem id="mni_start_game_medium">Medium</MenuItem>
<MenuItem id="mni_start_game_hard">Hard</MenuItem>
<MenuItem id="mni_return">Return</MenuItem>
</Children>
</Menu>
Each menu should start with a element named <Menu>
and end with a </Menu>
There is only one attribute called id
in <Menu>
which set the menu id
The menu title
Logic block will define which script file will be called when this menu is loaded by engine
this engine should be a valid script file and only has two functions:
-
menuInit
- When the menu is inited by the engine -
menuButtonClicked
- When you click a menu item
Children block will contains the items of this menu
MenuItem will be showned as the menu options which player can choose
Each menuItem has id and displayText
Parameter Name | Description |
---|---|
None | - |
Parameter Name | Description |
---|---|
Menu Item ID | Which menu item you clicked |
Use switch_menu
script command to switch a specific menu, the parameter on needed is menu's id
such like:
switch_menu YourMenuID