diff --git a/addons/cargo/UI/Icon_load.paa b/addons/cargo/UI/Icon_load.paa deleted file mode 100644 index ccd77761e4..0000000000 Binary files a/addons/cargo/UI/Icon_load.paa and /dev/null differ diff --git a/addons/cargo/functions/fnc_initObject.sqf b/addons/cargo/functions/fnc_initObject.sqf index d59249c31b..5020f885b6 100644 --- a/addons/cargo/functions/fnc_initObject.sqf +++ b/addons/cargo/functions/fnc_initObject.sqf @@ -66,7 +66,7 @@ private _statement = { [_player, _target] call FUNC(startLoadIn); }; private _text = localize LSTRING(loadObject); -private _icon = QPATHTOF(UI\Icon_load.paa); +private _icon = "a3\ui_f\data\IGUI\Cfg\Actions\loadVehicle_ca.paa"; private _action = [QGVAR(load), _text, _icon, _statement, _condition, {call FUNC(addCargoVehiclesActions)}] call EFUNC(interact_menu,createAction); if (_canLoadConfig) then { diff --git a/addons/zeus/CfgVehicles.hpp b/addons/zeus/CfgVehicles.hpp index 9918764462..d123684648 100644 --- a/addons/zeus/CfgVehicles.hpp +++ b/addons/zeus/CfgVehicles.hpp @@ -98,14 +98,14 @@ class CfgVehicles { category = QGVAR(Repair); displayName = CSTRING(ModuleAddSpareTrack_DisplayName); function = QFUNC(moduleAddSpareTrack); - icon = QPATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa);//@todo + icon = "a3\ui_f\data\IGUI\Cfg\Actions\repair_ca.paa"; }; class GVAR(moduleAddSpareWheel): GVAR(moduleBase) { curatorCanAttach = 1; category = QGVAR(Repair); displayName = CSTRING(ModuleAddSpareWheel_DisplayName); function = QFUNC(moduleAddSpareWheel); - icon = QPATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa);//@todo + icon = "a3\ui_f\data\IGUI\Cfg\Actions\repair_ca.paa"; }; class GVAR(moduleAddOrRemoveFRIES): GVAR(moduleBase) { curatorCanAttach = 1; @@ -143,6 +143,13 @@ class CfgVehicles { displayName = CSTRING(ModuleGroupSide_DisplayName); curatorInfoType = QGVAR(RscGroupSide); }; + class GVAR(moduleLoadIntoCargo): GVAR(moduleBase) { + curatorCanAttach = 1; + category = QGVAR(Utility); + displayName = CSTRING(ModuleLoadIntoCargo_DisplayName); + function = QFUNC(moduleLoadIntoCargo); + icon = "a3\ui_f\data\IGUI\Cfg\Actions\loadVehicle_ca.paa"; + }; class GVAR(modulePatrolArea): GVAR(moduleBase) { curatorCanAttach = 1; category = QGVAR(AI); @@ -217,13 +224,13 @@ class CfgVehicles { class GVAR(AddFullArsenal): GVAR(moduleBase) { curatorCanAttach = 1; category = QGVAR(Utility); - displayName = CSTRING(moduleAddFullArsenal_displayName); + displayName = CSTRING(ModuleAddFullArsenal_DisplayName); function = QFUNC(moduleAddArsenal); }; class GVAR(RemoveFullArsenal): GVAR(moduleBase) { curatorCanAttach = 1; category = QGVAR(Utility); - displayName = CSTRING(moduleRemoveArsenal_displayName); + displayName = CSTRING(ModuleRemoveArsenal_DisplayName); function = QFUNC(moduleRemoveArsenal); }; }; diff --git a/addons/zeus/XEH_PREP.hpp b/addons/zeus/XEH_PREP.hpp index a3f269f638..263b5e60b9 100644 --- a/addons/zeus/XEH_PREP.hpp +++ b/addons/zeus/XEH_PREP.hpp @@ -13,6 +13,7 @@ PREP(moduleAddOrRemoveFRIES); PREP(moduleCaptive); PREP(moduleGlobalSetSkill); PREP(moduleGroupSide); +PREP(moduleLoadIntoCargo); PREP(moduleRemoveArsenal); PREP(moduleSearchNearby); PREP(moduleSetMedic); diff --git a/addons/zeus/config.cpp b/addons/zeus/config.cpp index d81ac5c074..16a2e6a678 100644 --- a/addons/zeus/config.cpp +++ b/addons/zeus/config.cpp @@ -8,6 +8,7 @@ class CfgPatches { QGVAR(moduleEditableObjects), QGVAR(moduleGlobalSetSkill), QGVAR(moduleGroupSide), + QGVAR(moduleLoadIntoCargo), QGVAR(modulePatrolArea), QGVAR(moduleSearchArea), QGVAR(moduleSearchNearby), @@ -25,6 +26,7 @@ class CfgPatches { url = ECSTRING(main,URL); VERSION_CONFIG; }; + // Use additional CfgPatches to contextually remove modules from zeus class GVAR(captives): ADDON { units[] = { @@ -40,6 +42,11 @@ class CfgPatches { QGVAR(moduleSetMedicalFacility) }; }; + class GVAR(cargo): ADDON { + units[] = { + QGVAR(moduleLoadIntoCargo) + }; + }; class GVAR(cargoAndRepair): ADDON { units[] = { QGVAR(moduleAddSpareTrack), @@ -56,6 +63,7 @@ class CfgPatches { class ACE_Curator { GVAR(captives) = "ace_captives"; GVAR(medical) = "ace_medical"; + GVAR(cargo) = "ace_cargo"; GVAR(cargoAndRepair)[] = {"ace_cargo", "ace_repair"}; GVAR(fastroping) = "ace_fastroping"; }; diff --git a/addons/zeus/functions/fnc_moduleLoadIntoCargo.sqf b/addons/zeus/functions/fnc_moduleLoadIntoCargo.sqf new file mode 100644 index 0000000000..cf3ae547c8 --- /dev/null +++ b/addons/zeus/functions/fnc_moduleLoadIntoCargo.sqf @@ -0,0 +1,66 @@ +/* + * Author: 654wak654 + * 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_moduleLoadIntoCargo + * + * Public: No + */ +#include "script_component.hpp" + +if (canSuspend) exitWith {[FUNC(moduleSuppressiveFire), _this] call CBA_fnc_directCall;}; + +params ["_logic", "_units", "_activated"]; + +if !(_activated && {local _logic}) exitWith {}; + +private _cargo = attachedTo _logic; + +deleteVehicle _logic; + +if !(missionNamespace getVariable [QEGVAR(cargo,enable), false]) exitWith { + [LSTRING(RequiresAddon)] call FUNC(showMessage); +}; +if (isNull _cargo) exitWith { + [LSTRING(NothingSelected)] call FUNC(showMessage); +}; +if (!alive _cargo) exitWith { + [LSTRING(OnlyAlive)] call FUNC(showMessage); +}; + +[ + _cargo, + { + params ["_successful", "_cargo", "_mousePosASL"]; + if (!_successful) exitWith {}; + + private _holder = (nearestObjects [ASLToAGL _mousePosASL, EGVAR(cargo,cargoHolderTypes), 5]) param [0, objNull]; + if (isNull _holder) exitWith { + [LSTRING(NothingSelected)] call FUNC(showMessage); + }; + if (!alive _holder) exitWith { + [LSTRING(OnlyAlive)] call FUNC(showMessage); + }; + + private _displayName = [_cargo] call EFUNC(common,getName); + if ([_cargo, _holder] call EFUNC(cargo,loadItem)) then { + private _loadedItem = [localize ELSTRING(cargo,LoadedItem), "
", " "] call CBA_fnc_replace; + private _holderDisplayName = [_holder] call EFUNC(common,getName); + [_loadedItem, _displayName, _holderDisplayName] call FUNC(showMessage); + } else { + private _loadingFailed = [localize ELSTRING(cargo,LoadingFailed), "
", " "] call CBA_fnc_replace; + [_loadingFailed, _displayName] call FUNC(showMessage); + }; + }, + localize LSTRING(ModuleLoadIntoCargo_DisplayName), + "a3\ui_f\data\IGUI\Cfg\Actions\loadVehicle_ca.paa" +] call FUNC(getModuleDestination); diff --git a/addons/zeus/functions/fnc_moduleSuppressiveFire.sqf b/addons/zeus/functions/fnc_moduleSuppressiveFire.sqf index 1d510fec55..b2c9ba88a7 100644 --- a/addons/zeus/functions/fnc_moduleSuppressiveFire.sqf +++ b/addons/zeus/functions/fnc_moduleSuppressiveFire.sqf @@ -3,7 +3,7 @@ * Commands the selected unit or group to start suppressive fire on the unit, group or location the module is placed on * * Arguments: - * 0: The module logic + * 0: Module logic * 1: Synchronized units * 2: Activated * @@ -22,7 +22,7 @@ if (canSuspend) exitWith {[FUNC(moduleSuppressiveFire), _this] call CBA_fnc_dire params ["_logic", "_units", "_activated"]; -if !(_activated && local _logic) exitWith {}; +if !(_activated && {local _logic}) exitWith {}; // Validate the module target private _unit = effectiveCommander (attachedTo _logic); @@ -34,7 +34,7 @@ if (isNull _unit) exitWith { [LSTRING(NothingSelected)] call FUNC(showMessage); }; if (!alive _unit) exitWith { - [localize LSTRING(OnlyAlive)] call FUNC(showMessage); + [LSTRING(OnlyAlive)] call FUNC(showMessage); }; if ([_unit] call EFUNC(common,isPlayer)) exitWith { ["str_a3_cfgvehicles_moduleremotecontrol_f_errorPlayer"] call FUNC(showMessage); @@ -43,8 +43,7 @@ if ([_unit] call EFUNC(common,isPlayer)) exitWith { [_unit, { params ["_successful", "_unit", "_mousePosASL"]; TRACE_3("getModuleDestination return",_successful,_unit,_mousePosASL); - if (!_successful) exitWith {}; - if (!alive _unit) exitWith {}; + if !(_successful && {alive _unit}) exitWith {}; private _vehicle = vehicle _unit; private _targetASL = _mousePosASL vectorAdd [0,0,0.6]; // mouse pos is at ground level zero, raise up a bit; @@ -117,4 +116,4 @@ if ([_unit] call EFUNC(common,isPlayer)) exitWith { }; #endif -}, (localize LSTRING(ModuleSuppressiveFire_DisplayName))] call FUNC(getModuleDestination); +}, localize LSTRING(ModuleSuppressiveFire_DisplayName)] call FUNC(getModuleDestination); diff --git a/addons/zeus/stringtable.xml b/addons/zeus/stringtable.xml index 449d495ee4..f528ff7a80 100644 --- a/addons/zeus/stringtable.xml +++ b/addons/zeus/stringtable.xml @@ -1017,23 +1017,26 @@ 火力壓制 Ogień zaporowy - - Add full arsenal to object - Ajouter arsenal complet à l'objet - Aggiunge arsenale completo all'oggetto + + Add Full Arsenal + Ajouter Arsenal Complet + Aggiunge Arsenale Completo オブジェクトに完全なアーセナルを追加 增加完整的虚拟军火库到物件上 增加完整的虛擬軍火庫到物件上 - Dodaj Wirtualny Arsenał do obiektu + Dodaj Wirtualny Arsenał - - Remove arsenal from object - Retirer arsenal de l'objet - Rimuove arsenale completo dall'oggetto + + Remove Arsenal + Retirer Arsenal + Rimuove Arsenale オブジェクトからアーセナルを削除 移除物件上的虚拟军火库 移除物件上的虛擬軍火庫 - Usuń Wirtualny Arsenał z obiektu + Usuń Wirtualny Arsenał + + + Load into Cargo