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



Introduced in

Version:1.00

Description

Description: Executes the specified code, when once of the defined events happen in the editor.

These events will only work with the editor map. Any event handler defined will be cleared once the map is closed.
The following events are available (with the content of "_this" listed below each event):

  • "ClearMission":
  • "ClearSelected":
    Object is unselected: [map]
  • "CloseOverlay":
    Closing (or saving) overlay: [map, mode, type]
    • map Control: Map control
    • mode String: Always "Marker Overlay"
    • type String: Either "Marker" or "Object", depending on the overlay mode
  • "EditOverlay":
    Starting overlay edit: [map, mode, type]
    • map Control: Map control
    • mode String: Always "Marker Overlay"
    • type String: Either "Marker" or "Object", depending on the overlay mode
  • "LinkFromObject":
    A link from an is created (or attached to another object): [map, edobject, mode, open]
  • "MouseOver":
    Object mouse is positioned over: [map, edobject, object]
    • map Control: Map control
    • edobject Editor Object: Selected editor object ("" if over empty map)
    • object Object: Selected object (<NULL-object> if over empty map)
  • "RestartCamera":
  • "RestartMission":
  • "SelectObject":
    Object is selected: [map, edobject, object]
  • "ShowMap":
    Editor view is toggled between 2D and 3D view: [map, view]
  • "StopMovingObject":
    A dragged object was released (whether it was moving or not): [map]
  • "SwitchCommandMenu":
  • "SwitchToVehicle":
    Player switch to another vehicle or unit: [map, fromunit, tounit]
    • map Control: Map control
    • fromunit Object: Unit player is switching from
    • tounit Object: Unit player is switching to
  • "UnselectObject":
    Object is unselected (in overlay): [map, edobject, object]

Syntax

Syntax: map editorSetEventHandler [event,function]
Parameters:
  • map: Control - Editor map.
  • event: String - Name of the event to respond to (see Description above).
  • function: String - Code to execute when the event happens. Can use the array _this, which contains EH-relevant information.
Return Value: Nothing

Examples

Examples:
_map editorSetEventHandler ["SelectObject", "hint format['Object %1 selected',_this select 2"]

Additional Information

See also: editorAddEventHandler, editorRemoveEventHandler
Multiplayer: 
Problems:Only one event handler can be assigned to each event. Assigning a handler to an event will overwrite any previously assigned handler. Use editorAddEventHandler instead to avoid this behavior.

Notes