ACE3/addons/spike/functions/fnc_keyDown.sqf
2021-12-12 01:26:40 -07:00

34 lines
674 B
Plaintext

#include "script_component.hpp"
/*
* Author: Brandon (TCVM)
* Handle key presses
*
* Arguments:
* 0: Key Pressed <NUMBER>
* 1: Down <BOOL>
*
* Return Value:
* None
*
* Example:
* [5, true] call ace_spike_keyDown;
*
* Public: No
*/
params ["_key", "_down"];
if (_key == SPIKE_KEY_DESIGNATE) then {
if (cameraView == "GUNNER") then {
playSound "ACE_Sound_Click";
};
private _designateInput = 0;
if (_down) then {
_designateInput = 1;
} else {
_designateInput = 0;
};
(uiNamespace getVariable "ACE_RscOptics_spike") setVariable [QGVAR(designate), _designateInput];
};
_this call FUNC(camera_handleKeyPress);