isUIContext: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\{\{GameCategory\|(arma[0123])\|[ _]?New[ _]Scripting[ _]Commands[ _]List\}\}" to "{{GameCategory|$1|New Scripting Commands}}")
m (Text replacement - "_{10,} " to "")
Line 1: Line 1:
{{Command|Comments=
{{Command|Comments=
____________________________________________________________________________________________


| arma3 |Game name=
| arma3 |Game name=
Line 9: Line 8:
|gr2= Program Flow |GROUP2=
|gr2= Program Flow |GROUP2=


____________________________________________________________________________________________


| Returns [[true]] if the script originated from some UI control event, for example from "onButtonDown" EH. Exists within parent scope and immediate child scopes. |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. |DESCRIPTION=
____________________________________________________________________________________________


|  '''isUIContext'''  |SYNTAX=
|  '''isUIContext'''  |SYNTAX=
Line 22: Line 19:
|x2= <code>_button [[ctrlSetEventHandler]] ['ButtonDown',"[[call]] {[[diag_log]] [[isUIContext]]}"]; // Outputs true</code>|EXAMPLE2=
|x2= <code>_button [[ctrlSetEventHandler]] ['ButtonDown',"[[call]] {[[diag_log]] [[isUIContext]]}"]; // Outputs true</code>|EXAMPLE2=
|x3= <code>_button [[ctrlSetEventHandler]] ['ButtonDown',"[] [[spawn]] {[[diag_log]] [[isUIContext]]}"]; // Outputs false</code>|EXAMPLE3=
|x3= <code>_button [[ctrlSetEventHandler]] ['ButtonDown',"[] [[spawn]] {[[diag_log]] [[isUIContext]]}"]; // Outputs false</code>|EXAMPLE3=
____________________________________________________________________________________________


| [[canSuspend]], [[isRemoteExecuted]], [[isRemoteExecutedJIP]], [[isGamePaused]], [[isGameFocused]], [[serverCommand]] |SEEALSO=  
| [[canSuspend]], [[isRemoteExecuted]], [[isRemoteExecutedJIP]], [[isGamePaused]], [[isGameFocused]], [[serverCommand]] |SEEALSO=  


|  |MPBEHAVIOUR=  
|  |MPBEHAVIOUR=  
____________________________________________________________________________________________
}}
}}



Revision as of 02:36, 17 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

Notes

Bottom Section