Page tree
Skip to end of metadata
Go to start of metadata



Introduced in

Version:3.9.1

Description

Description:Adds an event handler to the editor map. Any added event handler is deleted once the map is closed. Multiple handlers can be assigned to the same event and are executed in reverse order (the one added last is executed first). For available events, see editorSetEventHandler.

Syntax

Syntax:map editorSetEventHandler [event,function]
Parameters:
  • map: Control - Editor map.
  • event: String - Name of the event to respond to (see editorSetEventHandler).
  • function: String - Code to execute when the event happens. Can use the array _this, which contains EH-relevant information.
Return Value:Number - ID of the handler (to use with editorRemoveEventHandler), or -1 when addition fails.

Examples

Examples:
map editorAddEventHandler ["SelectObject", "player sidechat format['Object %1 selected',_this select 2]"];

Additional Information

See also: editorRemoveEventHandler, editorSetEventHandler
Multiplayer: 
Problems: 

Notes