getEventHandlerInfo: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (Text replacement - "\|branch= *dev " to "")
 
(8 intermediate revisions by 3 users not shown)
Line 3: Line 3:
|game1= arma3
|game1= arma3
|version1= 2.10
|version1= 2.10
|branch= dev


|gr1= Event Handlers
|gr1= Event Handlers


|descr= Queries given event handler and returns [[Array]] in format [exists, isLast, total] or empty array [], where:
|descr= Queries given event handler's information.
* exists: [[Boolean]] - event handler exists
 
* isLast: [[Boolean]] - will be executed last (relevant if last event handler modifies default engine behaviour)
|s1= oper [[getEventHandlerInfo]] [type, id]
* total: [[Number]] - total number of event handlers added to the same event


|p1= oper: [[Object]], [[Group]], [[Control]] or [[Display]] - subject to which event handler is assigned


|s1= object [[getEventHandlerInfo]] [type, id]
|p2= type: [[String]] - event handler name


|p1= object: [[Object]] - entity to which event handler is assigned
|p3= id: [[Number]] - event handler id returned by [[addEventHandler]], [[ctrlAddEventHandler]], [[displayAddEventHandler]], or [[addMPEventHandler]]


|p2= type: [[String]] - event handler name
|r1= [[Array]] in format [exists, isLast, total] or empty array [], where:
* exists: [[Boolean]] - event handler exists
* isLast: [[Boolean]] - will be executed last (relevant if last event handler modifies default engine behaviour)
* total: [[Number]] - total number of event handlers added to the same event


|p3= id: [[Number]] - event handler id returned by [[addEventHandler]] or [[addMPEventHandler]]
|s2= [[getEventHandlerInfo]] [type, id]


|r1= [[Array]] - see description
|p21= type: [[String]] - event handler name


|p22= id: [[Number]] - event handler id returned by [[addMissionEventHandler]] or [[addMusicEventHandler]]


|s2= object [[getEventHandlerInfo]] [type, id]
|r2= [[Array]] in format [exists, isLast, total] or empty array [], where:
* exists: [[Boolean]] - event handler exists
* isLast: [[Boolean]] - will be executed last (relevant if last event handler modifies default engine behaviour)
* total: [[Number]] - total number of event handlers added to the same event


|p21= object: [[Object]] - entity to which event handler is assigned
|x1= <sqf>private _info = player getEventHandlerInfo ["MPKilled", 1]; // object EH</sqf>


|p22= type: [[String]] - event handler name
|x2= <sqf>private _info = getEventHandlerInfo ["EachFrame", 0]; // mission EH</sqf>


|p23= id: [[Number]]  - event handler id returned by [[addMissionEventHandler]] or [[addMusicEventHandler]]
|x3= <sqf>private _info = _bullet getEventHandlerInfo ["Deflected", 0]; // projectile EH</sqf>


|r2= [[Array]] - see description
|x4= <sqf>private _info = _group getEventHandlerInfo ["EnemyDetected", 1]; // group EH</sqf>


|x1= <sqf>_info = player getEventHandlerInfo ["MPKilled", 1];</sqf>
|x5= <sqf>private _info = _control getEventHandlerInfo ["ButtonClick", 1]; // control (UI) EH</sqf>
|x2= <sqf>_info = getEventHandlerInfo ["EachFrame", 0];</sqf>


|seealso= [[addMPEventHandler]] [[addEventHandler]] [[addMissionEventHandler]] [[addMusicEventHandler]]
|seealso= [[addEventHandler]] [[ctrlAddEventHandler]] [[displayAddEventHandler]] [[addMPEventHandler]] [[addMissionEventHandler]] [[addMusicEventHandler]]
}}
}}

Latest revision as of 13:23, 23 August 2022

Hover & click on the images for description

Description

Description:
Queries given event handler's information.
Groups:
Event Handlers

Syntax

Syntax:
oper getEventHandlerInfo [type, id]
Parameters:
oper: Object, Group, Control or Display - subject to which event handler is assigned
type: String - event handler name
id: Number - event handler id returned by addEventHandler, ctrlAddEventHandler, displayAddEventHandler, or addMPEventHandler
Return Value:
Array in format [exists, isLast, total] or empty array [], where:
  • exists: Boolean - event handler exists
  • isLast: Boolean - will be executed last (relevant if last event handler modifies default engine behaviour)
  • total: Number - total number of event handlers added to the same event

Alternative Syntax

Syntax:
getEventHandlerInfo [type, id]
Parameters:
type: String - event handler name
id: Number - event handler id returned by addMissionEventHandler or addMusicEventHandler
Return Value:
Array in format [exists, isLast, total] or empty array [], where:
  • exists: Boolean - event handler exists
  • isLast: Boolean - will be executed last (relevant if last event handler modifies default engine behaviour)
  • total: Number - total number of event handlers added to the same event

Examples

Example 1:
private _info = player getEventHandlerInfo ["MPKilled", 1]; // object EH
Example 2:
private _info = getEventHandlerInfo ["EachFrame", 0]; // mission EH
Example 3:
private _info = _bullet getEventHandlerInfo ["Deflected", 0]; // projectile EH
Example 4:
private _info = _group getEventHandlerInfo ["EnemyDetected", 1]; // group EH
Example 5:
private _info = _control getEventHandlerInfo ["ButtonClick", 1]; // control (UI) EH

Additional Information

See also:
addEventHandler ctrlAddEventHandler displayAddEventHandler addMPEventHandler addMissionEventHandler addMusicEventHandler

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note