isUIContext: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "\{\{GameCategory\|(arma[0123])\|[ _]?New[ _]Scripting[ _]Commands[ _]List\}\}" to "{{GameCategory|$1|New Scripting Commands}}") |
Lou Montana (talk | contribs) 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 01:36, 17 January 2021
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
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