Rename serialized types

This commit is contained in:
Nick 2023-03-25 14:50:07 -04:00
parent c7501b0e92
commit 9b18438760
11 changed files with 17 additions and 16 deletions

View File

@ -8,7 +8,7 @@ namespace NewHorizons.Components.Volumes
{
internal class LoadCreditsVolume : BaseVolume
{
public CreditsType creditsType = CreditsType.Fast;
public NHCreditsType creditsType = NHCreditsType.Fast;
public string gameOverText;
public DeathType deathType = DeathType.Default;
@ -69,13 +69,13 @@ namespace NewHorizons.Components.Volumes
switch (creditsType)
{
case CreditsType.Fast:
case NHCreditsType.Fast:
LoadManager.LoadScene(OWScene.Credits_Fast, LoadManager.FadeType.ToBlack);
break;
case CreditsType.Final:
case NHCreditsType.Final:
LoadManager.LoadScene(OWScene.Credits_Final, LoadManager.FadeType.ToBlack);
break;
case CreditsType.Kazoo:
case NHCreditsType.Kazoo:
TimelineObliterationController.s_hasRealityEnded = true;
LoadManager.LoadScene(OWScene.Credits_Fast, LoadManager.FadeType.ToBlack);
break;

View File

@ -120,7 +120,7 @@ namespace NewHorizons.External.Modules
/// <summary>
/// Fluid type for sounds/effects when colliding with this cloud.
/// </summary>
[DefaultValue("cloud")] public FluidType fluidType = FluidType.Cloud;
[DefaultValue("cloud")] public NHFluidType fluidType = NHFluidType.Cloud;
/// <summary>
/// Add lightning to this planet like on Giant's Deep.
@ -197,7 +197,7 @@ namespace NewHorizons.External.Modules
public string cloudRamp;
[Obsolete("FluidType is deprecated, please use CloudInfo instead")]
public FluidType fluidType;
public NHFluidType fluidType;
[Obsolete("UseBasicCloudShader is deprecated, please use CloudInfo instead")]
public bool useBasicCloudShader;

View File

@ -68,7 +68,7 @@ namespace NewHorizons.External.Modules.Props
/// <summary>
/// Fluid type for sounds/effects when colliding with this tornado.
/// </summary>
[DefaultValue("cloud")] public FluidType fluidType = FluidType.Cloud;
[DefaultValue("cloud")] public NHFluidType fluidType = NHFluidType.Cloud;
}
}

View File

@ -12,7 +12,7 @@ namespace NewHorizons.External.Modules
/// <summary>
/// Fluid type for sounds/effects when colliding with this ring.
/// </summary>
public FluidType fluidType = FluidType.None;
public NHFluidType fluidType = NHFluidType.None;
/// <summary>
/// Angle between the rings and the equatorial plane of the planet.

View File

@ -5,7 +5,7 @@ using System.Runtime.Serialization;
namespace NewHorizons.External.Modules.SerializableEnums
{
[JsonConverter(typeof(StringEnumConverter))]
public enum CreditsType
public enum NHCreditsType
{
[EnumMember(Value = @"fast")] Fast = 0,

View File

@ -5,7 +5,7 @@ using System.Runtime.Serialization;
namespace NewHorizons.External.Modules.SerializableEnums
{
[JsonConverter(typeof(StringEnumConverter))]
public enum DeathType
public enum NHDeathType
{
[EnumMember(Value = @"default")] Default,
[EnumMember(Value = @"impact")] Impact,

View File

@ -5,7 +5,7 @@ using System.Runtime.Serialization;
namespace NewHorizons.External.Modules.SerializableEnums
{
[JsonConverter(typeof(StringEnumConverter))]
public enum FluidType
public enum NHFluidType
{
[EnumMember(Value = @"none")] None = 0,

View File

@ -1,3 +1,4 @@
using NewHorizons.External.Modules.SerializableEnums;
using Newtonsoft.Json;
using System.ComponentModel;
@ -9,7 +10,7 @@ namespace NewHorizons.External.Modules.Volumes.VolumeInfos
/// <summary>
/// The type of death the player will have if they enter this volume.
/// </summary>
[DefaultValue("default")] public DeathType deathType = DeathType.Default;
[DefaultValue("default")] public NHDeathType deathType = NHDeathType.Default;
}
}

View File

@ -15,7 +15,7 @@ namespace NewHorizons.External.Modules.Volumes.VolumeInfos
/// <summary>
/// The type of fluid for this volume.
/// </summary>
public FluidType type;
public NHFluidType type;
/// <summary>
/// Should the player and rafts align to this fluid.

View File

@ -7,7 +7,7 @@ namespace NewHorizons.External.Modules.Volumes.VolumeInfos
[JsonObject]
public class LoadCreditsVolumeInfo : VolumeInfo
{
[DefaultValue("fast")] public CreditsType creditsType = CreditsType.Fast;
[DefaultValue("fast")] public NHCreditsType creditsType = NHCreditsType.Fast;
/// <summary>
/// Text displayed in orange on game over. For localization, put translations under UI.
@ -17,6 +17,6 @@ namespace NewHorizons.External.Modules.Volumes.VolumeInfos
/// <summary>
/// The type of death the player will have if they enter this volume.
/// </summary>
[DefaultValue("default")] public DeathType deathType = DeathType.Default;
[DefaultValue("default")] public NHDeathType deathType = NHDeathType.Default;
}
}

View File

@ -252,6 +252,6 @@ namespace NewHorizons.Utility
return xCorrect && yCorrect && zCorrect;
}
public static FluidVolume.Type ConvertToOW(this FluidType fluidType, FluidVolume.Type @default = FluidVolume.Type.NONE) => EnumUtils.Parse(fluidType.ToString().ToUpper(), @default);
public static FluidVolume.Type ConvertToOW(this NHFluidType fluidType, FluidVolume.Type @default = FluidVolume.Type.NONE) => EnumUtils.Parse(fluidType.ToString().ToUpper(), @default);
}
}