isUIContext: Difference between revisions
Jump to navigation
Jump to search
Killzone Kid (talk | contribs) (see also) |
m (template:command argument fix) |
||
Line 12: | Line 12: | ||
| '''isUIContext''' |= Syntax | | '''isUIContext''' |= Syntax | ||
| [[Boolean]] |= | | [[Boolean]] |RETURNVALUE= | ||
|x1= <code>[[if]] ([[isUIContext]]) [[then]] {[[hint]] "UI control event"};</code>|= | |x1= <code>[[if]] ([[isUIContext]]) [[then]] {[[hint]] "UI control event"};</code>|EXAMPLE1= | ||
|x2= <code>_button [[ctrlSetEventHandler]] ['ButtonDown',"[[call]] {[[diag_log]] [[isUIContext]]}"]; // Outputs true</code>|= | |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>|= | |x3= <code>_button [[ctrlSetEventHandler]] ['ButtonDown',"[] [[spawn]] {[[diag_log]] [[isUIContext]]}"]; // Outputs false</code>|EXAMPLE3= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| [[canSuspend]], [[isRemoteExecuted]], [[isRemoteExecutedJIP]], [[serverCommand]] |= | | [[canSuspend]], [[isRemoteExecuted]], [[isRemoteExecutedJIP]], [[serverCommand]] |SEEALSO= | ||
| |= | | |MPBEHAVIOUR= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
}} | }} |
Revision as of 10:34, 7 April 2019
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:
- Uncategorised
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