ACE3/addons/common/functions/fnc_setDisableUserInputStatus.sqf

28 lines
754 B
Plaintext
Raw Normal View History

2015-01-16 23:21:47 +00:00
/**
* fn_setDisableUserInputStatus.sqf
2015-01-16 23:21:47 +00:00
* @Descr: Disables the user input. Works stacked.
* @Author: Glowbal
*
* @Arguments: [id STRING, disable BOOL]
* @Return: void
* @PublicAPI: true
*/
#include "script_component.hpp"
private ["_id","_disable"];
_id = _this select 0;
_disable = _this select 1;
if (isnil QGVAR(DISABLE_USER_INPUT_COLLECTION_F)) then {
2015-01-18 19:09:19 +00:00
GVAR(DISABLE_USER_INPUT_COLLECTION_F) = [];
2015-01-16 23:21:47 +00:00
};
if (_disable) then {
2015-01-18 19:09:19 +00:00
GVAR(DISABLE_USER_INPUT_COLLECTION_F) pushback _id;
[true] call FUNC(disableUserInput);
2015-01-16 23:21:47 +00:00
} else {
2015-01-18 19:09:19 +00:00
GVAR(DISABLE_USER_INPUT_COLLECTION_F) = GVAR(DISABLE_USER_INPUT_COLLECTION_F) - [_id];
if (GVAR(DISABLE_USER_INPUT_COLLECTION_F) isEqualTo []) then {
[false] call FUNC(disableUserInput);
};
2015-01-16 23:21:47 +00:00
};