Move skybox module to separate file

This commit is contained in:
Noah Pilarski 2025-01-25 05:04:55 -05:00
parent 02c771d1b8
commit 8e5d7369d6
3 changed files with 51 additions and 48 deletions

View File

@ -1,4 +1,4 @@
using NewHorizons.External.Configs; using NewHorizons.External.Modules;
using NewHorizons.Utility; using NewHorizons.Utility;
using NewHorizons.Utility.Files; using NewHorizons.Utility.Files;
using NewHorizons.Utility.OWML; using NewHorizons.Utility.OWML;
@ -13,13 +13,13 @@ namespace NewHorizons.Builder.StarSystem
{ {
private static readonly Shader _unlitShader = Shader.Find("Unlit/Texture"); private static readonly Shader _unlitShader = Shader.Find("Unlit/Texture");
public static void Make(StarSystemConfig.SkyboxModule module, IModBehaviour mod) public static void Make(SkyboxModule module, IModBehaviour mod)
{ {
NHLogger.Log("Building Skybox"); NHLogger.Log("Building Skybox");
BuildSkySphere(module, mod); BuildSkySphere(module, mod);
} }
public static GameObject BuildSkySphere(StarSystemConfig.SkyboxModule module, IModBehaviour mod) public static GameObject BuildSkySphere(SkyboxModule module, IModBehaviour mod)
{ {
var skybox = SearchUtilities.Find("Skybox"); var skybox = SearchUtilities.Find("Skybox");

View File

@ -175,51 +175,6 @@ namespace NewHorizons.External.Configs
public int[] z; public int[] z;
} }
[JsonObject]
public class SkyboxModule
{
/// <summary>
/// Whether to destroy the star field around the player
/// </summary>
public bool destroyStarField;
/// <summary>
/// Whether to use a cube for the skybox instead of a smooth sphere
/// </summary>
public bool useCube;
/// <summary>
/// Relative filepath to the texture to use for the skybox's positive X direction
/// </summary>
public string rightPath;
/// <summary>
/// Relative filepath to the texture to use for the skybox's negative X direction
/// </summary>
public string leftPath;
/// <summary>
/// Relative filepath to the texture to use for the skybox's positive Y direction
/// </summary>
public string topPath;
/// <summary>
/// Relative filepath to the texture to use for the skybox's negative Y direction
/// </summary>
public string bottomPath;
/// <summary>
/// Relative filepath to the texture to use for the skybox's positive Z direction
/// </summary>
public string frontPath;
/// <summary>
/// Relative filepath to the texture to use for the skybox's negative Z direction
/// </summary>
public string backPath;
}
[JsonObject] [JsonObject]
public class GlobalMusicModule public class GlobalMusicModule
{ {

View File

@ -0,0 +1,48 @@
using Newtonsoft.Json;
namespace NewHorizons.External.Modules
{
[JsonObject]
public class SkyboxModule
{
/// <summary>
/// Whether to destroy the star field around the player
/// </summary>
public bool destroyStarField;
/// <summary>
/// Whether to use a cube for the skybox instead of a smooth sphere
/// </summary>
public bool useCube;
/// <summary>
/// Relative filepath to the texture to use for the skybox's positive X direction
/// </summary>
public string rightPath;
/// <summary>
/// Relative filepath to the texture to use for the skybox's negative X direction
/// </summary>
public string leftPath;
/// <summary>
/// Relative filepath to the texture to use for the skybox's positive Y direction
/// </summary>
public string topPath;
/// <summary>
/// Relative filepath to the texture to use for the skybox's negative Y direction
/// </summary>
public string bottomPath;
/// <summary>
/// Relative filepath to the texture to use for the skybox's positive Z direction
/// </summary>
public string frontPath;
/// <summary>
/// Relative filepath to the texture to use for the skybox's negative Z direction
/// </summary>
public string backPath;
}
}