From 5c68f1dac3dbcdddc63c87f39ee9031bb88db3f3 Mon Sep 17 00:00:00 2001 From: Mysteryjuju Date: Sun, 9 Aug 2020 17:12:54 +0200 Subject: [PATCH] Trenches - Add settings to configure dig/remove trenches durations (#7831) * Trenches - Add settings to configure dig/remove trenches durations Signed-off-by: Mysteryjuju * Trenches - Remove dirty tabs Signed-off-by: Mysteryjuju * Trenches - Update French translation Signed-off-by: Mysteryjuju * Update addons/trenches/stringtable.xml Co-authored-by: Elgin675 * Update addons/trenches/stringtable.xml Co-authored-by: Elgin675 * Update addons/trenches/stringtable.xml Co-authored-by: Elgin675 * Update addons/trenches/stringtable.xml Co-authored-by: Elgin675 * Update addons/trenches/stringtable.xml Co-authored-by: Elgin675 * Update addons/trenches/stringtable.xml Co-authored-by: Elgin675 * Update addons/trenches/stringtable.xml Co-authored-by: Elgin675 * Update addons/trenches/stringtable.xml Co-authored-by: Elgin675 * Trenches - Change SLIDER to TIME settings & update english translations Signed-off-by: Mysteryjuju * Trenches - Change CBA settings function Signed-off-by: Mysteryjuju Co-authored-by: Elgin675 --- addons/trenches/CfgVehicles.hpp | 8 ++--- addons/trenches/XEH_preInit.sqf | 2 ++ .../functions/fnc_continueDiggingTrench.sqf | 2 +- .../trenches/functions/fnc_removeTrench.sqf | 2 +- addons/trenches/initSettings.sqf | 36 +++++++++++++++++++ addons/trenches/stringtable.xml | 36 +++++++++++++++++++ 6 files changed, 80 insertions(+), 6 deletions(-) create mode 100644 addons/trenches/initSettings.sqf diff --git a/addons/trenches/CfgVehicles.hpp b/addons/trenches/CfgVehicles.hpp index 3b13be21a8..478243345d 100644 --- a/addons/trenches/CfgVehicles.hpp +++ b/addons/trenches/CfgVehicles.hpp @@ -53,8 +53,8 @@ class CfgVehicles { descriptionShort = CSTRING(EnevlopeSmallDescription); model = QPATHTOEF(apl,ace_envelope_small4.p3d); scope = 2; - GVAR(diggingDuration) = 20; - GVAR(removalDuration) = 12; + GVAR(diggingDuration) = QGVAR(smallEnvelopeDigDuration); + GVAR(removalDuration) = QGVAR(smallEnvelopeRemoveDuration); GVAR(noGeoClass) = "ACE_envelope_small_NoGeo"; GVAR(placementData)[] = {2,3,0.35}; GVAR(grassCuttingPoints)[] = {{0,-0.5,0}}; @@ -69,8 +69,8 @@ class CfgVehicles { descriptionShort = CSTRING(EnevlopeBigDescription); model = QPATHTOEF(apl,ace_envelope_big4.p3d); scope = 2; - GVAR(diggingDuration) = 25; - GVAR(removalDuration) = 15; + GVAR(diggingDuration) = QGVAR(bigEnvelopeDigDuration); + GVAR(removalDuration) = QGVAR(bigEnvelopeRemoveDuration); GVAR(noGeoClass) = "ACE_envelope_big_NoGeo"; GVAR(placementData)[] = {6,1.1,0.20}; GVAR(grassCuttingPoints)[] = {{-1.5,-1,0},{1.5,-1,0}}; diff --git a/addons/trenches/XEH_preInit.sqf b/addons/trenches/XEH_preInit.sqf index b47cf6628d..9361d05015 100644 --- a/addons/trenches/XEH_preInit.sqf +++ b/addons/trenches/XEH_preInit.sqf @@ -6,4 +6,6 @@ PREP_RECOMPILE_START; #include "XEH_PREP.hpp" PREP_RECOMPILE_END; +#include "initSettings.sqf" + ADDON = true; diff --git a/addons/trenches/functions/fnc_continueDiggingTrench.sqf b/addons/trenches/functions/fnc_continueDiggingTrench.sqf index aee6c64ca5..951bfa9d21 100644 --- a/addons/trenches/functions/fnc_continueDiggingTrench.sqf +++ b/addons/trenches/functions/fnc_continueDiggingTrench.sqf @@ -25,7 +25,7 @@ if(_actualProgress == 1) exitWith {}; // Mark trench as being worked on _trench setVariable [QGVAR(digging), true, true]; -private _digTime = getNumber (configFile >> "CfgVehicles" >> (typeof _trench) >> QGVAR(diggingDuration)); +private _digTime = missionNamespace getVariable [getText (configFile >> "CfgVehicles" >> (typeof _trench) >> QGVAR(diggingDuration)), 20]; private _digTimeLeft = _digTime * (1 - _actualProgress); private _placeData = _trench getVariable [QGVAR(placeData), [[], []]]; diff --git a/addons/trenches/functions/fnc_removeTrench.sqf b/addons/trenches/functions/fnc_removeTrench.sqf index 4340a538ad..868daa738c 100644 --- a/addons/trenches/functions/fnc_removeTrench.sqf +++ b/addons/trenches/functions/fnc_removeTrench.sqf @@ -25,7 +25,7 @@ if(_actualProgress == 0) exitWith {}; // Mark trench as being worked on _trench setVariable [QGVAR(digging), true, true]; -private _removeTime = getNumber (configFile >> "CfgVehicles" >> (typeof _trench) >> QGVAR(removalDuration)); +private _removeTime = missionNamespace getVariable [getText (configFile >> "CfgVehicles" >> (typeof _trench) >> QGVAR(removalDuration)), 12]; private _removeTimeLeft = _removeTime * _actualProgress; if (isNil {_trench getVariable QGVAR(placeData)}) then { diff --git a/addons/trenches/initSettings.sqf b/addons/trenches/initSettings.sqf new file mode 100644 index 0000000000..7abce22295 --- /dev/null +++ b/addons/trenches/initSettings.sqf @@ -0,0 +1,36 @@ +// Trenches dig/remove durations +[ + QGVAR(smallEnvelopeDigDuration), + "TIME", + [LSTRING(SmallEnvelopeDigDuration_DisplayName), LSTRING(SmallEnvelopeDigDuration_Description)], + LSTRING(Category), + [5, 600, 20], + true +] call CBA_fnc_addSetting; + +[ + QGVAR(smallEnvelopeRemoveDuration), + "TIME", + [LSTRING(SmallEnvelopeRemoveDuration_DisplayName), LSTRING(SmallEnvelopeRemoveDuration_Description)], + LSTRING(Category), + [5, 600, 12], + true +] call CBA_fnc_addSetting; + +[ + QGVAR(bigEnvelopeDigDuration), + "TIME", + [LSTRING(BigEnvelopeDigDuration_DisplayName), LSTRING(BigEnvelopeDigDuration_Description)], + LSTRING(Category), + [5, 600, 25], + true +] call CBA_fnc_addSetting; + +[ + QGVAR(bigEnvelopeRemoveDuration), + "TIME", + [LSTRING(BigEnvelopeRemoveDuration_DisplayName), LSTRING(BigEnvelopeRemoveDuration_Description)], + LSTRING(Category), + [5, 600, 15], + true +] call CBA_fnc_addSetting; diff --git a/addons/trenches/stringtable.xml b/addons/trenches/stringtable.xml index 1dd42ee24f..e72e5ef784 100644 --- a/addons/trenches/stringtable.xml +++ b/addons/trenches/stringtable.xml @@ -239,5 +239,41 @@ 移除掩體中 Siper Kaldırılıyor + + ACE Trenches + ACE Tranchées + + + Small Trench Dig Duration + Petites tranchées - durée d'excavation + + + Time, in seconds, required to dig a small trench. + Définit le temps nécessaire au déploiement des petites tranchées (en secondes). + + + Small Trench Remove Duration + Petites tranchées - durée de retrait + + + Time, in seconds, required to remove a small trench. + Définit le temps nécessaire pour le retrait des petites tranchées (en secondes). + + + Big Trench Dig Duration + Grandes tranchées - durée d'excavation + + + Time, in seconds, required to dig a big trench. + Définit le temps nécessaire au déploiement des grandes tranchées (en secondes). + + + Big Trench Remove Duration + Grandes tranchées - durée de retrait + + + Time, in seconds, required to remove a big trench. + Définit le temps nécessaire pour le retrait des grandes tranchées (en secondes). +