Merge pull request #2617 from jonpas/zeusSpareparts

Add Zeus Modules for Adding Spare Parts
This commit is contained in:
SilentSpike 2015-10-05 19:01:50 +01:00
commit e5b29727a5
6 changed files with 135 additions and 5 deletions

View File

@ -117,7 +117,7 @@ class CfgVehicles {
};
class GVAR(moduleSetMedic): GVAR(moduleBase) {
curatorCanAttach = 1;
displayName = CSTRING(ModuleSetMedic_displayName);
displayName = CSTRING(ModuleSetMedic_DisplayName);
function = QFUNC(moduleSetMedic);
icon = QUOTE(PATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa));
class ModuleDescription {
@ -127,7 +127,7 @@ class CfgVehicles {
};
class GVAR(moduleSetMedicalVehicle): GVAR(moduleBase) {
curatorCanAttach = 1;
displayName = CSTRING(ModuleSetMedicalVehicle_displayName);
displayName = CSTRING(ModuleSetMedicalVehicle_DisplayName);
function = QFUNC(moduleSetMedicalVehicle);
icon = QUOTE(PATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa));
class ModuleDescription {
@ -137,7 +137,7 @@ class CfgVehicles {
};
class GVAR(moduleSetMedicalFacility): GVAR(moduleBase) {
curatorCanAttach = 1;
displayName = CSTRING(ModuleSetMedicalFacility_displayName);
displayName = CSTRING(ModuleSetMedicalFacility_DisplayName);
function = QFUNC(moduleSetMedicalFacility);
icon = QUOTE(PATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa));
class ModuleDescription {
@ -145,4 +145,25 @@ class CfgVehicles {
sync[] = {};
};
};
class GVAR(moduleAddSpareTrack): GVAR(moduleBase) {
curatorCanAttach = 1;
displayName = CSTRING(ModuleAddSpareTrack_DisplayName);
function = QFUNC(moduleAddSpareTrack);
icon = QUOTE(PATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa));//@todo
class ModuleDescription {
description = CSTRING(ModuleAddSpareTrack_Description);
sync[] = {};
};
};
class GVAR(moduleAddSpareWheel): GVAR(moduleBase) {
curatorCanAttach = 1;
displayName = CSTRING(ModuleAddSpareWheel_DisplayName);
function = QFUNC(moduleAddSpareWheel);
icon = QUOTE(PATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa));//@todo
class ModuleDescription {
description = CSTRING(ModuleAddSpareWheel_Description);
sync[] = {};
};
};
};

View File

@ -8,6 +8,8 @@ PREP(bi_moduleMine);
PREP(bi_moduleProjectile);
PREP(bi_moduleRemoteControl);
PREP(handleZeusUnitAssigned);
PREP(moduleAddSpareTrack);
PREP(moduleAddSpareWheel);
PREP(moduleCaptive);
PREP(moduleSetMedic);
PREP(moduleSetMedicalVehicle);

View File

@ -25,11 +25,18 @@ class CfgPatches {
QGVAR(moduleSetMedicalFacility)
};
};
class GVAR(cargoAndRepair): ADDON {
units[] = {
QGVAR(moduleAddSpareTrack),
QGVAR(moduleAddSpareWheel)
};
};
};
class ACE_Curator {
GVAR(captives) = "ace_captives";
GVAR(medical) = "ace_medical";
GVAR(cargoAndRepair[]) = {"ace_cargo", "ace_repair"};
};
#include "CfgEventHandlers.hpp"

View File

@ -0,0 +1,41 @@
/*
* Author: Jonpas
* Adds a Spare Track to the vehicle.
*
* Arguments:
* 0: The module logic <OBJECT>
* 1: Synchronized units <ARRAY>
* 2: Activated <BOOL>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
params ["_logic", "_units", "_activated"];
if !(_activated && local _logic) exitWith {};
if !(["ace_cargo"] call EFUNC(common,isModLoaded) && ["ace_repair"] call EFUNC(common,isModLoaded)) then {
[LSTRING(RequiresAddon)] call EFUNC(common,displayTextStructured);
} else {
(GETMVAR(bis_fnc_curatorObjectPlaced_mouseOver,[""])) params ["_mouseOverType", "_mouseOverUnit"];
if (_mouseOverType != "OBJECT") then {
[LSTRING(NothingSelected)] call EFUNC(common,displayTextStructured);
} else {
if !(alive _mouseOverUnit) then {
[LSTRING(OnlyAlive)] call EFUNC(common,displayTextStructured);
} else {
if (getNumber (configFile >> "CfgVehicles" >> "ACE_Track" >> QEGVAR(cargo,size)) > [_mouseOverUnit] call EFUNC(cargo,getCargoSpaceLeft)) then {
[LSTRING(OnlyEnoughCargoSpace)] call EFUNC(common,displayTextStructured);
} else {
["AddCargoByClass", ["ACE_Track", _mouseOverUnit, 1, true]] call EFUNC(common,localEvent);
};
};
};
};
deleteVehicle _logic;

View File

@ -0,0 +1,41 @@
/*
* Author: Jonpas
* Adds a Spare Wheel to the vehicle.
*
* Arguments:
* 0: The module logic <OBJECT>
* 1: Synchronized units <ARRAY>
* 2: Activated <BOOL>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
params ["_logic", "_units", "_activated"];
if !(_activated && local _logic) exitWith {};
if !(["ace_cargo"] call EFUNC(common,isModLoaded) && ["ace_repair"] call EFUNC(common,isModLoaded)) then {
[LSTRING(RequiresAddon)] call EFUNC(common,displayTextStructured);
} else {
(GETMVAR(bis_fnc_curatorObjectPlaced_mouseOver,[""])) params ["_mouseOverType", "_mouseOverUnit"];
if (_mouseOverType != "OBJECT") then {
[LSTRING(NothingSelected)] call EFUNC(common,displayTextStructured);
} else {
if !(alive _mouseOverUnit) then {
[LSTRING(OnlyAlive)] call EFUNC(common,displayTextStructured);
} else {
if (getNumber (configFile >> "CfgVehicles" >> "ACE_Wheel" >> QEGVAR(cargo,size)) > [_mouseOverUnit] call EFUNC(cargo,getCargoSpaceLeft)) then {
[LSTRING(OnlyEnoughCargoSpace)] call EFUNC(common,displayTextStructured);
} else {
["AddCargoByClass", ["ACE_Wheel", _mouseOverUnit, 1, true]] call EFUNC(common,localEvent);
};
};
};
};
deleteVehicle _logic;

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project name="ACE">
<Package name="Zeus">
<Key ID="STR_ACE_Zeus_Settings_DisplayName">
@ -212,6 +212,18 @@
<Czech>Přiřadit Zdravotnické Zařízení</Czech>
<Spanish>Asignar instalación médica</Spanish>
</Key>
<Key ID="STR_ACE_Zeus_ModuleAddSpareWheel_DisplayName">
<English>Add Spare Wheel</English>
</Key>
<Key ID="STR_ACE_Zeus_ModuleAddSpareWheel_Description">
<English>Adds a Spare Wheel to the vehicle</English>
</Key>
<Key ID="STR_ACE_Zeus_ModuleAddSpareTrack_DisplayName">
<English>Add Spare Track</English>
</Key>
<Key ID="STR_ACE_Zeus_ModuleAddSpareTrack_Description">
<English>Adds a Spare Track to the vehicle</English>
</Key>
<Key ID="STR_ACE_Zeus_OnlyAlive">
<English>Unit must be alive</English>
<French>Utiliser uniquement sur une unité vivante</French>
@ -250,6 +262,12 @@
<Russian>Юнит должен быть транспортом</Russian>
<Spanish>La unidad debe ser un vehículo</Spanish>
</Key>
<Key ID="STR_ACE_Zeus_OnlyVehiclesWithCargo">
<English>Unit must be a vehicle with cargo space</English>
</Key>
<Key ID="STR_ACE_Zeus_OnlyEnoughCargoSpace">
<English>Unit must have cargo space left</English>
</Key>
<Key ID="STR_ACE_Zeus_OnlyNonCaptive">
<English>Unit must not be captive</English>
<Polish>Jednostka nie może być więźniem</Polish>
@ -299,4 +317,4 @@
<Spanish>Añadir cualquier objeto creado a todos los directores en la misión</Spanish>
</Key>
</Package>
</Project>
</Project>