isUIContext: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "(\| * )+\}\}" to "}}")
m (Text replacement - " {3,}\|" to " |")
Line 7: Line 7:


|gr2= Program Flow
|gr2= Program Flow


| Returns [[true]] if the script originated from some UI control event, for example from "onButtonDown" EH. Exists within parent scope and immediate child scopes.
| Returns [[true]] if the script originated from some UI control event, for example from "onButtonDown" EH. Exists within parent scope and immediate child scopes.
Line 14: Line 13:


| [[Boolean]]
| [[Boolean]]


|x1= <code>[[if]] ([[isUIContext]]) [[then]] {[[hint]] "UI control event"};</code>
|x1= <code>[[if]] ([[isUIContext]]) [[then]] {[[hint]] "UI control event"};</code>

Revision as of 18:43, 18 January 2021

Hover & click on the images for description

Description

Description:
Returns true if the script originated from some UI control event, for example from "onButtonDown" EH. Exists within parent scope and immediate child scopes.
Groups:
GUI ControlProgram Flow

Syntax

Syntax:
isUIContext
Return Value:
Boolean

Examples

Example 1:
if (isUIContext) then {hint "UI control event"};
Example 2:
_button ctrlSetEventHandler ['ButtonDown',"call {diag_log isUIContext}"]; // Outputs true
Example 3:
_button ctrlSetEventHandler ['ButtonDown',"[] spawn {diag_log isUIContext}"]; // Outputs false

Additional Information

See also:
canSuspendisRemoteExecutedisRemoteExecutedJIPisGamePausedisGameFocusedserverCommand

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