mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
add option to only use action when clicking
This commit is contained in:
parent
e207a11851
commit
664d08d4aa
@ -32,8 +32,7 @@ addMissionEventHandler ["Draw3D", DFUNC(render)];
|
|||||||
if !([ACE_player, objNull, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering"]] call EFUNC(common,canInteractWith)) exitWith {false};
|
if !([ACE_player, objNull, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering"]] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||||
// Statement
|
// Statement
|
||||||
[0] call FUNC(keyDown)
|
[0] call FUNC(keyDown)
|
||||||
},
|
},{[0,false] call FUNC(keyUp)},
|
||||||
{[0] call FUNC(keyUp)},
|
|
||||||
[219, [false, false, false]], false] call cba_fnc_addKeybind; //Left Windows Key
|
[219, [false, false, false]], false] call cba_fnc_addKeybind; //Left Windows Key
|
||||||
|
|
||||||
["ACE3", QGVAR(SelfInteractKey), (localize "STR_ACE_Interact_Menu_SelfInteractKey"),
|
["ACE3", QGVAR(SelfInteractKey), (localize "STR_ACE_Interact_Menu_SelfInteractKey"),
|
||||||
@ -42,8 +41,7 @@ addMissionEventHandler ["Draw3D", DFUNC(render)];
|
|||||||
if !([ACE_player, objNull, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering"]] call EFUNC(common,canInteractWith)) exitWith {false};
|
if !([ACE_player, objNull, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering"]] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||||
// Statement
|
// Statement
|
||||||
[1] call FUNC(keyDown)
|
[1] call FUNC(keyDown)
|
||||||
},
|
},{[1,false] call FUNC(keyUp)},
|
||||||
{[1] call FUNC(keyUp)},
|
|
||||||
[219, [false, true, false]], false] call cba_fnc_addKeybind; //Left Windows Key + Ctrl/Strg
|
[219, [false, true, false]], false] call cba_fnc_addKeybind; //Left Windows Key + Ctrl/Strg
|
||||||
|
|
||||||
|
|
||||||
|
@ -42,25 +42,31 @@ class ACE_Settings {
|
|||||||
typeName = "COLOR";
|
typeName = "COLOR";
|
||||||
isClientSettable = 1;
|
isClientSettable = 1;
|
||||||
displayName = "$STR_ACE_Interact_Menu_ColorTextMax";
|
displayName = "$STR_ACE_Interact_Menu_ColorTextMax";
|
||||||
};
|
};
|
||||||
class GVAR(colorTextMin) {
|
class GVAR(colorTextMin) {
|
||||||
value[] = {1, 1, 1, 0.25};
|
value[] = {1, 1, 1, 0.25};
|
||||||
typeName = "COLOR";
|
typeName = "COLOR";
|
||||||
isClientSettable = 1;
|
isClientSettable = 1;
|
||||||
displayName = "$STR_ACE_Interact_Menu_ColorTextMin";
|
displayName = "$STR_ACE_Interact_Menu_ColorTextMin";
|
||||||
};
|
};
|
||||||
class GVAR(colorShadowMax) {
|
class GVAR(colorShadowMax) {
|
||||||
value[] = {0, 0, 0, 1};
|
value[] = {0, 0, 0, 1};
|
||||||
typeName = "COLOR";
|
typeName = "COLOR";
|
||||||
isClientSettable = 1;
|
isClientSettable = 1;
|
||||||
displayName = "$STR_ACE_Interact_Menu_ColorShadowMax";
|
displayName = "$STR_ACE_Interact_Menu_ColorShadowMax";
|
||||||
};
|
};
|
||||||
class GVAR(colorShadowMin) {
|
class GVAR(colorShadowMin) {
|
||||||
value[] = {0, 0, 0, 0.25};
|
value[] = {0, 0, 0, 0.25};
|
||||||
typeName = "COLOR";
|
typeName = "COLOR";
|
||||||
isClientSettable = 1;
|
isClientSettable = 1;
|
||||||
displayName = "$STR_ACE_Interact_Menu_ColorShadowMin";
|
displayName = "$STR_ACE_Interact_Menu_ColorShadowMin";
|
||||||
};
|
};
|
||||||
|
class GVAR(actionOnKeyRelease) {
|
||||||
|
value = 1;
|
||||||
|
typeName = "BOOL";
|
||||||
|
isClientSettable = 1;
|
||||||
|
displayName = "$STR_ACE_Interact_Menu_ActionOnKeyRelease";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
class ACE_Extensions {
|
class ACE_Extensions {
|
||||||
|
@ -15,7 +15,11 @@ EXPLODE_2_PVT(_this,_newUnit,_oldUnit);
|
|||||||
|
|
||||||
// add to new unit
|
// add to new unit
|
||||||
private "_ehid";
|
private "_ehid";
|
||||||
_ehid = [_newUnit, "DefaultAction", {EGVAR(interact_menu,openedMenuType) >= 0}, {}] call EFUNC(common,addActionEventHandler);
|
_ehid = [_newUnit, "DefaultAction", {GVAR(openedMenuType) >= 0}, {
|
||||||
|
if !(GVAR(actionOnKeyRelease)) then {
|
||||||
|
[GVAR(openedMenuType),true] call FUNC(keyUp);
|
||||||
|
};
|
||||||
|
}] call EFUNC(common,addActionEventHandler);
|
||||||
|
|
||||||
_newUnit setVariable [QGVAR(AAEHID), _ehid];
|
_newUnit setVariable [QGVAR(AAEHID), _ehid];
|
||||||
|
|
||||||
|
@ -12,6 +12,9 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
private "_calledByClicking";
|
||||||
|
_calledByClicking = _this select 1;
|
||||||
|
|
||||||
// Exit if there's no menu opened
|
// Exit if there's no menu opened
|
||||||
if (GVAR(openedMenuType) < 0) exitWith {true};
|
if (GVAR(openedMenuType) < 0) exitWith {true};
|
||||||
|
|
||||||
@ -29,6 +32,9 @@ if(GVAR(actionSelected)) then {
|
|||||||
// Clear the conditions caches
|
// Clear the conditions caches
|
||||||
["clearConditionCaches", []] call EFUNC(common,localEvent);
|
["clearConditionCaches", []] call EFUNC(common,localEvent);
|
||||||
|
|
||||||
|
// exit scope if selecting an action on key release is disabled
|
||||||
|
if (!(GVAR(actionOnKeyRelease)) && !_calledByClicking) exitWith {};
|
||||||
|
|
||||||
// Check the action conditions
|
// Check the action conditions
|
||||||
_actionData = GVAR(selectedAction) select 0;
|
_actionData = GVAR(selectedAction) select 0;
|
||||||
if ([_target, _player, _actionData select 6] call (_actionData select 4)) then {
|
if ([_target, _player, _actionData select 6] call (_actionData select 4)) then {
|
||||||
|
@ -83,5 +83,9 @@
|
|||||||
<Key ID="STR_ACE_Interact_Menu_ColorShadowMin">
|
<Key ID="STR_ACE_Interact_Menu_ColorShadowMin">
|
||||||
<English>Interaction - Shadow Min</English>
|
<English>Interaction - Shadow Min</English>
|
||||||
</Key>
|
</Key>
|
||||||
|
<Key ID="STR_ACE_Interact_Menu_ActionOnKeyRelease">
|
||||||
|
<English>Do action when releasing menu key</English>
|
||||||
|
<German>Aktion nach Loslassen der Taste ausführen</German>
|
||||||
|
</Key>
|
||||||
</Package>
|
</Package>
|
||||||
</Project>
|
</Project>
|
||||||
|
Loading…
Reference in New Issue
Block a user