diff --git a/addons/cargo/functions/fnc_onMenuOpen.sqf b/addons/cargo/functions/fnc_onMenuOpen.sqf index 8ded567214..b0f7e7ffb9 100644 --- a/addons/cargo/functions/fnc_onMenuOpen.sqf +++ b/addons/cargo/functions/fnc_onMenuOpen.sqf @@ -44,7 +44,11 @@ if (GVAR(interactionParadrop)) then { !alive _vehicle || {locked _vehicle >= 2} || {!(_vehicle getVariable [QGVAR(hasCargo), true])} || // if the cargo menu could be opened, the vehicle has QGVAR(hasCargo) in its config or the variable is set using FUNC(setSpace) - {(([ACE_player, _vehicle] call EFUNC(interaction,getInteractionDistance)) >= MAX_LOAD_DISTANCE) && {(vehicle ACE_player) != _vehicle}} + { + isNull findDisplay 312 && // if in Zeus, ignore the following checks + {([ACE_player, _vehicle] call EFUNC(interaction,getInteractionDistance)) >= MAX_LOAD_DISTANCE} && + {(vehicle ACE_player) != _vehicle} + } ) exitWith { closeDialog 0; diff --git a/addons/cargo/functions/fnc_startUnload.sqf b/addons/cargo/functions/fnc_startUnload.sqf index 72bb07d0ff..2fe9e923c2 100644 --- a/addons/cargo/functions/fnc_startUnload.sqf +++ b/addons/cargo/functions/fnc_startUnload.sqf @@ -73,6 +73,19 @@ if (GVAR(interactionParadrop)) exitWith { ]] call CBA_fnc_execNextFrame; }; +// If in zeus +if (!isNull findDisplay 312) exitWith { + // Do not check distance to unit, but do check for valid position + if !([_item, GVAR(interactionVehicle), objNull, true] call FUNC(canUnloadItem)) exitWith { + [[LSTRING(unloadingFailed), [_item, true] call FUNC(getNameItem)], 3] call EFUNC(common,displayTextStructured); + }; + + // Close the cargo menu + closeDialog 1; + + ["ace_unloadCargo", [_item, GVAR(interactionVehicle)]] call CBA_fnc_localEvent; +}; + // Start progress bar - normal ground unload if ([_item, GVAR(interactionVehicle), _unit] call FUNC(canUnloadItem)) then { // Close the cargo menu diff --git a/addons/zeus/CfgVehicles.hpp b/addons/zeus/CfgVehicles.hpp index 4390121f81..2a1f261125 100644 --- a/addons/zeus/CfgVehicles.hpp +++ b/addons/zeus/CfgVehicles.hpp @@ -191,6 +191,13 @@ class CfgVehicles { function = QFUNC(moduleLoadIntoCargo); icon = "a3\ui_f\data\IGUI\Cfg\Actions\loadVehicle_ca.paa"; }; + class GVAR(moduleUnloadFromCargo): GVAR(moduleBase) { + curatorCanAttach = 1; + category = QGVAR(Utility); + displayName = CSTRING(ModuleUnloadFromCargo_DisplayName); + function = QFUNC(moduleUnloadFromCargo); + icon = "a3\ui_f\data\IGUI\Cfg\Actions\loadVehicle_ca.paa"; + }; class GVAR(moduleCargoParadrop): GVAR(moduleBase) { curatorCanAttach = 1; category = QGVAR(AI); diff --git a/addons/zeus/XEH_PREP.hpp b/addons/zeus/XEH_PREP.hpp index 81bc055f50..8de15147bd 100644 --- a/addons/zeus/XEH_PREP.hpp +++ b/addons/zeus/XEH_PREP.hpp @@ -43,6 +43,7 @@ PREP(moduleToggleFlashlight); PREP(moduleToggleNvg); PREP(moduleUnconscious); PREP(moduleUnGarrison); +PREP(moduleUnloadFromCargo); PREP(moduleZeusSettings); PREP(showMessage); PREP(ui_attributeCargo); diff --git a/addons/zeus/config.cpp b/addons/zeus/config.cpp index 15924a5fd8..2714c247b0 100644 --- a/addons/zeus/config.cpp +++ b/addons/zeus/config.cpp @@ -56,6 +56,7 @@ class CfgPatches { class GVAR(cargo): ADDON { units[] = { QGVAR(moduleLoadIntoCargo), + QGVAR(moduleUnloadFromCargo), QGVAR(moduleCargoParadrop) }; }; diff --git a/addons/zeus/functions/fnc_moduleUnloadFromCargo.sqf b/addons/zeus/functions/fnc_moduleUnloadFromCargo.sqf new file mode 100644 index 0000000000..dc4b1dea9a --- /dev/null +++ b/addons/zeus/functions/fnc_moduleUnloadFromCargo.sqf @@ -0,0 +1,47 @@ +#include "..\script_component.hpp" +/* + * Author: johnb43 + * Loads the object module is placed on into selected vehicle. + * + * Arguments: + * 0: Module logic + * 1: Synchronized units + * 2: Activated + * + * Return Value: + * None + * + * Example: + * [LOGIC, [bob, kevin], true] call ace_zeus_fnc_moduleUnloadFromCargo + * + * Public: No + */ + +if (canSuspend) exitWith { + [FUNC(moduleUnloadFromCargo), _this] call CBA_fnc_directCall; +}; + +params ["_logic"]; + +if !(local _logic) exitWith {}; + +private _vehicle = attachedTo _logic; + +deleteVehicle _logic; + +if !(missionNamespace getVariable [QEGVAR(cargo,enable), false]) exitWith { + [LSTRING(RequiresAddon)] call FUNC(showMessage); +}; +if (isNull _vehicle) exitWith { + [LSTRING(NothingSelected)] call FUNC(showMessage); +}; +if (!alive _vehicle) exitWith { + [LSTRING(OnlyAlive)] call FUNC(showMessage); +}; +if ((_vehicle getVariable [QEGVAR(cargo,loaded), []]) isEqualTo []) exitWith { + [LSTRING(paradrop_noCargoLoaded)] call FUNC(showMessage); +}; + +EGVAR(cargo,interactionVehicle) = _vehicle; +EGVAR(cargo,interactionParadrop) = false; +createDialog QEGVAR(cargo,menu); diff --git a/addons/zeus/stringtable.xml b/addons/zeus/stringtable.xml index 6518f0316e..7c8dfc6498 100644 --- a/addons/zeus/stringtable.xml +++ b/addons/zeus/stringtable.xml @@ -1314,6 +1314,9 @@ Charger dans le véhicule Cargar en la carga + + Unload from cargo + Toggle NVGs Nachtsichtgeräte Hinzufügen/Entfernen