From 129ca56f664f24e16a3712bcebaefbcfb7baaa98 Mon Sep 17 00:00:00 2001 From: Lachlan Sneddon Date: Mon, 1 Jun 2020 18:28:51 +1200 Subject: [PATCH 1/4] add carry keybind --- addons/dragging/XEH_postInit.sqf | 24 ++++++++++++++++++++++++ addons/dragging/stringtable.xml | 3 +++ 2 files changed, 27 insertions(+) diff --git a/addons/dragging/XEH_postInit.sqf b/addons/dragging/XEH_postInit.sqf index f6521622255..e7dd54aaa61 100644 --- a/addons/dragging/XEH_postInit.sqf +++ b/addons/dragging/XEH_postInit.sqf @@ -56,3 +56,27 @@ if (isNil "ACE_maxWeightCarry") then { }, { false }, [-1, [false, false, false]]] call CBA_fnc_addKeybind; // UNBOUND + +["ACE3 Common", QGVAR(carry), (localize LSTRING(CarryKeybind)), { + if (!alive ACE_player) exitWith {false}; + if !([ACE_player, objNull, ["isNotDragging", "isNotCarrying"]] call EFUNC(common,canInteractWith)) exitWith {false}; + + // If we are drag/carrying something right now then just drop it: + if (ACE_player getVariable [QGVAR(isDragging), false]) exitWith { + [ACE_player, ACE_player getVariable [QGVAR(draggedObject), objNull]] call FUNC(dropObject); + false + }; + if (ACE_player getVariable [QGVAR(isCarrying), false]) exitWith { + [ACE_player, ACE_player getVariable [QGVAR(carriedObject), objNull]] call FUNC(dropObject_carry); + false + }; + + private _cursor = cursorObject; + if ((isNull _cursor) || {(_cursor distance ACE_player) > 2.6}) exitWith {false}; + if (!([ACE_player, _cursor] call FUNC(canDrag))) exitWith {false}; + + [ACE_player, _cursor] call FUNC(startCarry); + false +}, { + false +}, [-1, [false, false, false]]] call CBA_fnc_addKeybind; // UNBOUND diff --git a/addons/dragging/stringtable.xml b/addons/dragging/stringtable.xml index 4dc245d98ed..31635ed489a 100644 --- a/addons/dragging/stringtable.xml +++ b/addons/dragging/stringtable.xml @@ -52,6 +52,9 @@ 拖拉/放开物品 Objeyi Sürükle/Bırak + + Carry/Release Object + Item too heavy Gegenstand ist zu schwer From 94057ff01c4661b518cd106bc9c6d2d07ca4e686 Mon Sep 17 00:00:00 2001 From: Lachlan Sneddon Date: Mon, 1 Jun 2020 19:54:35 +1200 Subject: [PATCH 2/4] Corrected canCarry Check --- addons/dragging/XEH_postInit.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/dragging/XEH_postInit.sqf b/addons/dragging/XEH_postInit.sqf index e7dd54aaa61..b19edb363c9 100644 --- a/addons/dragging/XEH_postInit.sqf +++ b/addons/dragging/XEH_postInit.sqf @@ -73,7 +73,7 @@ if (isNil "ACE_maxWeightCarry") then { private _cursor = cursorObject; if ((isNull _cursor) || {(_cursor distance ACE_player) > 2.6}) exitWith {false}; - if (!([ACE_player, _cursor] call FUNC(canDrag))) exitWith {false}; + if (!([ACE_player, _cursor] call FUNC(canCarry))) exitWith {false}; [ACE_player, _cursor] call FUNC(startCarry); false From 2b78004c3be7a000bff7c89f2d5b45393038adf6 Mon Sep 17 00:00:00 2001 From: Lachlan Sneddon Date: Tue, 2 Jun 2020 00:22:12 +1200 Subject: [PATCH 3/4] Removed 'False' in key up parameter --- addons/dragging/XEH_postInit.sqf | 2 -- 1 file changed, 2 deletions(-) diff --git a/addons/dragging/XEH_postInit.sqf b/addons/dragging/XEH_postInit.sqf index b19edb363c9..c4e34aa87be 100644 --- a/addons/dragging/XEH_postInit.sqf +++ b/addons/dragging/XEH_postInit.sqf @@ -54,7 +54,6 @@ if (isNil "ACE_maxWeightCarry") then { [ACE_player, _cursor] call FUNC(startDrag); false }, { - false }, [-1, [false, false, false]]] call CBA_fnc_addKeybind; // UNBOUND ["ACE3 Common", QGVAR(carry), (localize LSTRING(CarryKeybind)), { @@ -78,5 +77,4 @@ if (isNil "ACE_maxWeightCarry") then { [ACE_player, _cursor] call FUNC(startCarry); false }, { - false }, [-1, [false, false, false]]] call CBA_fnc_addKeybind; // UNBOUND From 59cda718e0bc585c353bee001a1f201c5d55997b Mon Sep 17 00:00:00 2001 From: Lachlan Sneddon Date: Tue, 2 Jun 2020 10:41:00 +1200 Subject: [PATCH 4/4] removed newline --- addons/dragging/XEH_postInit.sqf | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/addons/dragging/XEH_postInit.sqf b/addons/dragging/XEH_postInit.sqf index c4e34aa87be..dd782eddb2f 100644 --- a/addons/dragging/XEH_postInit.sqf +++ b/addons/dragging/XEH_postInit.sqf @@ -53,8 +53,7 @@ if (isNil "ACE_maxWeightCarry") then { [ACE_player, _cursor] call FUNC(startDrag); false -}, { -}, [-1, [false, false, false]]] call CBA_fnc_addKeybind; // UNBOUND +}, {}, [-1, [false, false, false]]] call CBA_fnc_addKeybind; // UNBOUND ["ACE3 Common", QGVAR(carry), (localize LSTRING(CarryKeybind)), { if (!alive ACE_player) exitWith {false}; @@ -76,5 +75,4 @@ if (isNil "ACE_maxWeightCarry") then { [ACE_player, _cursor] call FUNC(startCarry); false -}, { -}, [-1, [false, false, false]]] call CBA_fnc_addKeybind; // UNBOUND +}, {}, [-1, [false, false, false]]] call CBA_fnc_addKeybind; // UNBOUND