using System.Runtime.Serialization; using NewHorizons.Utility; using System.ComponentModel; using Newtonsoft.Json; using Newtonsoft.Json.Converters; namespace NewHorizons.External.Modules { public enum CloudFluidType { [EnumMember(Value = @"NONE")] None = 0, [EnumMember(Value = @"WATER")] Water = 1, [EnumMember(Value = @"CLOUD")] Cloud = 2, [EnumMember(Value = @"SAND")] Sand = 3, [EnumMember(Value = @"PLASMA")] Plasma = 4 } [JsonObject] public class AtmosphereModule { /// /// Scale height of the atmosphere /// public float Size; /// /// Colour of atmospheric shader on the planet. /// public MColor AtmosphereTint; /// /// Colour of fog on the planet, if you put fog. /// public MColor FogTint; /// /// How dense the fog is, if you put fog. /// // FIXME: Min & Max Needed! public float FogDensity; /// /// Radius of fog sphere, independent of the atmosphere. This has to be set for there to be fog. /// public float FogSize; /// /// Does this planet have rain? /// public bool HasRain; /// /// Does this planet have snow? /// public bool HasSnow; /// /// Lets you survive on the planet without a suit. /// public bool HasOxygen; /// /// Whether we use an atmospheric shader on the planet. Doesn't affect clouds, fog, rain, snow, oxygen, etc. Purely visual. /// public bool UseAtmosphereShader; /// /// Describes the clouds in the atmosphere /// public CloudInfo Clouds; #region Obsolete [System.Obsolete("CloudTint is deprecated, please use CloudInfo instead")] public MColor CloudTint; [System.Obsolete("CloudTint is deprecated, please use CloudInfo instead")] public string Cloud; [System.Obsolete("CloudCap is deprecated, please use CloudInfo instead")] public string CloudCap; [System.Obsolete("CloudRamp is deprecated, please use CloudInfo instead")] public string CloudRamp; [System.Obsolete("CloudFluidType is deprecated, please use CloudInfo instead")] [JsonConverter(typeof(StringEnumConverter))] public CloudFluidType? FluidType; [System.Obsolete("UseBasicCloudShader is deprecated, please use CloudInfo instead")] public bool UseBasicCloudShader; [DefaultValue(true)] [System.Obsolete("ShadowsOnClouds is deprecated, please use CloudInfo instead")] public bool ShadowsOnClouds = true; [System.Obsolete("HasAtmosphere is deprecated, please use UseAtmosphereShader instead")] public bool HasAtmosphere; #endregion Obsolete public class AirInfo { public float Scale; public bool HasOxygen; public bool IsRaining; public bool IsSnowing; } [JsonObject] public class CloudInfo { /// /// Radius from the center to the outer layer of the clouds. /// public float OuterCloudRadius; /// /// Radius from the center to the inner layer of the clouds. /// public float InnerCloudRadius; /// /// Colour of the inner cloud layer. /// public MColor Tint; /// /// Relative filepath to the cloud texture, if the planet has clouds. /// public string TexturePath; /// /// Relative filepath to the cloud cap texture, if the planet has clouds. /// public string CapPath; /// /// Relative filepath to the cloud ramp texture, if the planet has clouds. If you don't put anything here it will be auto-generated. /// public string RampPath; /// /// Fluid type for sounds/effects when colliding with this cloud. /// [JsonConverter(typeof(StringEnumConverter))] public CloudFluidType? FluidType = CloudFluidType.Cloud; /// /// Set to `false` in order to use Giant's deep shader. Set to `true` to just apply the cloud texture as is. /// public bool UseBasicCloudShader; /// /// If the top layer shouldn't have shadows. Set to true if you're making a brown dwarf for example. /// public bool Unlit; /// /// Add lightning to this planet like on Giant's Deep. /// public bool HasLightning; /// /// Colour gradient of the lightning, time is in seconds. /// public MGradient[] LightningGradient; } } }