ACE3/addons/dagr/initKeybinds.sqf

60 lines
1.8 KiB
Plaintext
Raw Normal View History

["ACE3 Equipment", QGVAR(MenuKey), "Configure DAGR",
{
// Conditions: canInteract
if !([ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {false};
2015-06-13 19:29:34 +00:00
if !([ACE_player, "ACE_DAGR"] call EFUNC(common,hasItem)) exitWith {false};
// Statement
if (!GVAR(menuRun)) then {
[] call FUNC(menuInit);
} else {
GVAR(PWR) = true; // Simulate pressing the power button
};
true
},
{false},
2015-11-30 15:45:20 +00:00
[0, [false, true, false]], false] call CBA_fnc_addKeybind; // (empty default key)
["ACE3 Equipment", QGVAR(ToggleKey), "Toggle DAGR",
{
// Conditions: canInteract
if !([ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {false};
2015-06-13 19:29:34 +00:00
if !([ACE_player, "ACE_DAGR"] call EFUNC(common,hasItem)) exitWith {false};
// Statement
[] call FUNC(toggleOverlay);
true
},
{false},
2015-11-30 15:45:20 +00:00
[0, [false, false, false]], false] call CBA_fnc_addKeybind; // (empty default key)
//Add deviceKey entry:
private ["_conditonCode", "_toggleCode", "_closeCode"];
_conditonCode = {
([ACE_player, "ACE_DAGR"] call EFUNC(common,hasItem));
};
_toggleCode = {
// Conditions: canInteract
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {};
// Statement
[] call FUNC(toggleOverlay);
if (!GVAR(run)) then {
[] call FUNC(menuInit);
};
};
_closeCode = {
// Statement
if (GVAR(run)) then {
//If dispaly is open, close it:
[] call FUNC(toggleOverlay);
};
if (dialog && GVAR(menuRun)) then {
//If dialog is open, close it:
GVAR(menuRun) = false;
closeDialog 0;
};
};
["DAGR", QUOTE(PATHTOF(UI\DAGR_Icon.paa)), _conditonCode, _toggleCode, _closeCode] call EFUNC(common,deviceKeyRegisterNew);