From 84061cb593aee91c439dccbed1c8f5a0e95b052a Mon Sep 17 00:00:00 2001 From: jonpas Date: Mon, 10 Jul 2017 21:41:37 +0200 Subject: [PATCH] Add support for Tanoa and Malden Fuel Pumps, Flexible Tanks and Fuel Canister (#5353) * Add support for Tanoan fuel pumps, Flexible Tanks and Fuel Canister (as jerry can) * Add to Land_FuelStation_01_pump_malevil_F * Add Malden/Jets to required addons * REQUIRED_VERSION 1.72 --- addons/main/config.cpp | 13 ++++++++++ addons/main/script_mod.hpp | 2 +- addons/refuel/CfgEventHandlers.hpp | 11 +++++++-- addons/refuel/CfgVehicles.hpp | 39 ++++++++++++++++++++++++++---- addons/refuel/XEH_postInit.sqf | 11 +++++++++ addons/refuel/script_component.hpp | 3 ++- 6 files changed, 70 insertions(+), 9 deletions(-) diff --git a/addons/main/config.cpp b/addons/main/config.cpp index 5d485b6fd9..cf38747148 100644 --- a/addons/main/config.cpp +++ b/addons/main/config.cpp @@ -7,6 +7,19 @@ class CfgPatches { weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = { + "A3_Data_F_Loadorder", + "A3_Data_F_Curator_Loadorder", + "A3_Data_F_Kart_Loadorder", + "A3_Data_F_Bootcamp_Loadorder", + "A3_Data_F_Heli_Loadorder", + "A3_Data_F_Mark_Loadorder", + "A3_Data_F_Exp_A_Loadorder", + "A3_Data_F_Exp_B_Loadorder", + "A3_Data_F_Exp_Loadorder", + "A3_Data_F_Jets_Loadorder", + "A3_Data_F_Argo_Loadorder", + "A3_Data_F_Patrol_Loadorder", + // Vanilla "a3_3den", "a3_3den_language", diff --git a/addons/main/script_mod.hpp b/addons/main/script_mod.hpp index a21034f277..7b2f6a92cd 100644 --- a/addons/main/script_mod.hpp +++ b/addons/main/script_mod.hpp @@ -9,7 +9,7 @@ #define VERSION_AR MAJOR,MINOR,PATCHLVL,BUILD // MINIMAL required version for the Mod. Components can specify others.. -#define REQUIRED_VERSION 1.70 +#define REQUIRED_VERSION 1.72 #define REQUIRED_CBA_VERSION {3,3,1} #ifdef COMPONENT_BEAUTIFIED diff --git a/addons/refuel/CfgEventHandlers.hpp b/addons/refuel/CfgEventHandlers.hpp index c6f26efe1a..20f482c8ca 100644 --- a/addons/refuel/CfgEventHandlers.hpp +++ b/addons/refuel/CfgEventHandlers.hpp @@ -1,4 +1,3 @@ - class Extended_PreStart_EventHandlers { class ADDON { init = QUOTE(call COMPILE_FILE(XEH_preStart)); @@ -31,4 +30,12 @@ class Extended_Killed_EventHandlers { killed = QUOTE(_this call FUNC(handleKilled)); }; }; -}; \ No newline at end of file +}; + +class Extended_InitPost_EventHandlers { + class Land_CanisterFuel_F { + class ADDON { + init = QUOTE(_this call DFUNC(makeJerryCan)); + }; + }; +}; diff --git a/addons/refuel/CfgVehicles.hpp b/addons/refuel/CfgVehicles.hpp index 3a28762b79..de361a6816 100644 --- a/addons/refuel/CfgVehicles.hpp +++ b/addons/refuel/CfgVehicles.hpp @@ -146,9 +146,7 @@ class CfgVehicles { class NonStrategic: Building {}; class HouseBase: NonStrategic {}; class House: HouseBase {}; - class House_F: House {}; - - class House_Small_F: House_F { + class House_F: House { class ACE_Actions { class ACE_MainActions { displayName = ECSTRING(interaction,MainAction); @@ -158,6 +156,7 @@ class CfgVehicles { }; }; }; + class House_Small_F: House_F {}; class AllVehicles: All { GVAR(flowRate) = 1; @@ -480,7 +479,7 @@ class CfgVehicles { GVAR(fuelCargo) = 10000; }; - + // Vanilla fuel objects class StorageBladder_base_F: NonStrategic { class ACE_Actions { class ACE_MainActions { @@ -496,12 +495,29 @@ class CfgVehicles { class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; }; - MACRO_REFUEL_ACTIONS transportFuel = 0; //60k + MACRO_REFUEL_ACTIONS GVAR(hooks)[] = {{-3.35,2.45,0.17}}; GVAR(fuelCargo) = 60000; }; + class FlexibleTank_base_F: ThingX { + class ACE_Actions { + class ACE_MainActions { + displayName = ECSTRING(interaction,MainAction); + position = "[0, 0, 0.5]"; + distance = 4; + condition = "true"; + }; + }; + }; + class Land_FlexibleTank_01_F: FlexibleTank_base_F { + transportFuel = 0; //300 + MACRO_REFUEL_ACTIONS + GVAR(hooks)[] = {{0, 0, 0.5}}; + GVAR(fuelCargo) = 300; + }; + // Vanilla buildings class Land_Fuelstation_Feed_F: House_Small_F { transportFuel = 0; //50k @@ -517,6 +533,19 @@ class CfgVehicles { GVAR(fuelCargo) = REFUEL_INFINITE_FUEL; }; + class Land_FuelStation_01_pump_F: House_F { + transportFuel = 0; //50k + MACRO_REFUEL_ACTIONS + GVAR(hooks)[] = {{0, 0.4, -0.5}, {0, -0.4, -0.5}}; + GVAR(fuelCargo) = REFUEL_INFINITE_FUEL; + }; + class Land_FuelStation_01_pump_malevil_F: House_F { + transportFuel = 0; //50k + MACRO_REFUEL_ACTIONS + GVAR(hooks)[] = {{0, 0.4, -0.5}, {0, -0.4, -0.5}}; + GVAR(fuelCargo) = REFUEL_INFINITE_FUEL; + }; + // Helper object for non-AllVehicles objects class GVAR(helper): Helicopter_Base_F { scope = 1; diff --git a/addons/refuel/XEH_postInit.sqf b/addons/refuel/XEH_postInit.sqf index 3f20e5d30d..5d56e388e9 100644 --- a/addons/refuel/XEH_postInit.sqf +++ b/addons/refuel/XEH_postInit.sqf @@ -37,3 +37,14 @@ private _fuelTrucks = configProperties [configFile >> "CfgVehicles", "(isClass _ }; } forEach _fuelTrucks; #endif + +#ifdef DRAW_HOOKS_POS +addMissionEventHandler ["Draw3D", { + private _target = cursorObject; + private _cfgPos = getArray (configFile >> "CfgVehicles" >> typeOf _target >> QGVAR(hooks)); + private _dynPos = _target getVariable [QGVAR(dev_hooks), []]; + { + drawIcon3D ["\a3\ui_f\data\gui\cfg\hints\icon_text\group_1_ca.paa", [1,1,1,1], _target modelToWorldVisual _x, 1, 1, 0, format ["Hook %1", _forEachIndex]]; + } forEach ([_dynPos, _cfgPos] select (_dynPos isEqualTo [])); +}]; +#endif diff --git a/addons/refuel/script_component.hpp b/addons/refuel/script_component.hpp index 3f85277a99..a4d6f6df31 100644 --- a/addons/refuel/script_component.hpp +++ b/addons/refuel/script_component.hpp @@ -2,10 +2,11 @@ #define COMPONENT_BEAUTIFIED Refuel #include "\z\ace\addons\main\script_mod.hpp" +// #define FAST_PROGRESSBARS +// #define DRAW_HOOKS_POS // #define DEBUG_MODE_FULL // #define DISABLE_COMPILE_CACHE // #define ENABLE_PERFORMANCE_COUNTERS -// #define FAST_PROGRESSBARS #ifdef DEBUG_ENABLED_REFUEL #define DEBUG_MODE_FULL