isUIContext: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "_{10,} " to "")
m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments( \("local" or "global"\))?|Effects|Multiplayer Effects( \("local" or "global"\))?|Multiplayer Exe...)
Line 1: Line 1:
{{Command|Comments=
{{Command


| arma3 |Game name=
| arma3
|1.76|Game version=
|1.76


|gr1= GUI Control |GROUP1=
|gr1= GUI Control


|gr2= Program Flow |GROUP2=
|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. |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.


|  '''isUIContext''' |SYNTAX=
|  '''isUIContext'''


| [[Boolean]] |RETURNVALUE=
| [[Boolean]]




|x1= <code>[[if]] ([[isUIContext]]) [[then]] {[[hint]] "UI control event"};</code>|EXAMPLE1=
|x1= <code>[[if]] ([[isUIContext]]) [[then]] {[[hint]] "UI control event"};</code>
|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>
|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>


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


|  |MPBEHAVIOUR=  
|  |MPBEHAVIOUR=  

Revision as of 01:41, 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

Notes

Bottom Section