ACE3/addons/arsenal/functions/fnc_attributeKeyDown.sqf
jonpas 742626ff1a
General - Relative script_component.hpp includes (#9378)
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2023-09-12 20:58:10 +02:00

45 lines
956 B
Plaintext

#include "..\script_component.hpp"
#include "\a3\ui_f\hpp\defineDIKCodes.inc"
/*
* Author: mharis001
* Handles keyboard input for the 3DEN's ace arsenal attribute.
*
* Arguments:
* 0: Display <DISPLAY>
* 1: Key code <NUMBER>
*
* Return Value:
* Handled <BOOL>
*
* Example:
* [DISPLAY, 0] call ace_arsenal_fnc_attributeKeyDown
*
* Public: No
*/
params ["_display", "_keyCode"];
TRACE_2("Attribute key down",_display,_keyCode);
// Exit if attribute is not in focus
private _controlsGroup = uiNamespace getVariable [QGVAR(attributeFocus), controlNull];
if (isNull _controlsGroup) exitWith {false};
switch (_keyCode) do {
// Unselect item
case DIK_LEFT;
case DIK_NUMPADMINUS: {
[_controlsGroup, false] call FUNC(attributeSelect);
true
};
// Select item
case DIK_RIGHT;
case DIK_NUMPADPLUS: {
[_controlsGroup, true] call FUNC(attributeSelect);
true
};
default {false};
};