Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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.

...

Generic Custom Input Event

...


EventSent WhenReturnValue DataExtra Info
startAt the start of the input systemOne of the Input Arrays to open the next/first inputThis is the value sent when starting the menu, ie from the script command
 

finishedSent when the input has finished and closed
  


Allows for cleanup, ie removing global/local variables used
argumentsAfter the last input has returnedArray 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
cancelledAfter any input is closed without selectionNew Input array or nullThe ID of the cancelled input
 

closedAfter the menu is forced closed externally
  


NOTE: this is rarely used
returnedAfter an "next" input menu has closedan Input Array to open new or update previous menu

Array:

  1. Current State - the input id of the menu we are returning to
  2. Previous State - The input id of the menu we are returning from
  3. Return Value - The return value returned from the previous menu
  4. 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
cmdcheckbefore first input is openCmdCheck constants
 

This is used to check if the command should be disabled/enabled. Ignored if not used with ship/agent command
isdisabledwhen parent menu is openedBOOLEANID of context menu itemUsed for menus added to context menus/sidebar. Also used for diplomacy tasks
ishiddenWhen parent menu is openedBOOLEANID of context menu itemUsed for menus added to context menus/siderbar. Can hide the command if needed


Custom Menu Events

Some additional events will be used when using a custom menu

EventStart WhenReturnValue DataExtra Info
select
 




switch
 




selection
 




escapepressed
 




contextmenu
switch




contextmenu_update
 




hotkey
 




search
 




group
 




tradebar
selection




tradebar_changed
 




update
 




tabchanged
  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

EventStart WhenReturnValue DataExtra Info
allowmultiple
    




influence
  
  




isspy
    




upkeep
  
  




data
    

 

...