mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge branch 'master' of https://github.com/KoffeinFlummi/ACE3
This commit is contained in:
commit
43560edd6e
@ -1,14 +1,16 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
*
|
||||
* Disables key input. ESC can still be pressed to open the menu.
|
||||
*
|
||||
* Argument:
|
||||
* 0: True to disable key inputs, false to re-enable them (Bool)
|
||||
* Arguments:
|
||||
* 0: True to disable key inputs, false to re-enable them <BOOL>
|
||||
*
|
||||
* Return value:
|
||||
* Nothing
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_state", "_dlg"];
|
||||
@ -22,10 +24,12 @@ if (_state) then {
|
||||
if ("ACE_DisableUserInput" in ([BIS_stackedEventHandlers_onEachFrame, {_this select 0}] call FUNC(map))) exitWith {};
|
||||
|
||||
// end TFAR and ACRE2 radio transmissions
|
||||
0 spawn FUNC(endRadioTransmission);
|
||||
call FUNC(endRadioTransmission);
|
||||
|
||||
// Close map
|
||||
if (visibleMap && {!(player getVariable ["ACE_canSwitchUnits", false])}) then {openMap false};
|
||||
if (visibleMap && {!(player getVariable ["ACE_canSwitchUnits", false])}) then {
|
||||
openMap false;
|
||||
};
|
||||
|
||||
closeDialog 0;
|
||||
createDialog QGVAR(DisableMouse_Dialog);
|
||||
@ -62,9 +66,22 @@ if (_state) then {
|
||||
_ctrl ctrlSetTooltip "Respawn.";
|
||||
};
|
||||
|
||||
if (_key in actionKeys "TeamSwitch" && {teamSwitchEnabled}) then {(uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) closeDisplay 0; teamSwitch};//_acc = accTime; teamSwitch; setAccTime _acc};
|
||||
if (_key in actionKeys "CuratorInterface" && {getAssignedCuratorLogic player in allCurators}) then {(uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) closeDisplay 0; openCuratorInterface};
|
||||
if (_key in actionKeys "ShowMap" && {player getVariable ["ACE_canSwitchUnits", false]}) then {(uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) closeDisplay 0; openMap true};
|
||||
if (_key in actionKeys "TeamSwitch" && {teamSwitchEnabled}) then {
|
||||
(uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) closeDisplay 0;
|
||||
_acc = accTime;
|
||||
teamSwitch;
|
||||
setAccTime _acc;
|
||||
};
|
||||
|
||||
if (_key in actionKeys "CuratorInterface" && {getAssignedCuratorLogic player in allCurators}) then {
|
||||
(uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) closeDisplay 0;
|
||||
openCuratorInterface;
|
||||
};
|
||||
|
||||
if (_key in actionKeys "ShowMap" && {player getVariable ["ACE_canSwitchUnits", false]}) then {
|
||||
(uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) closeDisplay 0;
|
||||
openMap true;
|
||||
};
|
||||
|
||||
if (serverCommandAvailable "#missions" || {player getVariable ["ACE_isUnconscious", false] && {(call FUNC(player)) getVariable [QEGVAR(medical,AllowChatWhileUnconscious), missionNamespace getVariable [QEGVAR(medical,AllowChatWhileUnconscious), false]]}}) then {
|
||||
if (!(_key in (actionKeys "DefaultAction" + actionKeys "Throw")) && {_key in (actionKeys "Chat" + actionKeys "PrevChannel" + actionKeys "NextChannel")}) then {
|
||||
@ -74,6 +91,7 @@ if (_state) then {
|
||||
|
||||
_key > 0
|
||||
}];
|
||||
|
||||
_dlg displayAddEventHandler ["KeyUp", {true}];
|
||||
|
||||
["ACE_DisableUserInput", "onEachFrame", {
|
||||
@ -82,6 +100,7 @@ if (_state) then {
|
||||
[true] call FUNC(disableUserInput);
|
||||
};
|
||||
}] call BIS_fnc_addStackedEventHandler;
|
||||
|
||||
} else {
|
||||
if ("ACE_DisableUserInput" in ([BIS_stackedEventHandlers_onEachFrame, {_this select 0}] call FUNC(map))) then {
|
||||
["ACE_DisableUserInput", "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
|
||||
|
7
addons/interact_menu/CfgActions.hpp
Normal file
7
addons/interact_menu/CfgActions.hpp
Normal file
@ -0,0 +1,7 @@
|
||||
|
||||
class CfgActions {
|
||||
class None;
|
||||
class OpenBag: None {
|
||||
showWindow = 0;
|
||||
};
|
||||
};
|
@ -14,6 +14,8 @@ class CfgPatches {
|
||||
|
||||
#include "CfgEventHandlers.hpp"
|
||||
|
||||
#include "CfgActions.hpp"
|
||||
|
||||
#include "CursorMenus.hpp"
|
||||
|
||||
class ACE_Settings {
|
||||
|
@ -37,8 +37,10 @@ _unit setUnconscious true;
|
||||
|
||||
if (_unit == ACE_player) then {
|
||||
if (visibleMap) then {openMap false};
|
||||
while {dialog} do {
|
||||
closeDialog 0;
|
||||
};
|
||||
};
|
||||
|
||||
// if we have unconsciousness for AI disabled, we will kill the unit instead
|
||||
if (!([_unit] call EFUNC(common,IsPlayer)) && (GVAR(enableUnsconsiousnessAI) == 0 || (GVAR(enableUnsconsiousnessAI) == 2 && random(1) <= 0.5))) exitwith {
|
||||
|
Loading…
Reference in New Issue
Block a user