Functions Documentation
View Function Edit Function
Name scrAddAction
Syntax (scrAddAction screen actionID pos label [key] [special] code)
Argument List screen: dockscreen to work on, usually gScreen
actionID: string to identify action with later
pos: number of action to insert this action before
label: string display text of action
[key]: string shortcut key
[special]: list or token describing special functionality
code: code to execute when player selects action
Returns nothing?
Category screen, 1.04
Description Allows dynamic creation of dockscreen actions from code.
; aScreenUNID is the UNID of the screen being shown
; aScreen is the screen name (if this is a local screen)
; aPane is the pane being shown
; shipStatusScreen is the current playership's dockscreen
(if (and
(eq aScreen (objGetDataField gPlayerShip "shipStatusScreen"))
(eq aPane "Default"))
"Do something cool"
(scrShowScreen gScreen "&scMyCoolScreen;")
Comment Meant for use in <OnGlobalPaneInit>, can also be used to make dynamic dockscreens.

Special actions are 'cancel , 'default , 'nextKey , 'prevKey , or a list of these tokens.
"pos" can be -1 to insert as last action on screen.
Implementation discussion available here -- example was adapted from there.