mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Added hold and release functionality for CMS menu.
This commit is contained in:
parent
920453e150
commit
5745408647
@ -51,14 +51,41 @@ call FUNC(handleDisplayEffects);
|
||||
|
||||
|
||||
// Keybindings
|
||||
GVAR(keyPressed) = false;
|
||||
|
||||
["ACE3",
|
||||
localize "STR_ACE_OPEN_CMS_MENU_DESC",
|
||||
{ [] call FUNC(openMenu) },
|
||||
{ if (!GVAR(keyPressed)) then {
|
||||
GVAR(keyPressed) = true;
|
||||
GVAR(timeMenuOpened) = time;
|
||||
[] call FUNC(openMenu);
|
||||
|
||||
true;
|
||||
} else {
|
||||
false;
|
||||
};
|
||||
},
|
||||
[ 0, [false, false, false]],
|
||||
false,
|
||||
"keydown"] call cba_fnc_registerKeybind;
|
||||
|
||||
["ACE3",
|
||||
localize "STR_ACE_OPEN_CMS_MENU_DESC",
|
||||
{
|
||||
GVAR(keyPressed) = false;
|
||||
if (time - GVAR(timeMenuOpened) >= (0.25*accTime)) then {
|
||||
disableSerialization;
|
||||
_display = uiNamespace getVariable QGVAR(medicalMenu);
|
||||
if (!isnil "_display") then {
|
||||
closeDialog 314412;
|
||||
};
|
||||
};
|
||||
false;
|
||||
},
|
||||
[ 0, [false, false, false]],
|
||||
false,
|
||||
"keyUp"] call cba_fnc_registerKeybind;
|
||||
|
||||
|
||||
|
||||
// Adding the treatment options for all available medical equipment.
|
||||
|
@ -72,4 +72,6 @@ setMousePosition [ 0.4, 0.4];
|
||||
((_this select 0) displayCtrl 2000) ctrlSetText (_status select 0);
|
||||
((_this select 0) displayCtrl 2000) ctrlSetBackgroundColor (_status select 2);
|
||||
|
||||
}, [_display]] call BIS_fnc_addStackedEventHandler;
|
||||
}, [_display]] call BIS_fnc_addStackedEventHandler;
|
||||
|
||||
["Medical_onMenuOpen", [ACE_player, _interactionTarget]] call ace_common_fnc_localEvent;
|
||||
|
@ -10,6 +10,18 @@
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
|
||||
if (dialog) exitwith {
|
||||
disableSerialization;
|
||||
|
||||
private "_display";
|
||||
_display = uiNamespace getVariable QGVAR(medicalMenu);
|
||||
if (!isnil "_display") then {
|
||||
closeDialog 314412;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
private ["_interactionTarget"];
|
||||
_interactionTarget = objNull;
|
||||
if (count _this > 0) then {
|
||||
@ -30,5 +42,3 @@ if (isNull _interactionTarget) then {
|
||||
};
|
||||
GVAR(INTERACTION_TARGET) = _interactionTarget;
|
||||
createDialog QGVAR(medicalMenu);
|
||||
|
||||
["Medical_onMenuOpened", [ACE_player, _interactionTarget]] call ace_common_fnc_localEvent;
|
||||
|
@ -18,8 +18,6 @@ _bodyPartN = [_bodyPartText] call FUNC(getBodyPartNumber);
|
||||
|
||||
if (_bodyPartN < 0 || _bodyPartN > 5) exitwith {};
|
||||
|
||||
systemChat format["updateUIInfo %1", _this];
|
||||
|
||||
_openWounds = [_targetObj,QGVAR(openWounds)] call EFUNC(common,getDefinedVariable);
|
||||
_bandagedWounds = [_targetObj,QGVAR(bandagedWounds)] call EFUNC(common,getDefinedVariable);
|
||||
_fractures = [_targetObj,QGVAR(fractures)] call EFUNC(common,getDefinedVariable);
|
||||
|
Loading…
Reference in New Issue
Block a user