Deprecate goSupernova

This commit is contained in:
Noah Pilarski 2022-08-18 14:50:48 -04:00
parent 7c02d5f85b
commit fc6d5d8a74
3 changed files with 12 additions and 3 deletions

View File

@ -161,7 +161,7 @@ namespace NewHorizons.Builder.Body
controller.StartColour = starModule.tint;
controller.EndColour = starModule.endTint;
controller.SupernovaColour = starModule.supernovaTint;
controller.WillExplode = starModule.goSupernova;
controller.WillExplode = starModule.stellarDeathType != StellarDeathType.None;
controller.lifespan = starModule.lifespan;
controller.normalRamp = !string.IsNullOrEmpty(starModule.starRampTexture) ? ImageUtilities.GetTexture(mod, starModule.starRampTexture) : ramp;
controller._heatVolume = heatVolume.GetComponent<HeatHazardVolume>();
@ -217,7 +217,7 @@ namespace NewHorizons.Builder.Body
controller.StartColour = starModule.tint;
controller.EndColour = starModule.endTint;
controller.SupernovaColour = starModule.supernovaTint;
controller.WillExplode = starModule.goSupernova;
controller.WillExplode = starModule.stellarDeathType != StellarDeathType.None;
controller.lifespan = starModule.lifespan;
controller.normalRamp = !string.IsNullOrEmpty(starModule.starRampTexture) ? ImageUtilities.GetTexture(mod, starModule.starRampTexture) : ramp;
if (!string.IsNullOrEmpty(starModule.starCollapseRampTexture))

View File

@ -351,6 +351,13 @@ namespace NewHorizons.External.Configs
if (Props.signals == null) Props.signals = new SignalModule.SignalInfo[0];
Props.signals = Props.signals.Concat(Signal.signals).ToArray();
}
// Star
if (Star != null)
{
if (!Star.goSupernova) Star.stellarDeathType = StellarDeathType.None;
}
// Signals no longer use two different variables for audio
if (Props?.signals != null)
{

View File

@ -1,3 +1,4 @@
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
@ -19,7 +20,7 @@ namespace NewHorizons.External.Modules.VariableSize
/// <summary>
/// Should this star explode at the end of its lifespan?
/// </summary>
[DefaultValue(true)] public bool goSupernova = true;
[Obsolete("goSupernova is deprecated, please use stellarDeathType instead")] [DefaultValue(true)] public bool goSupernova = true;
/// <summary>
/// How long in minutes this star will last until it supernovas.
@ -103,6 +104,7 @@ namespace NewHorizons.External.Modules.VariableSize
public enum StellarDeathType
{
[EnumMember(Value = @"default")] Default,
[EnumMember(Value = @"none")] None,
[EnumMember(Value = @"planetaryNebula")] PlanetaryNebula,
[EnumMember(Value = @"supernova")] Supernova
}