From 96efbaef53babf7338f2af01072b8e31f927f616 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Fri, 1 Jul 2016 16:28:44 -0500 Subject: [PATCH] Add Drag/Drop Keybind --- addons/dragging/XEH_postInit.sqf | 27 +++++++++++++++++++++++++++ addons/dragging/stringtable.xml | 12 ++++++++++++ 2 files changed, 39 insertions(+) diff --git a/addons/dragging/XEH_postInit.sqf b/addons/dragging/XEH_postInit.sqf index 6b2fd02dde..0d8e7757eb 100644 --- a/addons/dragging/XEH_postInit.sqf +++ b/addons/dragging/XEH_postInit.sqf @@ -28,3 +28,30 @@ if (isNil "ACE_maxWeightCarry") then { ["ace_unconscious", {_this call FUNC(handleUnconscious)}] call CBA_fnc_addEventHandler; //@todo Captivity? + +//Add Keybind: +["ACE3 Common", QGVAR(drag), (localize LSTRING(DragKeybind)), +{ + 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(startDrag); + false +}, +{false}, +[-1, [false, false, false]]] call CBA_fnc_addKeybind; // UNBOUND + diff --git a/addons/dragging/stringtable.xml b/addons/dragging/stringtable.xml index b0334f3ca2..646678e43d 100644 --- a/addons/dragging/stringtable.xml +++ b/addons/dragging/stringtable.xml @@ -25,6 +25,18 @@ Lascia Elengedés + + Drag/Release Object + Тащить/Отпустить Объекты + Arrastrar/Soltar Objeto + Ciągnij/Puść Obiekt + Táhnout/Položit Objekt + Trainer/Lâcher Objets + Ziehen/Loslassen Objekt + Arrastar/Soltar Objeto + Trascina/Lascia Oggetto + Húzás/Elengedés Objektum + Item too heavy Gegenstand ist zu schwer