From 51ea50ac68ca8ba67d034cb3b2057b93773fc927 Mon Sep 17 00:00:00 2001 From: xen-42 Date: Wed, 2 Oct 2024 23:54:18 -0400 Subject: [PATCH] Add allowShipAutoroll to Atmosphere and Water modules #935 --- NewHorizons/Builder/Atmosphere/AirBuilder.cs | 2 +- NewHorizons/Builder/Atmosphere/CloudsBuilder.cs | 2 +- NewHorizons/Builder/Body/WaterBuilder.cs | 2 +- NewHorizons/External/Modules/AtmosphereModule.cs | 6 ++++++ NewHorizons/External/Modules/VariableSize/WaterModule.cs | 6 ++++++ 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/NewHorizons/Builder/Atmosphere/AirBuilder.cs b/NewHorizons/Builder/Atmosphere/AirBuilder.cs index 8d502f88..979bd933 100644 --- a/NewHorizons/Builder/Atmosphere/AirBuilder.cs +++ b/NewHorizons/Builder/Atmosphere/AirBuilder.cs @@ -22,7 +22,7 @@ namespace NewHorizons.Builder.Atmosphere sfv._priority = 0; sfv._density = 1.2f; sfv._fluidType = FluidVolume.Type.AIR; - sfv._allowShipAutoroll = true; + sfv._allowShipAutoroll = config.Atmosphere.allowShipAutoroll; sfv._disableOnStart = false; if (config.Atmosphere.hasShockLayer) diff --git a/NewHorizons/Builder/Atmosphere/CloudsBuilder.cs b/NewHorizons/Builder/Atmosphere/CloudsBuilder.cs index ceef7fd5..5e998cf3 100644 --- a/NewHorizons/Builder/Atmosphere/CloudsBuilder.cs +++ b/NewHorizons/Builder/Atmosphere/CloudsBuilder.cs @@ -147,7 +147,7 @@ namespace NewHorizons.Builder.Atmosphere fluidCLFV._priority = 1; fluidCLFV._density = 1.2f; fluidCLFV._fluidType = atmo.clouds.fluidType.ConvertToOW(FluidVolume.Type.CLOUD); - fluidCLFV._allowShipAutoroll = true; + fluidCLFV._allowShipAutoroll = atmo.allowShipAutoroll; fluidCLFV._disableOnStart = false; // Fix the rotations once the rest is done diff --git a/NewHorizons/Builder/Body/WaterBuilder.cs b/NewHorizons/Builder/Body/WaterBuilder.cs index 8eba73c0..b53b4617 100644 --- a/NewHorizons/Builder/Body/WaterBuilder.cs +++ b/NewHorizons/Builder/Body/WaterBuilder.cs @@ -129,7 +129,7 @@ namespace NewHorizons.Builder.Body fluidVolume._density = module.density; fluidVolume._layer = 5; fluidVolume._priority = 3; - fluidVolume._allowShipAutoroll = true; + fluidVolume._allowShipAutoroll = module.allowShipAutoroll; fluidVolume._disableOnStart = false; var fogGO = Object.Instantiate(_oceanFog, waterGO.transform); diff --git a/NewHorizons/External/Modules/AtmosphereModule.cs b/NewHorizons/External/Modules/AtmosphereModule.cs index e318f372..eb31dac2 100644 --- a/NewHorizons/External/Modules/AtmosphereModule.cs +++ b/NewHorizons/External/Modules/AtmosphereModule.cs @@ -107,6 +107,12 @@ namespace NewHorizons.External.Modules /// [DefaultValue(300f)] public float maxShockSpeed = 300f; + /// + /// Will the ship automatically try to orient itself to face upwards while in this volume? + /// + [DefaultValue(true)] + public bool allowShipAutoroll = true; + [JsonObject] public class CloudInfo { diff --git a/NewHorizons/External/Modules/VariableSize/WaterModule.cs b/NewHorizons/External/Modules/VariableSize/WaterModule.cs index 3443f162..d28ffb7c 100644 --- a/NewHorizons/External/Modules/VariableSize/WaterModule.cs +++ b/NewHorizons/External/Modules/VariableSize/WaterModule.cs @@ -26,5 +26,11 @@ namespace NewHorizons.External.Modules.VariableSize /// Tint of the water /// public MColor tint; + + /// + /// Will the ship automatically try to orient itself to face upwards while in this volume? + /// + [DefaultValue(true)] + public bool allowShipAutoroll = true; } } \ No newline at end of file