DAGR now supports the new multiple devices framework

This commit is contained in:
ulteq 2015-06-14 09:59:06 +02:00
parent 48d8d5e076
commit 906e365b94
4 changed files with 36 additions and 1 deletions

View File

@ -1,5 +1,7 @@
#include "script_component.hpp"
if (!hasInterface) exitWith {};
#include "initKeybinds.sqf"
GVAR(outputPFH) = -1;

View File

@ -69,7 +69,7 @@ GVAR(showOutOfSpace) = false;
GVAR(PWR) = false;
GVAR(menuRun) = true;
[{
if (!dialog || GVAR(PWR)) exitWith {
if (!dialog || GVAR(PWR) || !GVAR(menuRun)) exitWith {
closeDialog 266860;
GVAR(menuRun) = false;
[_this select 1] call CBA_fnc_removePerFrameHandler;

View File

@ -17,6 +17,10 @@
GVAR(run) = !GVAR(run);
if (GVAR(run)) then {
if (GVAR(menuRun) && dialog) then {
GVAR(menuRun) = false;
closeDialog 0;
};
GVAR(hidden) = true;
[{
EXPLODE_1_PVT(_this select 0,_vehicle);

View File

@ -28,3 +28,32 @@
},
{false},
[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);