diff --git a/addons/common/fnc_keyPressedQTE.sqf b/addons/common/fnc_keyPressedQTE.sqf index b3825eb42..14ee20a1b 100644 --- a/addons/common/fnc_keyPressedQTE.sqf +++ b/addons/common/fnc_keyPressedQTE.sqf @@ -12,7 +12,7 @@ Example: ["↑"] call CBA_fnc_keyPressedQTE; Returns: - None + - True if QTE is running Author: john681611 @@ -21,8 +21,9 @@ Author: params ["_eventQTE"]; -if !(missionNamespace getVariable [QGVAR(QTERunning), false]) exitWith {}; -if !(_eventQTE in ["↑", "↓", "→", "←"]) exitWith {}; +if !(missionNamespace getVariable [QGVAR(QTERunning), false]) exitWith { + false +}; private _args = GVAR(QTEArgs) get "args"; @@ -42,6 +43,7 @@ if (GVAR(QTEHistory) isEqualTo _qteSequence) exitWith { } else { [_args, _elapsedTime] call _onFinish; }; + true }; if (GVAR(QTEHistory) isNotEqualTo (_qteSequence select [0, count GVAR(QTEHistory)])) then { @@ -54,3 +56,5 @@ if (_onDisplay isEqualType "") then { } else { [_args, _qteSequence, GVAR(QTEHistory)] call _onDisplay; }; + +true diff --git a/addons/common/fnc_runQTE.sqf b/addons/common/fnc_runQTE.sqf index f215c9305..9c8b3c569 100644 --- a/addons/common/fnc_runQTE.sqf +++ b/addons/common/fnc_runQTE.sqf @@ -8,12 +8,12 @@ Description: Parameters: _object - _args - Extra arguments passed to the _on... functions - _onDisplay - Code callback on displayable event passed [_args, _qte_sequence, _qte_history]. + _onDisplay - Code callback on displayable event passed [_args, _qte_sequence, _qte_history]. _onFinish - Code callback on Quick-Time Event completed passed [_args, _elapsedTime]. _onFinish - Code callback on Quick-Time Event timeout/outranged passed [_args, _elapsedTime]. - _qte_sequence - Quick-Time sequence made up of ["↑", "↓", "→", "←"] - _max_distance - max interaction distance from attached object (default: 10) - _timeout - ingame timeout (default: 30) + _qte_sequence - Quick-Time sequence made up of ["↑", "↓", "→", "←"] + _max_distance - max interaction distance from attached object (default: 10) + _timeout - ingame timeout (default: 30) Example: [car, @@ -34,7 +34,7 @@ Example: ["↑", "↓", "→", "←"]] call CBA_fnc_runQTE Returns: - Nil + - True if the QTE was started, false if it was already running. Author: john681611 @@ -83,7 +83,7 @@ GVAR(QTEArgs) = createHashMapFromArray _qteArgsArray; } else { [_args, _elapsedTime] call _onFail; }; -}, _this] call CBA_fnc_waitUntilAndExecute; +}, []] call CBA_fnc_waitUntilAndExecute; if (_onDisplay isEqualType "") then { [_onDisplay, [_args, _qte_sequence, []]] call CBA_fnc_localEvent;