mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
742626ff1a
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
45 lines
956 B
Plaintext
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};
|
|
};
|