...
When selecting the next input, instead of running the event script with the id of the input, you will receive the event "returned" and the value will be an array, the first item in this array is the id of the input thats just been select, the second is the id of the menu it was run from, then the first third being the value that was selected (or null if it was cancelled) and finally the fourth is the current state of the menu array. Here you can return a new menu array, which will replace the existing menu (ie updating the menu display with new data) or you can return an input array to open another input straight away. Returning null here will just return back to the previous menu without making changes.
...
...
Event | Sent When | Return | Value Data | Extra Info |
---|
start | At the start of the input system | One of the Input Arrays to open the next/first input | This is the value sent when starting the menu, ie from the script command |
|
|
finished | Sent when the input has finished and closed |
| |
|
| Allows for cleanup, ie removing global/local variables used |
arguments | After the last input has returned | Array of arguments to pass to caller |
|
| If using from ship/agent command, the arguments are sent to the command script, otherwise the array is returned to the calling command |
cancelled | After any input is closed without selection | New Input array or null | The ID of the cancelled input |
|
|
closed | After the menu is forced closed externally |
| |
|
| NOTE: this is rarely used |
returned | After an "next" input menu has closed | an Input Array to open new or update previous menu | Array: - Current State - the input id of the menu we are returning to
- Previous State - The input id of the menu we are returning from
- Return Value - The return value returned from the previous menu
- Menu Data - The current menu array data
| This returns when a menu opened via "nextinput" is closed. This allows you to get the return value, and update the current menu |
cmdcheck | before first input is open | CmdCheck constants |
|
| This is used to check if the command should be disabled/enabled. Ignored if not used with ship/agent command |
isdisabled | when parent menu is opened | BOOLEAN | ID of context menu item | Used for menus added to context menus/sidebar. Also used for diplomacy tasks |
ishidden | When parent menu is opened | BOOLEAN | ID of context menu item | Used for menus added to context menus/siderbar. Can hide the command if needed |
Some additional events will be used when using a custom menu
Event | Start When | Return | Value Data | Extra Info |
---|
select |
switch selection | | escapepressed | | | | |
contextmenu | | | | |
contextmenu_update | | | | |
hotkey | | | | |
search | | | | |
group | | | | |
tradebar | | | | |
tradebar_changed | | | | |
update | | | | |
tabchanged | | | | |
heading_click | | | | |
tradebar_full | | | | |
tradebar_empty | | | | |
hyperlink | | | | |
...
|
|
|
|
heading_click |
|
|
|
|
tradebar_full |
|
|
|
|
tradebar_empty |
|
|
|
|
hyperlink |
|
|
|
|
Agent Command Events
When using a menu script with agent commands, some additional events are used to control the Diplomacy UI
Event | Start When | Return | Value Data | Extra Info |
---|
allowmultiple |
| | | | | | | | | | | | | | | |
...