Eden Editor Event Handlers – Arma 3
mNo edit summary |
mNo edit summary |
||
Line 338: | Line 338: | ||
== Object Event Handlers == | == Object Event Handlers == | ||
Editor specific event handlers can be also added directly to [[Eden Editor: Object|objects]], using [[addEventHandler]] command. | Editor specific event handlers can be also added directly to [[Eden Editor: Object|objects]], using [[addEventHandler]] command. | ||
These handlers exist only for the duration of active workspace. Running a preview or loading the same scenario again will erase all object event handlers, because objects themselves are despawned from the world and then created again. | |||
=== List === | === List === |
Revision as of 09:37, 5 November 2015
Eden Editor event handlers. When added, they will remain until Eden Editor is closed. Playing preview will not erase them.
Editor Event Handlers
Editor handlers are added to the editor instance and will remain active for the duration of a session. Launching a preview won't erase them, but leaving to main menu will close the editor and erase all handlers with it.
Scripting
Commands:
Example:
add3DENEventHandler ["onUndo",{hint "Undo";}]
Config
Alternatively, you can define event handlers directly in the config. Use your custom section (mySection in the example) to prevent overriding handlers from other sources. Handlers defined here will be added automatically when Eden Editor is opened.
class Cfg3DEN { class EventHandlers { class mySection { onUndo = "hint 'Undo';"; // <handlerName> = <handlerExpression> }; }; };
List
Most handlers don't receive any arguments. That is intended, because in most cases, required data can be obtained either using get3DENActionState, or by specialized 'get' commands.
Class | Description | Arguments |
---|---|---|
OnConnectingStart |
When Connecting operation is initiated. |
[<class>,<from>]
|
OnConnectingEnd |
When Connecting operation is terminated, no matter if it was confirmed or canceled. |
[<class>,<from>,<to>]
|
OnCopy |
When entities are copied. |
None |
OnCut |
When entities are cut. |
None |
OnDeleteUnits |
When entities are deleted. |
None |
OnEntityMenu |
When Entity Context Menu is opened. |
[position, entity, listPath]
|
OnGridChange |
When grid changes, either using Toolbar option, ot by scripting command set3DENGrid. |
[gridType, gridValue] |
OnMapClosed |
When map is closed. |
None |
OnMapOpened |
When map is opened. |
None |
OnMessage |
Handler used for showing on-screen notifications, triggered by various range of events. Message IDs:
|
[messageID]
|
OnMissionLoad |
When a scenario is loaded. |
None |
OnMissionNew |
When new scenario is started. Executed also when Eden is opened with an empty scenario. |
None |
OnMissionPreview |
When scenario preview is started. Executed when the scenario is already loaded, so entities in it can be accessed. |
[objects, groups, waypoints, markers]
Each array is in format: [entity1, id1, entity2, id2, ..., entityN, idN] |
OnMissionPreviewEnd |
When preview ends and user returns back to Eden Editor. |
None |
OnMissionSave |
When a scenario is saved. |
None |
OnMissionSaveAs |
None | |
OnModeChange |
When Save As action is triggered (i.e., Save window is opened, but the mission is not necessarily saved yet). |
None |
OnMoveGridToggle |
When translation grid is toggled on or off. |
None |
OnPaste |
When entities are pasted. |
None |
OnPasteUnitOrig |
When entities are pasted on their original positions. |
None |
OnRedo |
When undo operation is redone. |
None |
OnRotateGridToggle |
When rotation grid is toggled on or off. |
None |
OnScaleGridToggle |
When area scaling grid is toggled on or off. |
None |
OnSearchCreate |
When "SearchCreate" action is triggered (e.g., when pressing Ctrl+Shift+F). |
None |
OnSearchEdit |
When "SearchEdit" action is triggered (e.g., when pressing Ctrl+F). |
None |
OnServerToggle |
When server is created or destroyed fro the preview. |
None |
OnSubmodeChange |
When submode (e.g., BLUFOR or OFPOR for Objects, or Modules for Systems) changes. |
None |
OnSurfaceSnapToggle |
When surface snap settings are changed. |
None |
OnTerrainNew |
When new terrain is loaded. Executed also when Eden is opened. |
None |
OnToggleMapTextures |
When map textures are toggled on or off. |
None |
OnUndo |
When an operation is undone. |
None |
OnVerticalToggle |
When vertical mode settings are changed. |
None |
OnWidgetNone |
When no widget is selected. |
None |
OnWidgetRotation |
When rotation widget is selected. |
None |
OnWidgetScale |
When area scaling widget is selected. |
None |
OnWidgetToggle |
When widget is toggled (i.e., browsing through all widget types) |
None |
OnWidgetTranslation |
When translation widget is selected. |
None |
OnWorkspacePartSwitch |
When scenario phase is selected. |
None |
Object Event Handlers
Editor specific event handlers can be also added directly to objects, using addEventHandler command.
These handlers exist only for the duration of active workspace. Running a preview or loading the same scenario again will erase all object event handlers, because objects themselves are despawned from the world and then created again.
List
Most handlers don't receive any arguments. That is intended, because in most cases, required data can be obtained either using get3DENActionState, or by specialized 'get' commands.
Class | Description | Arguments |
---|---|---|
AttributesChanged3DEN |
When object's attributes are changed. Can happen when moving or rotating the object, when changing its attributes in attributes window, or when some scripts change attributes using set3DENAttributes command. |
[object]
|
ConnectionChanged3DEN |
When a connection is added or removed from an object. |
[object]
|
RegisteredToWorld3DEN |
When object is added to the scenario. That happens when you place it, but also when you paste it after copying, or when redoing placement operation after it was undone. |
[object]
|
UnregisteredFromWorld3DEN |
When object is removed from the scenario. That happens when you delete it, but also when you undo placement operation. |
[object]
|