mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Zeus - Add Zeus modules for unloading cargo (#9661)
Added unload cargo zeus module Co-authored-by: LinkIsGrim <salluci.lovi@gmail.com>
This commit is contained in:
parent
73807c261f
commit
bae63636b7
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -43,6 +43,7 @@ PREP(moduleToggleFlashlight);
|
||||
PREP(moduleToggleNvg);
|
||||
PREP(moduleUnconscious);
|
||||
PREP(moduleUnGarrison);
|
||||
PREP(moduleUnloadFromCargo);
|
||||
PREP(moduleZeusSettings);
|
||||
PREP(showMessage);
|
||||
PREP(ui_attributeCargo);
|
||||
|
@ -56,6 +56,7 @@ class CfgPatches {
|
||||
class GVAR(cargo): ADDON {
|
||||
units[] = {
|
||||
QGVAR(moduleLoadIntoCargo),
|
||||
QGVAR(moduleUnloadFromCargo),
|
||||
QGVAR(moduleCargoParadrop)
|
||||
};
|
||||
};
|
||||
|
47
addons/zeus/functions/fnc_moduleUnloadFromCargo.sqf
Normal file
47
addons/zeus/functions/fnc_moduleUnloadFromCargo.sqf
Normal file
@ -0,0 +1,47 @@
|
||||
#include "..\script_component.hpp"
|
||||
/*
|
||||
* Author: johnb43
|
||||
* Loads the object module is placed on into selected vehicle.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Module logic <OBJECT>
|
||||
* 1: Synchronized units <ARRAY>
|
||||
* 2: Activated <BOOL>
|
||||
*
|
||||
* 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);
|
@ -1314,6 +1314,9 @@
|
||||
<French>Charger dans le véhicule</French>
|
||||
<Spanish>Cargar en la carga</Spanish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Zeus_ModuleUnloadFromCargo_DisplayName">
|
||||
<English>Unload from cargo</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Zeus_ModuleToggleNVG_DisplayName">
|
||||
<English>Toggle NVGs</English>
|
||||
<German>Nachtsichtgeräte Hinzufügen/Entfernen</German>
|
||||
|
Loading…
Reference in New Issue
Block a user