ACE3/addons/dragging/initKeybinds.inc.sqf
BrettMayson 464ab0cefb
Tools - Add HEMTT SQF support and fix commas are not semicolons (#9663)
Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
Co-authored-by: jonpas <jonpas33@gmail.com>
2023-12-07 03:20:47 +00:00

59 lines
2.1 KiB
Plaintext

// Add Keybinds
["ACE3 Common", QGVAR(drag), LLSTRING(DragKeybind), {
private _player = ACE_player;
if (!alive _player) exitWith {false};
if !([_player, objNull, ["isNotDragging", "isNotCarrying", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false};
// If we are drag/carrying something right now then just drop it:
if (_player getVariable [QGVAR(isDragging), false]) exitWith {
[_player, _player getVariable [QGVAR(draggedObject), objNull]] call FUNC(dropObject);
false
};
if (_player getVariable [QGVAR(isCarrying), false]) exitWith {
[_player, _player getVariable [QGVAR(carriedObject), objNull]] call FUNC(dropObject_carry);
false
};
private _cursorObject = cursorObject;
if (isNull _cursorObject || {(_cursorObject distance _player) > 2.6}) exitWith {false};
if !([_player, _cursorObject] call FUNC(canDrag)) exitWith {false};
[_player, _cursorObject] call FUNC(startDrag);
false
}, {}, [-1, [false, false, false]]] call CBA_fnc_addKeybind; // UNBOUND
["ACE3 Common", QGVAR(carry), LLSTRING(CarryKeybind), {
private _player = ACE_player;
if (!alive _player) exitWith {false};
if !([_player, objNull, ["isNotDragging", "isNotCarrying"]] call EFUNC(common,canInteractWith)) exitWith {false};
// If we are drag/carrying something right now then just drop it:
if (_player getVariable [QGVAR(isDragging), false]) exitWith {
[_player, _player getVariable [QGVAR(draggedObject), objNull]] call FUNC(dropObject);
false
};
if (_player getVariable [QGVAR(isCarrying), false]) exitWith {
[_player, _player getVariable [QGVAR(carriedObject), objNull], true] call FUNC(dropObject_carry);
false
};
private _cursorObject = cursorObject;
if (isNull _cursorObject || {(_cursorObject distance _player) > 2.6}) exitWith {false};
if !([_player, _cursorObject] call FUNC(canCarry)) exitWith {false};
[_player, _cursorObject] call FUNC(startCarry);
false
}, {}, [-1, [false, false, false]]] call CBA_fnc_addKeybind; // UNBOUND