mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Organize + validate
This commit is contained in:
parent
a475564db6
commit
e1e630aaef
@ -1,8 +1,5 @@
|
||||
using NewHorizons.External;
|
||||
using OWML.Utils;
|
||||
using NewHorizons.External.Modules;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
|
||||
namespace NewHorizons.Builder.Atmosphere
|
||||
{
|
||||
public static class AirBuilder
|
||||
@ -26,7 +23,7 @@ namespace NewHorizons.Builder.Atmosphere
|
||||
SFV._allowShipAutoroll = true;
|
||||
SFV._disableOnStart = false;
|
||||
|
||||
if(info.HasOxygen)
|
||||
if (info.HasOxygen)
|
||||
{
|
||||
airGO.AddComponent<OxygenVolume>();
|
||||
}
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
using NewHorizons.External;
|
||||
using NewHorizons.External.Modules;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
|
||||
namespace NewHorizons.Builder.Atmosphere
|
||||
{
|
||||
public static class AtmosphereBuilder
|
||||
@ -18,11 +16,11 @@ namespace NewHorizons.Builder.Atmosphere
|
||||
atmo.transform.parent = atmoGO.transform;
|
||||
atmo.transform.position = planetGO.transform.TransformPoint(Vector3.zero);
|
||||
atmo.transform.localScale = Vector3.one * atmosphereModule.Size * 1.2f;
|
||||
foreach(var meshRenderer in atmo.GetComponentsInChildren<MeshRenderer>())
|
||||
foreach (var meshRenderer in atmo.GetComponentsInChildren<MeshRenderer>())
|
||||
{
|
||||
meshRenderer.material.SetFloat("_InnerRadius", atmosphereModule.Cloud != null ? atmosphereModule.Size : surfaceSize);
|
||||
meshRenderer.material.SetFloat("_OuterRadius", atmosphereModule.Size * 1.2f);
|
||||
if(atmosphereModule.AtmosphereTint != null)
|
||||
if (atmosphereModule.AtmosphereTint != null)
|
||||
meshRenderer.material.SetColor("_SkyColor", atmosphereModule.AtmosphereTint.ToColor());
|
||||
}
|
||||
|
||||
|
||||
@ -1,11 +1,9 @@
|
||||
using NewHorizons.External;
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.Utility;
|
||||
using OWML.Common;
|
||||
using OWML.Utils;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
|
||||
namespace NewHorizons.Builder.Atmosphere
|
||||
{
|
||||
public static class CloudsBuilder
|
||||
@ -95,7 +93,7 @@ namespace NewHorizons.Builder.Atmosphere
|
||||
// Fix the rotations once the rest is done
|
||||
cloudsMainGO.transform.rotation = planetGO.transform.TransformRotation(Quaternion.Euler(0, 0, 0));
|
||||
// For the base shader it has to be rotated idk
|
||||
if(atmo.UseBasicCloudShader) cloudsMainGO.transform.rotation = planetGO.transform.TransformRotation(Quaternion.Euler(90, 0, 0));
|
||||
if (atmo.UseBasicCloudShader) cloudsMainGO.transform.rotation = planetGO.transform.TransformRotation(Quaternion.Euler(90, 0, 0));
|
||||
|
||||
cloudsMainGO.transform.position = planetGO.transform.TransformPoint(Vector3.zero);
|
||||
cloudsBottomGO.transform.position = planetGO.transform.TransformPoint(Vector3.zero);
|
||||
|
||||
@ -1,9 +1,6 @@
|
||||
using NewHorizons.External;
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.Utility;
|
||||
using OWML.Utils;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
|
||||
namespace NewHorizons.Builder.Atmosphere
|
||||
{
|
||||
public static class EffectsBuilder
|
||||
@ -22,7 +19,7 @@ namespace NewHorizons.Builder.Atmosphere
|
||||
SCG._dynamicCullingBounds = false;
|
||||
SCG._waitForStreaming = false;
|
||||
|
||||
if(info.IsRaining)
|
||||
if (info.IsRaining)
|
||||
{
|
||||
var rainGO = GameObject.Instantiate(SearchUtilities.CachedFind("/GiantsDeep_Body/Sector_GD/Sector_GDInterior/Effects_GDInterior/Effects_GD_Rain"), effectsGO.transform);
|
||||
rainGO.transform.position = planetGO.transform.position;
|
||||
@ -40,12 +37,12 @@ namespace NewHorizons.Builder.Atmosphere
|
||||
rainGO.SetActive(true);
|
||||
}
|
||||
|
||||
if(info.IsSnowing)
|
||||
if (info.IsSnowing)
|
||||
{
|
||||
var snowGO = new GameObject("SnowEffects");
|
||||
snowGO.transform.parent = effectsGO.transform;
|
||||
snowGO.transform.position = planetGO.transform.position;
|
||||
for(int i = 0; i < 5; i++)
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
var snowEmitter = GameObject.Instantiate(SearchUtilities.CachedFind("/BrittleHollow_Body/Sector_BH/Effects_BH/Effects_BH_Snowflakes"), snowGO.transform);
|
||||
snowEmitter.name = "SnowEmitter";
|
||||
|
||||
@ -1,13 +1,5 @@
|
||||
using NewHorizons.External;
|
||||
using OWML.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using NewHorizons.External.Modules;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
|
||||
namespace NewHorizons.Builder.Atmosphere
|
||||
{
|
||||
public static class FogBuilder
|
||||
|
||||
@ -1,8 +1,5 @@
|
||||
using NewHorizons.External;
|
||||
using OWML.Utils;
|
||||
using NewHorizons.External.Modules;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
|
||||
namespace NewHorizons.Builder.Atmosphere
|
||||
{
|
||||
public static class SunOverrideBuilder
|
||||
|
||||
@ -1,14 +1,10 @@
|
||||
using NewHorizons.External;
|
||||
using NewHorizons.External.Configs;
|
||||
using OWML.Utils;
|
||||
using NewHorizons.External.Configs;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
|
||||
namespace NewHorizons.Builder.Atmosphere
|
||||
{
|
||||
public static class VolumesBuilder
|
||||
{
|
||||
public static void Make(GameObject planetGO, IPlanetConfig config, float sphereOfInfluence)
|
||||
public static void Make(GameObject planetGO, PlanetConfig config, float sphereOfInfluence)
|
||||
{
|
||||
var innerRadius = config.Base.SurfaceSize;
|
||||
var useMiniMap = config.Base.IsSatellite;
|
||||
|
||||
@ -1,22 +1,15 @@
|
||||
using NewHorizons.External;
|
||||
using NewHorizons.External.Configs;
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.Handlers;
|
||||
using NewHorizons.Utility;
|
||||
using OWML.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using NewHorizons.External.Configs;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
using Random = UnityEngine.Random;
|
||||
using NewHorizons.Handlers;
|
||||
|
||||
namespace NewHorizons.Builder.Body
|
||||
{
|
||||
public static class AsteroidBeltBuilder
|
||||
{
|
||||
public static void Make(string bodyName, IPlanetConfig parentConfig, IModBehaviour mod)
|
||||
public static void Make(string bodyName, PlanetConfig parentConfig, IModBehaviour mod)
|
||||
{
|
||||
var belt = parentConfig.AsteroidBelt;
|
||||
|
||||
@ -57,7 +50,7 @@ namespace NewHorizons.Builder.Body
|
||||
};
|
||||
|
||||
config.ProcGen = belt.ProcGen;
|
||||
if(config.ProcGen == null)
|
||||
if (config.ProcGen == null)
|
||||
{
|
||||
config.ProcGen = new ProcGenModule()
|
||||
{
|
||||
|
||||
@ -1,12 +1,6 @@
|
||||
using NewHorizons.Components;
|
||||
using NewHorizons.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NewHorizons.Builder.Body
|
||||
{
|
||||
public static class CloakBuilder
|
||||
|
||||
@ -1,18 +1,10 @@
|
||||
using NewHorizons.External;
|
||||
using NewHorizons.External.Configs;
|
||||
using OWML.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using NewHorizons.External.Configs;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NewHorizons.Builder.Body
|
||||
{
|
||||
public static class CometTailBuilder
|
||||
{
|
||||
public static void Make(GameObject planetGO, Sector sector, IPlanetConfig config)
|
||||
public static void Make(GameObject planetGO, Sector sector, PlanetConfig config)
|
||||
{
|
||||
var cometTail = GameObject.Instantiate(GameObject.Find("Comet_Body/Sector_CO/Effects_CO/Effects_CO_TailMeshes"), sector?.transform ?? planetGO.transform);
|
||||
cometTail.transform.position = planetGO.transform.position;
|
||||
|
||||
@ -1,13 +1,8 @@
|
||||
using NewHorizons.Components;
|
||||
using NewHorizons.External.VariableSize;
|
||||
using NewHorizons.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
using NewHorizons.External.Modules.VariableSize;
|
||||
|
||||
namespace NewHorizons.Builder.Body
|
||||
{
|
||||
@ -76,7 +71,7 @@ namespace NewHorizons.Builder.Body
|
||||
|
||||
var waterMaterials = GameObject.Find("TimberHearth_Body/Sector_TH/Geometry_TH/Terrain_TH_Water_v3/Village_Upper_Water/Village_Upper_Water_Geo").GetComponent<MeshRenderer>().materials;
|
||||
var materials = new Material[waterMaterials.Length];
|
||||
for(int i = 0; i < waterMaterials.Length; i++)
|
||||
for (int i = 0; i < waterMaterials.Length; i++)
|
||||
{
|
||||
materials[i] = new Material(waterMaterials[i]);
|
||||
if (module.Tint != null)
|
||||
@ -126,7 +121,7 @@ namespace NewHorizons.Builder.Body
|
||||
lavaMaterial.mainTextureOffset = new Vector2(0.1f, 0.2f);
|
||||
lavaMaterial.mainTextureScale = new Vector2(1f, 3f);
|
||||
|
||||
if(module.Tint != null)
|
||||
if (module.Tint != null)
|
||||
{
|
||||
lavaMaterial.SetColor("_EmissionColor", module.Tint.ToColor());
|
||||
}
|
||||
@ -158,7 +153,7 @@ namespace NewHorizons.Builder.Body
|
||||
|
||||
var funnelSizeController = funnelGO.AddComponent<FunnelController>();
|
||||
|
||||
if(module.Curve != null)
|
||||
if (module.Curve != null)
|
||||
{
|
||||
var curve = new AnimationCurve();
|
||||
foreach (var pair in module.Curve)
|
||||
@ -177,7 +172,7 @@ namespace NewHorizons.Builder.Body
|
||||
{
|
||||
var targetAO = AstroObjectLocator.GetAstroObject(module.Target);
|
||||
var target = targetAO?.GetAttachedOWRigidbody();
|
||||
if(target == null)
|
||||
if (target == null)
|
||||
{
|
||||
if (targetAO != null) Logger.LogError($"Found funnel target ({targetAO.name}) but couldn't find rigidbody for the funnel {funnelGO.name}");
|
||||
else Logger.LogError($"Couldn't find the target ({module.Target}) for the funnel {funnelGO.name}");
|
||||
|
||||
@ -1,12 +1,6 @@
|
||||
using NewHorizons.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
|
||||
namespace NewHorizons.Builder.Body.Geometry
|
||||
{
|
||||
static class CubeSphere
|
||||
@ -14,7 +8,7 @@ namespace NewHorizons.Builder.Body.Geometry
|
||||
public static Mesh Build(int resolution, Texture2D heightMap, float minHeight, float maxHeight, Vector3 stretch)
|
||||
{
|
||||
// It breaks if resolution is greater than 100 I don't know why
|
||||
if(resolution > 100)
|
||||
if (resolution > 100)
|
||||
{
|
||||
Logger.LogWarning($"Can't make CubeSphere's with resolution higher than 100 for some reason");
|
||||
resolution = 100;
|
||||
|
||||
@ -1,11 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
namespace NewHorizons.Builder.Body.Geometry
|
||||
{
|
||||
public static class Icosphere
|
||||
@ -75,7 +71,7 @@ namespace NewHorizons.Builder.Body.Geometry
|
||||
|
||||
var randomOffset = new Vector3(Random.Range(0, 10f), Random.Range(0, 10f), Random.Range(0, 10f));
|
||||
|
||||
for(int i = 0; i < verticesToCopy.Length; i++)
|
||||
for (int i = 0; i < verticesToCopy.Length; i++)
|
||||
{
|
||||
var v = verticesToCopy[i];
|
||||
|
||||
@ -105,7 +101,7 @@ namespace NewHorizons.Builder.Body.Geometry
|
||||
{
|
||||
if (level < vertices.Count) return;
|
||||
|
||||
for(int i = vertices.Count - 1; i < level; i++)
|
||||
for (int i = vertices.Count - 1; i < level; i++)
|
||||
{
|
||||
// Each triangle will be subdivided into 4 new ones
|
||||
int[] oldTriangles = triangles[i];
|
||||
@ -118,7 +114,7 @@ namespace NewHorizons.Builder.Body.Geometry
|
||||
|
||||
int v = oldVertices.Length;
|
||||
int newTrianglesIndex = 0;
|
||||
for(int j = 0; j < oldTriangles.Length; j+=3, v+=3)
|
||||
for (int j = 0; j < oldTriangles.Length; j += 3, v += 3)
|
||||
{
|
||||
// Old vertex indices
|
||||
var v0Ind = oldTriangles[j];
|
||||
|
||||
@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
using UnityEngine;
|
||||
namespace NewHorizons.Builder.Body.Geometry
|
||||
{
|
||||
// Perlin noise generator for Unity
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
|
||||
namespace NewHorizons.Builder.Body
|
||||
{
|
||||
public static class GeometryBuilder
|
||||
|
||||
@ -1,16 +1,10 @@
|
||||
using NewHorizons.Builder.Body.Geometry;
|
||||
using NewHorizons.Builder.Props;
|
||||
using NewHorizons.External;
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.Utility;
|
||||
using OWML.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
|
||||
namespace NewHorizons.Builder.Body
|
||||
{
|
||||
public static class HeightMapBuilder
|
||||
@ -27,7 +21,7 @@ namespace NewHorizons.Builder.Body
|
||||
if (module.TextureMap == null) textureMap = Texture2D.whiteTexture;
|
||||
else textureMap = ImageUtilities.GetTexture(mod, module.TextureMap);
|
||||
}
|
||||
catch(Exception e)
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.LogError($"Couldn't load HeightMap textures, {e.Message}, {e.StackTrace}");
|
||||
return;
|
||||
@ -56,7 +50,7 @@ namespace NewHorizons.Builder.Body
|
||||
var cubeSphereMC = cubeSphere.AddComponent<MeshCollider>();
|
||||
cubeSphereMC.sharedMesh = mesh;
|
||||
|
||||
if(planetGO.GetComponent<ProxyShadowCasterSuperGroup>() != null) cubeSphere.AddComponent<ProxyShadowCaster>();
|
||||
if (planetGO.GetComponent<ProxyShadowCasterSuperGroup>() != null) cubeSphere.AddComponent<ProxyShadowCaster>();
|
||||
|
||||
// Fix rotation in the end
|
||||
cubeSphere.transform.rotation = planetGO.transform.TransformRotation(Quaternion.Euler(90, 0, 0));
|
||||
|
||||
@ -1,12 +1,6 @@
|
||||
using NewHorizons.External.VariableSize;
|
||||
using OWML.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
using NewHorizons.External.Modules.VariableSize;
|
||||
|
||||
namespace NewHorizons.Builder.Body
|
||||
{
|
||||
@ -15,10 +9,10 @@ namespace NewHorizons.Builder.Body
|
||||
public static void Make(GameObject planetGO, Sector sector, OWRigidbody rb, LavaModule module)
|
||||
{
|
||||
var heightScale = module.Size;
|
||||
if(module.Curve != null)
|
||||
if (module.Curve != null)
|
||||
{
|
||||
var modifier = 1f;
|
||||
foreach(var pair in module.Curve)
|
||||
foreach (var pair in module.Curve)
|
||||
{
|
||||
if (pair.Value < modifier) modifier = pair.Value;
|
||||
}
|
||||
@ -35,7 +29,7 @@ namespace NewHorizons.Builder.Body
|
||||
lavaSphere.transform.localScale = Vector3.one;
|
||||
lavaSphere.transform.name = "LavaSphere";
|
||||
lavaSphere.GetComponent<MeshRenderer>().material.SetFloat("_HeightScale", heightScale);
|
||||
if(module.Tint != null) lavaSphere.GetComponent<MeshRenderer>().material.SetColor("_EmissionColor", module.Tint.ToColor());
|
||||
if (module.Tint != null) lavaSphere.GetComponent<MeshRenderer>().material.SetColor("_EmissionColor", module.Tint.ToColor());
|
||||
|
||||
var sectorCullGroup = lavaSphere.GetComponent<SectorCullGroup>();
|
||||
sectorCullGroup.SetSector(sector);
|
||||
|
||||
@ -1,13 +1,7 @@
|
||||
using NewHorizons.Builder.Body.Geometry;
|
||||
using NewHorizons.External;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.Utility;
|
||||
|
||||
using UnityEngine;
|
||||
namespace NewHorizons.Builder.Body
|
||||
{
|
||||
public static class ProcGenBuilder
|
||||
@ -17,8 +11,8 @@ namespace NewHorizons.Builder.Body
|
||||
|
||||
public static void Make(GameObject planetGO, Sector sector, ProcGenModule module)
|
||||
{
|
||||
if(quantumMaterial == null) quantumMaterial = SearchUtilities.FindResourceOfTypeAndName<Material>("Rock_QM_EyeRock_mat");
|
||||
if(iceMaterial == null) iceMaterial = SearchUtilities.FindResourceOfTypeAndName<Material>("Rock_BH_IceSpike_mat");
|
||||
if (quantumMaterial == null) quantumMaterial = SearchUtilities.FindResourceOfTypeAndName<Material>("Rock_QM_EyeRock_mat");
|
||||
if (iceMaterial == null) iceMaterial = SearchUtilities.FindResourceOfTypeAndName<Material>("Rock_BH_IceSpike_mat");
|
||||
|
||||
|
||||
GameObject icosphere = new GameObject("Icosphere");
|
||||
|
||||
@ -2,12 +2,11 @@
|
||||
using NewHorizons.Builder.Props;
|
||||
using NewHorizons.Components;
|
||||
using NewHorizons.Components.SizeControllers;
|
||||
using NewHorizons.External.VariableSize;
|
||||
using NewHorizons.Utility;
|
||||
using OWML.Common;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
using NewHorizons.External.Modules.VariableSize;
|
||||
|
||||
namespace NewHorizons.Builder.Body
|
||||
{
|
||||
|
||||
@ -1,16 +1,12 @@
|
||||
using NewHorizons.External;
|
||||
using NewHorizons.Components;
|
||||
using NewHorizons.Components.SizeControllers;
|
||||
using NewHorizons.Utility;
|
||||
using OWML.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using NewHorizons.Utility;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
using NewHorizons.External.VariableSize;
|
||||
using NewHorizons.Components;
|
||||
using NewHorizons.Components.SizeControllers;
|
||||
using NewHorizons.External.Modules.VariableSize;
|
||||
|
||||
namespace NewHorizons.Builder.Body
|
||||
{
|
||||
|
||||
@ -1,11 +1,6 @@
|
||||
using NewHorizons.External.VariableSize;
|
||||
using NewHorizons.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using NewHorizons.Utility;
|
||||
using UnityEngine;
|
||||
using NewHorizons.External.Modules.VariableSize;
|
||||
|
||||
namespace NewHorizons.Builder.Body
|
||||
{
|
||||
|
||||
@ -1,15 +1,9 @@
|
||||
using NewHorizons.Components;
|
||||
using NewHorizons.External;
|
||||
using NewHorizons.External.Configs;
|
||||
using NewHorizons.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using NewHorizons.External.Configs;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
|
||||
namespace NewHorizons.Builder.Body
|
||||
{
|
||||
public static class SingularityBuilder
|
||||
@ -23,18 +17,8 @@ namespace NewHorizons.Builder.Body
|
||||
private static Shader blackHoleShader = null;
|
||||
private static Shader whiteHoleShader = null;
|
||||
|
||||
public static void Make(GameObject go, Sector sector, OWRigidbody OWRB, IPlanetConfig config)
|
||||
public static void Make(GameObject go, Sector sector, OWRigidbody OWRB, PlanetConfig config)
|
||||
{
|
||||
// Backwards compatibility
|
||||
if(config.Singularity == null)
|
||||
{
|
||||
if(config.Base.BlackHoleSize != 0)
|
||||
{
|
||||
MakeBlackHole(go, sector, Vector3.zero, config.Base.BlackHoleSize, true, null);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
var size = config.Singularity.Size;
|
||||
var pairedSingularity = config.Singularity.PairedSingularity;
|
||||
|
||||
@ -63,10 +47,10 @@ namespace NewHorizons.Builder.Body
|
||||
}
|
||||
|
||||
// Try to pair them
|
||||
if(pairedSingularity != null && newSingularity != null)
|
||||
if (pairedSingularity != null && newSingularity != null)
|
||||
{
|
||||
var pairedSingularityAO = AstroObjectLocator.GetAstroObject(pairedSingularity);
|
||||
if(pairedSingularityAO != null)
|
||||
if (pairedSingularityAO != null)
|
||||
{
|
||||
switch (polarity)
|
||||
{
|
||||
@ -117,7 +101,7 @@ namespace NewHorizons.Builder.Body
|
||||
meshRenderer.material.SetFloat("_MassScale", 1);
|
||||
meshRenderer.material.SetFloat("_DistortFadeDist", size * 0.55f);
|
||||
|
||||
if(makeAudio)
|
||||
if (makeAudio)
|
||||
{
|
||||
var blackHoleAmbience = GameObject.Instantiate(GameObject.Find("BrittleHollow_Body/BlackHole_BH/BlackHoleAmbience"), blackHole.transform);
|
||||
blackHoleAmbience.name = "BlackHoleAmbience";
|
||||
@ -222,7 +206,7 @@ namespace NewHorizons.Builder.Body
|
||||
whiteHoleVolume.enabled = true;
|
||||
whiteHoleFluidVolume.enabled = true;
|
||||
|
||||
if(makeZeroGVolume)
|
||||
if (makeZeroGVolume)
|
||||
{
|
||||
var zeroGVolume = GameObject.Instantiate(GameObject.Find("WhiteHole_Body/ZeroGVolume"), whiteHole.transform);
|
||||
zeroGVolume.name = "ZeroGVolume";
|
||||
|
||||
@ -1,16 +1,9 @@
|
||||
using NewHorizons.External;
|
||||
using OWML.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using NewHorizons.Utility;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
using NewHorizons.External.VariableSize;
|
||||
using NewHorizons.Components;
|
||||
using NewHorizons.Components;
|
||||
using NewHorizons.Components.SizeControllers;
|
||||
using NewHorizons.Utility;
|
||||
using OWML.Utils;
|
||||
using UnityEngine;
|
||||
using NewHorizons.External.Modules.VariableSize;
|
||||
|
||||
namespace NewHorizons.Builder.Body
|
||||
{
|
||||
|
||||
@ -1,11 +1,8 @@
|
||||
using NewHorizons.External;
|
||||
using NewHorizons.External.VariableSize;
|
||||
using OWML.Utils;
|
||||
using UnityEngine;
|
||||
using NewHorizons.Utility;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
using NewHorizons.Components;
|
||||
using NewHorizons.Components;
|
||||
using NewHorizons.Components.SizeControllers;
|
||||
using NewHorizons.Utility;
|
||||
using UnityEngine;
|
||||
using NewHorizons.External.Modules.VariableSize;
|
||||
|
||||
namespace NewHorizons.Builder.Body
|
||||
{
|
||||
@ -34,7 +31,7 @@ namespace NewHorizons.Builder.Body
|
||||
|
||||
var GDSharedMaterials = GameObject.Find("Ocean_GD").GetComponent<TessellatedSphereLOD>()._lowAltitudeMaterials;
|
||||
var tempArray = new Material[GDSharedMaterials.Length];
|
||||
for(int i = 0; i < GDSharedMaterials.Length; i++)
|
||||
for (int i = 0; i < GDSharedMaterials.Length; i++)
|
||||
{
|
||||
tempArray[i] = new Material(GDSharedMaterials[i]);
|
||||
if (module.Tint != null)
|
||||
@ -104,7 +101,7 @@ namespace NewHorizons.Builder.Body
|
||||
else
|
||||
{
|
||||
fogGO.GetComponent<MeshRenderer>().material.SetFloat("_Radius", module.Size);
|
||||
fogGO.GetComponent<MeshRenderer>().material.SetFloat("_Radius2", module.Size/2f);
|
||||
fogGO.GetComponent<MeshRenderer>().material.SetFloat("_Radius2", module.Size / 2f);
|
||||
}
|
||||
|
||||
// TODO: make LOD work
|
||||
|
||||
@ -1,9 +1,4 @@
|
||||
using NewHorizons.External;
|
||||
using NewHorizons.Utility;
|
||||
using OWML.Utils;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
|
||||
using UnityEngine;
|
||||
namespace NewHorizons.Builder.General
|
||||
{
|
||||
public static class AmbientLightBuilder
|
||||
|
||||
@ -1,17 +1,12 @@
|
||||
using NewHorizons.External;
|
||||
using NewHorizons.Utility;
|
||||
using OWML.Utils;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using NewHorizons.Components.Orbital;
|
||||
using NewHorizons.External.Configs;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
using NewHorizons.Components.Orbital;
|
||||
|
||||
namespace NewHorizons.Builder.General
|
||||
{
|
||||
public static class AstroObjectBuilder
|
||||
{
|
||||
public static NHAstroObject Make(GameObject body, AstroObject primaryBody, IPlanetConfig config)
|
||||
public static NHAstroObject Make(GameObject body, AstroObject primaryBody, PlanetConfig config)
|
||||
{
|
||||
NHAstroObject astroObject = body.AddComponent<NHAstroObject>();
|
||||
astroObject.HideDisplayName = !config.Base.HasMapMarker;
|
||||
@ -42,7 +37,7 @@ namespace NewHorizons.Builder.General
|
||||
var alignment = body.AddComponent<AlignWithTargetBody>();
|
||||
alignment.SetTargetBody(primaryBody?.GetAttachedOWRigidbody());
|
||||
alignment._usePhysicsToRotate = true;
|
||||
if(config.Orbit.AlignmentAxis == null)
|
||||
if (config.Orbit.AlignmentAxis == null)
|
||||
{
|
||||
alignment._localAlignmentAxis = new Vector3(0, -1, 0);
|
||||
}
|
||||
|
||||
@ -1,20 +1,12 @@
|
||||
using NewHorizons.Builder.Orbital;
|
||||
using NewHorizons.External;
|
||||
using NewHorizons.Components.Orbital;
|
||||
using OWML.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using UnityEngine;
|
||||
using NewHorizons.Utility;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
using NewHorizons.Components.Orbital;
|
||||
using NewHorizons.External.Configs;
|
||||
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
namespace NewHorizons.Builder.General
|
||||
{
|
||||
public static class DetectorBuilder
|
||||
{
|
||||
public static GameObject Make(GameObject planetGO, OWRigidbody OWRB, AstroObject primaryBody, AstroObject astroObject, IPlanetConfig config)
|
||||
public static GameObject Make(GameObject planetGO, OWRigidbody OWRB, AstroObject primaryBody, AstroObject astroObject, PlanetConfig config)
|
||||
{
|
||||
GameObject detectorGO = new GameObject("FieldDetector");
|
||||
detectorGO.SetActive(false);
|
||||
@ -27,7 +19,7 @@ namespace NewHorizons.Builder.General
|
||||
OWRB.RegisterAttachedForceDetector(forceDetector);
|
||||
|
||||
// For falling into sun
|
||||
if(!config.Base.InvulnerableToSun && config.Star == null && config.FocalPoint == null)
|
||||
if (!config.Base.InvulnerableToSun && config.Star == null && config.FocalPoint == null)
|
||||
{
|
||||
detectorGO.layer = LayerMask.NameToLayer("AdvancedDetector");
|
||||
|
||||
|
||||
@ -1,17 +1,11 @@
|
||||
using NewHorizons.External;
|
||||
using NewHorizons.Utility;
|
||||
using OWML.Utils;
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using NewHorizons.External.Configs;
|
||||
using UnityEngine;
|
||||
using NewHorizons.External.Configs;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
|
||||
namespace NewHorizons.Builder.General
|
||||
{
|
||||
public static class GravityBuilder
|
||||
{
|
||||
public static GravityVolume Make(GameObject planetGO, AstroObject ao, IPlanetConfig config)
|
||||
public static GravityVolume Make(GameObject planetGO, AstroObject ao, PlanetConfig config)
|
||||
{
|
||||
var exponent = config.Base.GravityFallOff.Equals("linear") ? 1f : 2f;
|
||||
var GM = config.Base.SurfaceGravity * Mathf.Pow(config.Base.SurfaceSize, exponent);
|
||||
|
||||
@ -1,16 +1,11 @@
|
||||
using NewHorizons.External;
|
||||
using OWML.Utils;
|
||||
using System.Reflection;
|
||||
using UnityEngine;
|
||||
using NewHorizons.External.Configs;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
using NewHorizons.External.Configs;
|
||||
using NewHorizons.Handlers;
|
||||
|
||||
using UnityEngine;
|
||||
namespace NewHorizons.Builder.General
|
||||
{
|
||||
static class MarkerBuilder
|
||||
{
|
||||
public static void Make(GameObject body, string name, IPlanetConfig config)
|
||||
public static void Make(GameObject body, string name, PlanetConfig config)
|
||||
{
|
||||
MapMarker mapMarker = body.AddComponent<MapMarker>();
|
||||
mapMarker._labelID = (UITextType)TranslationHandler.AddUI(config.Name);
|
||||
@ -29,7 +24,7 @@ namespace NewHorizons.Builder.General
|
||||
{
|
||||
markerType = MapMarker.MarkerType.HourglassTwins;
|
||||
}
|
||||
else if(config.Base.IsSatellite)
|
||||
else if (config.Base.IsSatellite)
|
||||
{
|
||||
markerType = MapMarker.MarkerType.Probe;
|
||||
}
|
||||
|
||||
@ -1,8 +1,4 @@
|
||||
using NewHorizons.External;
|
||||
using OWML.Utils;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
|
||||
using UnityEngine;
|
||||
namespace NewHorizons.Builder.General
|
||||
{
|
||||
public static class RFVolumeBuilder
|
||||
|
||||
@ -1,16 +1,10 @@
|
||||
using NewHorizons.External.Configs;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NewHorizons.Builder.General
|
||||
{
|
||||
public static class RigidBodyBuilder
|
||||
{
|
||||
public static OWRigidbody Make(GameObject body, IPlanetConfig config)
|
||||
public static OWRigidbody Make(GameObject body, PlanetConfig config)
|
||||
{
|
||||
body.AddComponent<ProxyShadowCasterSuperGroup>();
|
||||
|
||||
|
||||
@ -1,9 +1,5 @@
|
||||
using NewHorizons.External;
|
||||
using OWML.Utils;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
|
||||
namespace NewHorizons.Builder.General
|
||||
{
|
||||
public static class MakeSector
|
||||
|
||||
@ -1,10 +1,6 @@
|
||||
using NewHorizons.External;
|
||||
using OWML.Utils;
|
||||
using System;
|
||||
using NewHorizons.External.Modules;
|
||||
using UnityEngine;
|
||||
using NewHorizons.Utility;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
|
||||
namespace NewHorizons.Builder.General
|
||||
{
|
||||
public static class SpawnPointBuilder
|
||||
@ -13,7 +9,7 @@ namespace NewHorizons.Builder.General
|
||||
public static SpawnPoint Make(GameObject planetGO, SpawnModule module, OWRigidbody owRigidBody)
|
||||
{
|
||||
SpawnPoint playerSpawn = null;
|
||||
if(!Main.Instance.IsWarping && module.PlayerSpawnPoint != null)
|
||||
if (!Main.Instance.IsWarping && module.PlayerSpawnPoint != null)
|
||||
{
|
||||
GameObject spawnGO = new GameObject("PlayerSpawnPoint");
|
||||
spawnGO.transform.parent = planetGO.transform;
|
||||
@ -25,7 +21,7 @@ namespace NewHorizons.Builder.General
|
||||
spawnGO.transform.rotation = Quaternion.FromToRotation(Vector3.up, (playerSpawn.transform.position - planetGO.transform.position).normalized);
|
||||
spawnGO.transform.position = spawnGO.transform.position + spawnGO.transform.TransformDirection(Vector3.up) * 4f;
|
||||
}
|
||||
if(module.ShipSpawnPoint != null)
|
||||
if (module.ShipSpawnPoint != null)
|
||||
{
|
||||
GameObject spawnGO = new GameObject("ShipSpawnPoint");
|
||||
spawnGO.transform.parent = planetGO.transform;
|
||||
@ -44,7 +40,7 @@ namespace NewHorizons.Builder.General
|
||||
|
||||
ship.GetRequiredComponent<MatchInitialMotion>().SetBodyToMatch(owRigidBody);
|
||||
|
||||
if(Main.Instance.IsWarping)
|
||||
if (Main.Instance.IsWarping)
|
||||
{
|
||||
Logger.Log("Overriding player spawn to be inside ship");
|
||||
GameObject playerSpawnGO = new GameObject("PlayerSpawnPoint");
|
||||
@ -54,10 +50,10 @@ namespace NewHorizons.Builder.General
|
||||
playerSpawnGO.transform.localPosition = new Vector3(0, 0, 0);
|
||||
|
||||
playerSpawn = playerSpawnGO.AddComponent<SpawnPoint>();
|
||||
playerSpawnGO.transform.localRotation = Quaternion.Euler(0,0,0);
|
||||
playerSpawnGO.transform.localRotation = Quaternion.Euler(0, 0, 0);
|
||||
}
|
||||
}
|
||||
if(!Main.Instance.IsWarping && module.StartWithSuit && !suitUpQueued)
|
||||
if (!Main.Instance.IsWarping && module.StartWithSuit && !suitUpQueued)
|
||||
{
|
||||
suitUpQueued = true;
|
||||
Main.Instance.ModHelper.Events.Unity.RunWhen(() => Main.IsSystemReady, () => SuitUp());
|
||||
|
||||
@ -1,23 +1,16 @@
|
||||
using NewHorizons.Builder.General;
|
||||
using NewHorizons.Components.Orbital;
|
||||
using NewHorizons.External;
|
||||
using NewHorizons.Components.Orbital;
|
||||
using NewHorizons.External.Configs;
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.Handlers;
|
||||
using NewHorizons.Utility;
|
||||
using OWML.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
|
||||
namespace NewHorizons.Builder.Orbital
|
||||
{
|
||||
public static class FocalPointBuilder
|
||||
{
|
||||
public static void Make(GameObject go, AstroObject ao, IPlanetConfig config, IModBehaviour mod)
|
||||
public static void Make(GameObject go, AstroObject ao, PlanetConfig config, IModBehaviour mod)
|
||||
{
|
||||
var module = config.FocalPoint;
|
||||
|
||||
@ -30,23 +23,23 @@ namespace NewHorizons.Builder.Orbital
|
||||
// Grab the bodies from the main dictionary
|
||||
NewHorizonsBody primary = null;
|
||||
NewHorizonsBody secondary = null;
|
||||
foreach(var body in Main.BodyDict[Main.Instance.CurrentStarSystem])
|
||||
foreach (var body in Main.BodyDict[Main.Instance.CurrentStarSystem])
|
||||
{
|
||||
if(body.Config.Name == module.Primary)
|
||||
if (body.Config.Name == module.Primary)
|
||||
{
|
||||
primary = body;
|
||||
}
|
||||
else if(body.Config.Name == module.Secondary)
|
||||
else if (body.Config.Name == module.Secondary)
|
||||
{
|
||||
secondary = body;
|
||||
}
|
||||
if(primary != null && secondary != null)
|
||||
if (primary != null && secondary != null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(primary == null || secondary == null)
|
||||
if (primary == null || secondary == null)
|
||||
{
|
||||
Logger.LogError($"Couldn't make focal point between [{module.Primary} = {primary}] and [{module.Secondary} = {secondary}]");
|
||||
return;
|
||||
@ -74,7 +67,7 @@ namespace NewHorizons.Builder.Orbital
|
||||
binary.FakeMassBody = PlanetCreationHandler.GenerateBody(new NewHorizonsBody(fakeMassConfig, mod));
|
||||
}
|
||||
|
||||
private static float GetGravitationalMass(IPlanetConfig config)
|
||||
private static float GetGravitationalMass(PlanetConfig config)
|
||||
{
|
||||
var surfaceAcceleration = config.Base.SurfaceGravity;
|
||||
var upperSurfaceRadius = config.Base.SurfaceSize;
|
||||
|
||||
@ -1,16 +1,7 @@
|
||||
using NewHorizons.External;
|
||||
using OWML.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using NewHorizons.Components.Orbital;
|
||||
using NewHorizons.External.Modules;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
using System.Reflection;
|
||||
using NewHorizons.Utility;
|
||||
using NewHorizons.Components.Orbital;
|
||||
|
||||
namespace NewHorizons.Builder.Orbital
|
||||
{
|
||||
public static class InitialMotionBuilder
|
||||
|
||||
@ -1,17 +1,11 @@
|
||||
using NewHorizons.External;
|
||||
using NewHorizons.Utility;
|
||||
using OWML.Utils;
|
||||
using UnityEngine;
|
||||
using NewHorizons.Components.Orbital;
|
||||
using NewHorizons.External.Configs;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
using NewHorizons.Components.Orbital;
|
||||
using System;
|
||||
|
||||
using UnityEngine;
|
||||
namespace NewHorizons.Builder.Orbital
|
||||
{
|
||||
public static class OrbitlineBuilder
|
||||
{
|
||||
public static OrbitLine Make(GameObject planetGO, NHAstroObject astroObject, bool isMoon, IPlanetConfig config)
|
||||
public static OrbitLine Make(GameObject planetGO, NHAstroObject astroObject, bool isMoon, PlanetConfig config)
|
||||
{
|
||||
GameObject orbitGO = new GameObject("Orbit");
|
||||
orbitGO.transform.parent = planetGO.transform;
|
||||
@ -36,7 +30,7 @@ namespace NewHorizons.Builder.Orbital
|
||||
var parentGravity = astroObject.GetPrimaryBody()?.GetGravityVolume();
|
||||
|
||||
OrbitLine orbitLine;
|
||||
if(config.Orbit.TrackingOrbitLine || (new Gravity(parentGravity).Power == 1 && ecc != 0))
|
||||
if (config.Orbit.TrackingOrbitLine || (new Gravity(parentGravity).Power == 1 && ecc != 0))
|
||||
{
|
||||
orbitLine = orbitGO.AddComponent<TrackingOrbitLine>();
|
||||
}
|
||||
@ -67,7 +61,7 @@ namespace NewHorizons.Builder.Orbital
|
||||
var fade = isMoon;
|
||||
if (config.Base.IsSatellite)
|
||||
{
|
||||
if(config.Orbit.Tint != null) color = new Color(0.4082f, 0.516f, 0.4469f, 1f);
|
||||
if (config.Orbit.Tint != null) color = new Color(0.4082f, 0.516f, 0.4469f, 1f);
|
||||
fade = true;
|
||||
orbitLine._fadeEndDist = 5000;
|
||||
orbitLine._fadeStartDist = 3000;
|
||||
|
||||
@ -1,22 +1,18 @@
|
||||
using NewHorizons.Utility;
|
||||
using NewHorizons.External.Configs;
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.Handlers;
|
||||
using NewHorizons.Utility;
|
||||
using OWML.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using Random = UnityEngine.Random;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
using NewHorizons.External;
|
||||
using OWML.Common;
|
||||
using NewHorizons.External.Configs;
|
||||
using NewHorizons.Handlers;
|
||||
|
||||
namespace NewHorizons.Builder.Props
|
||||
{
|
||||
public static class DetailBuilder
|
||||
{
|
||||
public static void Make(GameObject go, Sector sector, IPlanetConfig config, IModBehaviour mod, string uniqueModName, PropModule.DetailInfo detail)
|
||||
public static void Make(GameObject go, Sector sector, PlanetConfig config, IModBehaviour mod, string uniqueModName, PropModule.DetailInfo detail)
|
||||
{
|
||||
GameObject detailGO = null;
|
||||
|
||||
@ -185,7 +181,7 @@ namespace NewHorizons.Builder.Props
|
||||
angler.OnChangeAnglerState(AnglerfishController.AnglerState.Lurking);
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.LogWarning($"Exception when modifying component [{component.GetType().Name}] on [{planetGO.name}] : {e.Message}, {e.StackTrace}");
|
||||
}
|
||||
|
||||
@ -1,15 +1,8 @@
|
||||
using NewHorizons.External;
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.Handlers;
|
||||
using OWML.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
|
||||
namespace NewHorizons.Builder.Props
|
||||
{
|
||||
public static class DialogueBuilder
|
||||
@ -72,7 +65,7 @@ namespace NewHorizons.Builder.Props
|
||||
var owCollider = conversationZone.AddComponent<OWCollider>();
|
||||
var interact = conversationZone.AddComponent<InteractReceiver>();
|
||||
|
||||
if(info.radius <= 0)
|
||||
if (info.radius <= 0)
|
||||
{
|
||||
sphere.enabled = false;
|
||||
owCollider.enabled = false;
|
||||
@ -110,7 +103,7 @@ namespace NewHorizons.Builder.Props
|
||||
controller._dialogueTree = dialogue;
|
||||
controller.lookOnlyWhenTalking = lookOnlyWhenTalking;
|
||||
}
|
||||
else if(nomaiController != null)
|
||||
else if (nomaiController != null)
|
||||
{
|
||||
if (lookOnlyWhenTalking)
|
||||
{
|
||||
@ -153,7 +146,7 @@ namespace NewHorizons.Builder.Props
|
||||
triggerVolume.OnExit += controller.OnZoneExit;
|
||||
}
|
||||
// Simpler for the Nomai
|
||||
else if(nomaiController)
|
||||
else if (nomaiController)
|
||||
{
|
||||
triggerVolume.OnEntry += (_) => nomaiController.StartWatchingPlayer();
|
||||
triggerVolume.OnExit += (_) => nomaiController.StopWatchingPlayer();
|
||||
|
||||
@ -1,12 +1,6 @@
|
||||
using NewHorizons.External;
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NewHorizons.Builder.Props
|
||||
{
|
||||
public static class GeyserBuilder
|
||||
|
||||
@ -1,17 +1,13 @@
|
||||
using NewHorizons.External;
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.Handlers;
|
||||
using NewHorizons.Utility;
|
||||
using OWML.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
namespace NewHorizons.Builder.Props
|
||||
{
|
||||
public static class NomaiTextBuilder
|
||||
|
||||
@ -1,16 +1,11 @@
|
||||
using NewHorizons.External;
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.Handlers;
|
||||
using NewHorizons.Utility;
|
||||
using OWML.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using NewHorizons.Utility;
|
||||
using OWML.ModHelper;
|
||||
using OWML.Common;
|
||||
using NewHorizons.Handlers;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
|
||||
namespace NewHorizons.Builder.Props
|
||||
{
|
||||
public static class ProjectionBuilder
|
||||
|
||||
@ -1,25 +1,14 @@
|
||||
using NewHorizons.External;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using Random = UnityEngine.Random;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
using System.Reflection;
|
||||
using NewHorizons.Builder.General;
|
||||
using NewHorizons.Utility;
|
||||
using OWML.Common;
|
||||
using NewHorizons.Builder.ShipLog;
|
||||
using NewHorizons.Builder.ShipLog;
|
||||
using NewHorizons.External.Configs;
|
||||
using System.IO;
|
||||
|
||||
using OWML.Common;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
namespace NewHorizons.Builder.Props
|
||||
{
|
||||
public static class PropBuildManager
|
||||
{
|
||||
public static void Make(GameObject go, Sector sector, OWRigidbody planetBody, IPlanetConfig config, IModBehaviour mod, string uniqueModName)
|
||||
public static void Make(GameObject go, Sector sector, OWRigidbody planetBody, PlanetConfig config, IModBehaviour mod, string uniqueModName)
|
||||
{
|
||||
if (config.Props.Scatter != null)
|
||||
{
|
||||
|
||||
@ -1,17 +1,9 @@
|
||||
using NewHorizons.Builder.General;
|
||||
using NewHorizons.Components;
|
||||
using NewHorizons.External;
|
||||
using NewHorizons.Components;
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.Handlers;
|
||||
using NewHorizons.Utility;
|
||||
using OWML.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
|
||||
namespace NewHorizons.Builder.Props
|
||||
{
|
||||
public static class RaftBuilder
|
||||
|
||||
@ -1,26 +1,20 @@
|
||||
using NewHorizons.Utility;
|
||||
using NewHorizons.External.Configs;
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.Utility;
|
||||
using OWML.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using Random = UnityEngine.Random;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
using NewHorizons.External;
|
||||
using OWML.Common;
|
||||
using NewHorizons.External.Configs;
|
||||
|
||||
namespace NewHorizons.Builder.Props
|
||||
{
|
||||
public static class ScatterBuilder
|
||||
{
|
||||
public static void Make(GameObject go, Sector sector, IPlanetConfig config, IModBehaviour mod, string uniqueModName)
|
||||
public static void Make(GameObject go, Sector sector, PlanetConfig config, IModBehaviour mod, string uniqueModName)
|
||||
{
|
||||
MakeScatter(go, config.Props.Scatter, config.Base.SurfaceSize, sector, mod, uniqueModName, config);
|
||||
}
|
||||
|
||||
private static void MakeScatter(GameObject go, PropModule.ScatterInfo[] scatterInfo, float radius, Sector sector, IModBehaviour mod, string uniqueModName, IPlanetConfig config)
|
||||
private static void MakeScatter(GameObject go, PropModule.ScatterInfo[] scatterInfo, float radius, Sector sector, IModBehaviour mod, string uniqueModName, PlanetConfig config)
|
||||
{
|
||||
var heightMap = config.HeightMap;
|
||||
|
||||
|
||||
@ -1,16 +1,11 @@
|
||||
using NewHorizons.Components;
|
||||
using NewHorizons.External;
|
||||
using NewHorizons.Handlers;
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.Utility;
|
||||
using OWML.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
|
||||
namespace NewHorizons.Builder.Props
|
||||
{
|
||||
public static class SignalBuilder
|
||||
|
||||
@ -1,16 +1,10 @@
|
||||
using NewHorizons.Components;
|
||||
using NewHorizons.External;
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.Handlers;
|
||||
using NewHorizons.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
namespace NewHorizons.Builder.Props
|
||||
{
|
||||
public static class TornadoBuilder
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
using NewHorizons.External;
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.Utility;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
|
||||
namespace NewHorizons.Builder.Props
|
||||
{
|
||||
public static class VolcanoBuilder
|
||||
|
||||
@ -1,15 +1,7 @@
|
||||
using NewHorizons.Components;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
using NewHorizons.External;
|
||||
using NewHorizons.Utility;
|
||||
using NewHorizons.External.Modules;
|
||||
using OWML.Common;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
|
||||
namespace NewHorizons.Builder.ShipLog
|
||||
{
|
||||
public static class EntryLocationBuilder
|
||||
|
||||
@ -1,17 +1,13 @@
|
||||
using NewHorizons.Components;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
using NewHorizons.External;
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.Handlers;
|
||||
using NewHorizons.Utility;
|
||||
using OWML.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
using System;
|
||||
using NewHorizons.Handlers;
|
||||
|
||||
namespace NewHorizons.Builder.ShipLog
|
||||
{
|
||||
public static class MapModeBuilder
|
||||
@ -44,7 +40,7 @@ namespace NewHorizons.Builder.ShipLog
|
||||
}
|
||||
}
|
||||
|
||||
if(flagManualPositionUsed)
|
||||
if (flagManualPositionUsed)
|
||||
{
|
||||
if (flagAutoPositionUsed && flagManualPositionUsed)
|
||||
Logger.LogWarning("Can't mix manual and automatic layout of ship log map mode, defaulting to manual");
|
||||
@ -139,7 +135,7 @@ namespace NewHorizons.Builder.ShipLog
|
||||
}
|
||||
#endregion
|
||||
|
||||
# region Details
|
||||
#region Details
|
||||
private static void MakeDetail(ShipLogModule.ShipLogDetailInfo info, Transform parent, NewHorizonsBody body, Material greyScaleMaterial)
|
||||
{
|
||||
GameObject detailGameObject = new GameObject("Detail");
|
||||
@ -213,12 +209,12 @@ namespace NewHorizons.Builder.ShipLog
|
||||
for (int x = 0; x < currentNav[y].Length; x++)
|
||||
{
|
||||
navMatrix[y][x] = currentNav[y][x];
|
||||
astroIdToNavIndex.Add(currentNav[y][x].GetID(), new [] {y, x});
|
||||
astroIdToNavIndex.Add(currentNav[y][x].GetID(), new[] { y, x });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach(NewHorizonsBody body in bodies)
|
||||
foreach (NewHorizonsBody body in bodies)
|
||||
{
|
||||
if (body.Config.ShipLog?.mapMode?.manualNavigationPosition == null) continue;
|
||||
|
||||
@ -499,8 +495,8 @@ namespace NewHorizons.Builder.ShipLog
|
||||
{
|
||||
Texture2D texture;
|
||||
|
||||
if(body.Config.Star != null) texture = ImageUtilities.GetTexture(Main.Instance, "AssetBundle/DefaultMapModeStar.png");
|
||||
else if(body.Config.Atmosphere != null) texture = ImageUtilities.GetTexture(Main.Instance, "AssetBundle/DefaultMapModNoAtmo.png");
|
||||
if (body.Config.Star != null) texture = ImageUtilities.GetTexture(Main.Instance, "AssetBundle/DefaultMapModeStar.png");
|
||||
else if (body.Config.Atmosphere != null) texture = ImageUtilities.GetTexture(Main.Instance, "AssetBundle/DefaultMapModNoAtmo.png");
|
||||
else texture = ImageUtilities.GetTexture(Main.Instance, "AssetBundle/DefaultMapModePlanet.png");
|
||||
|
||||
var color = GetDominantPlanetColor(body);
|
||||
@ -544,7 +540,7 @@ namespace NewHorizons.Builder.ShipLog
|
||||
var sandColor = body.Config.Sand?.Tint;
|
||||
if (sandColor != null) return sandColor.ToColor();
|
||||
}
|
||||
catch(Exception)
|
||||
catch (Exception)
|
||||
{
|
||||
Logger.LogWarning($"Something went wrong trying to pick the colour for {body.Config.Name} but I'm too lazy to fix it.");
|
||||
}
|
||||
|
||||
@ -1,15 +1,7 @@
|
||||
using NewHorizons.Components;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
using NewHorizons.External;
|
||||
using NewHorizons.Utility;
|
||||
using NewHorizons.External.Modules;
|
||||
using OWML.Common;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
|
||||
namespace NewHorizons.Builder.ShipLog
|
||||
{
|
||||
public static class RevealBuilder
|
||||
|
||||
@ -1,17 +1,11 @@
|
||||
using System;
|
||||
using NewHorizons.Components;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
using NewHorizons.External;
|
||||
using NewHorizons.Utility;
|
||||
using OWML.Common;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.Handlers;
|
||||
|
||||
using NewHorizons.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Linq;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
namespace NewHorizons.Builder.ShipLog
|
||||
{
|
||||
public static class RumorModeBuilder
|
||||
|
||||
@ -1,11 +1,8 @@
|
||||
using System;
|
||||
using NewHorizons.External.Configs;
|
||||
using NewHorizons.External.Configs;
|
||||
using NewHorizons.Utility;
|
||||
using OWML.Common;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
using Object = System.Object;
|
||||
|
||||
namespace NewHorizons.Builder.StarSystem
|
||||
{
|
||||
public class SkyboxBuilder
|
||||
|
||||
@ -1,11 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
|
||||
namespace NewHorizons.Components
|
||||
namespace NewHorizons.Components
|
||||
{
|
||||
public class BlackHoleDestructionVolume : DestructionVolume
|
||||
{
|
||||
|
||||
@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace NewHorizons.Components
|
||||
namespace NewHorizons.Components
|
||||
{
|
||||
public class ChangeStarSystemVolume : BlackHoleDestructionVolume
|
||||
{
|
||||
@ -18,7 +12,7 @@ namespace NewHorizons.Components
|
||||
|
||||
public override void VanishShip(OWRigidbody shipBody, RelativeLocationData entryLocation)
|
||||
{
|
||||
if(PlayerState.IsInsideShip()) Main.Instance.ChangeCurrentStarSystem(TargetSolarSystem, true);
|
||||
if (PlayerState.IsInsideShip()) Main.Instance.ChangeCurrentStarSystem(TargetSolarSystem, true);
|
||||
}
|
||||
|
||||
public override void VanishPlayer(OWRigidbody playerBody, RelativeLocationData entryLocation)
|
||||
|
||||
@ -1,10 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NewHorizons.Components
|
||||
{
|
||||
public class CloakSectorController : MonoBehaviour
|
||||
@ -33,7 +29,7 @@ namespace NewHorizons.Components
|
||||
|
||||
void OnDestroy()
|
||||
{
|
||||
if(_isInitialized)
|
||||
if (_isInitialized)
|
||||
{
|
||||
_cloak.OnPlayerEnter -= OnPlayerEnter;
|
||||
_cloak.OnPlayerExit -= OnPlayerExit;
|
||||
|
||||
@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
using UnityEngine;
|
||||
namespace NewHorizons.Components
|
||||
{
|
||||
public class CloakedAudioSignal : AudioSignal
|
||||
|
||||
@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
using UnityEngine;
|
||||
namespace NewHorizons.Components
|
||||
{
|
||||
public class FunnelController : MonoBehaviour
|
||||
|
||||
@ -1,12 +1,6 @@
|
||||
using NewHorizons.Builder.General;
|
||||
using NewHorizons.External.Configs;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NewHorizons.Components
|
||||
{
|
||||
public class MapSatelliteOrbitFix : MonoBehaviour
|
||||
|
||||
@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
using UnityEngine;
|
||||
namespace NewHorizons.Components
|
||||
{
|
||||
public class NHFluidVolume : RadialFluidVolume
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
using NewHorizons.Utility;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NewHorizons.Components
|
||||
{
|
||||
public class NHProxy : ProxyPlanet
|
||||
|
||||
@ -1,11 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using UnityEngine;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
namespace NewHorizons.Components
|
||||
{
|
||||
public class NHTornadoWanderController : MonoBehaviour
|
||||
|
||||
@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
using UnityEngine;
|
||||
namespace NewHorizons.Components.Orbital
|
||||
{
|
||||
public class BinaryFocalPoint : MonoBehaviour
|
||||
@ -20,7 +14,7 @@ namespace NewHorizons.Components.Orbital
|
||||
void Start()
|
||||
{
|
||||
// Make sure its active but maybe it hasn't been set yet
|
||||
if(FakeMassBody) FakeMassBody.SetActive(true);
|
||||
if (FakeMassBody) FakeMassBody.SetActive(true);
|
||||
}
|
||||
|
||||
void Update()
|
||||
@ -28,7 +22,7 @@ namespace NewHorizons.Components.Orbital
|
||||
if (Primary == null || Secondary == null) return;
|
||||
|
||||
// Secondary and primary must have been engulfed by a star
|
||||
if(!Primary.isActiveAndEnabled && !Secondary.isActiveAndEnabled)
|
||||
if (!Primary.isActiveAndEnabled && !Secondary.isActiveAndEnabled)
|
||||
{
|
||||
ReferenceFrameTracker component = Locator.GetPlayerBody().GetComponent<ReferenceFrameTracker>();
|
||||
if (component.GetReferenceFrame(true) != null && component.GetReferenceFrame(true).GetOWRigidBody() == gameObject)
|
||||
|
||||
@ -1,11 +1,5 @@
|
||||
using NewHorizons.External;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using NewHorizons.External.Modules;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NewHorizons.Components.Orbital
|
||||
{
|
||||
public class Gravity
|
||||
@ -31,7 +25,7 @@ namespace NewHorizons.Components.Orbital
|
||||
|
||||
public Gravity(GravityVolume gv)
|
||||
{
|
||||
if(gv == null)
|
||||
if (gv == null)
|
||||
{
|
||||
Mass = 0;
|
||||
Power = 2;
|
||||
|
||||
@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace NewHorizons.Components.Orbital
|
||||
namespace NewHorizons.Components.Orbital
|
||||
{
|
||||
public interface IOrbitalParameters
|
||||
{
|
||||
|
||||
@ -1,10 +1,4 @@
|
||||
using NewHorizons.External;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using NewHorizons.External.Modules;
|
||||
namespace NewHorizons.Components.Orbital
|
||||
{
|
||||
public class NHAstroObject : AstroObject, IOrbitalParameters
|
||||
|
||||
@ -1,11 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
|
||||
namespace NewHorizons.Components.Orbital
|
||||
{
|
||||
public class NHOrbitLine : OrbitLine
|
||||
@ -94,7 +89,7 @@ namespace NewHorizons.Components.Orbital
|
||||
_lineRenderer.widthMultiplier = widthMultiplier;
|
||||
_lineRenderer.startColor = new Color(_color.r, _color.g, _color.b, num3 * num3);
|
||||
}
|
||||
catch(Exception ex)
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogError($"Exception in OrbitLine for [{_astroObject?.name}] : {ex.Message}, {ex.StackTrace}");
|
||||
enabled = false;
|
||||
|
||||
@ -1,11 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
|
||||
namespace NewHorizons.Components.Orbital
|
||||
{
|
||||
public class OrbitalParameters : IOrbitalParameters
|
||||
@ -32,7 +26,7 @@ namespace NewHorizons.Components.Orbital
|
||||
orbitalParameters.ArgumentOfPeriapsis = argumentOfPeriapsis;
|
||||
|
||||
// If primary gravity is linear and the orbit is eccentric its not even an ellipse so theres no true anomaly
|
||||
if(primaryGravity.Power == 1 && eccentricity != 0)
|
||||
if (primaryGravity.Power == 1 && eccentricity != 0)
|
||||
{
|
||||
trueAnomaly = 0;
|
||||
}
|
||||
@ -45,7 +39,7 @@ namespace NewHorizons.Components.Orbital
|
||||
var secondaryMass = secondaryGravity.Mass;
|
||||
|
||||
var power = primaryGravity.Power;
|
||||
var period = (float) (GravityVolume.GRAVITATIONAL_CONSTANT * (primaryMass + secondaryMass) / (4 * Math.PI * Math.PI * Math.Pow(semiMajorAxis, power)));
|
||||
var period = (float)(GravityVolume.GRAVITATIONAL_CONSTANT * (primaryMass + secondaryMass) / (4 * Math.PI * Math.PI * Math.Pow(semiMajorAxis, power)));
|
||||
|
||||
orbitalParameters.Period = period;
|
||||
|
||||
@ -63,10 +57,10 @@ namespace NewHorizons.Components.Orbital
|
||||
float v;
|
||||
|
||||
// For linear
|
||||
if(primaryGravity.Power == 1)
|
||||
if (primaryGravity.Power == 1)
|
||||
{
|
||||
// Have to deal with a limit
|
||||
if(eccentricity == 0)
|
||||
if (eccentricity == 0)
|
||||
{
|
||||
var v2 = 2 * mu * (Mathf.Log(r_a / r) + (1 / 2f));
|
||||
v = Mathf.Sqrt(v2);
|
||||
|
||||
@ -1,11 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
|
||||
namespace NewHorizons.Components.Orbital
|
||||
{
|
||||
public class TrackingOrbitLine : OrbitLine
|
||||
|
||||
@ -1,18 +1,12 @@
|
||||
using NewHorizons.Builder.General;
|
||||
using NewHorizons.Builder.Orbital;
|
||||
using NewHorizons.Components.Orbital;
|
||||
using NewHorizons.External;
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.Handlers;
|
||||
using NewHorizons.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using Random = UnityEngine.Random;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
|
||||
using Random = UnityEngine.Random;
|
||||
namespace NewHorizons.Components
|
||||
{
|
||||
public class QuantumPlanet : QuantumObject
|
||||
@ -106,7 +100,7 @@ namespace NewHorizons.Components
|
||||
}
|
||||
}
|
||||
|
||||
if(canChange)
|
||||
if (canChange)
|
||||
{
|
||||
if (newState.sector != null && newState.sector != oldState.sector) SetNewSector(oldState, newState);
|
||||
if (newState.orbit != null && newState.orbit != oldState.orbit) SetNewOrbit(primaryBody, orbitalParams);
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
|
||||
namespace NewHorizons.Components
|
||||
{
|
||||
public class RingShape : Shape
|
||||
|
||||
@ -1,10 +1,7 @@
|
||||
using System;
|
||||
using NewHorizons.External;
|
||||
using OWML.Common;
|
||||
using NewHorizons.External.Modules;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
|
||||
namespace NewHorizons.Components
|
||||
{
|
||||
public class ShipLogDetail : MonoBehaviour
|
||||
|
||||
@ -1,15 +1,10 @@
|
||||
using System;
|
||||
using NewHorizons.Handlers;
|
||||
using NewHorizons.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using NewHorizons.Utility;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
using UnityEngine.UI;
|
||||
using OWML.Common;
|
||||
using NewHorizons.Handlers;
|
||||
|
||||
namespace NewHorizons.Components
|
||||
{
|
||||
public class ShipLogStarChartMode : ShipLogMode
|
||||
@ -112,7 +107,7 @@ namespace NewHorizons.Components
|
||||
private void OnEnterFlightConsole(OWRigidbody _)
|
||||
{
|
||||
_isAtFlightConsole = true;
|
||||
if(_target != null)
|
||||
if (_target != null)
|
||||
{
|
||||
_warpPrompt.SetVisibility(true);
|
||||
}
|
||||
@ -131,7 +126,7 @@ namespace NewHorizons.Components
|
||||
|
||||
private void OnGameUnpaused()
|
||||
{
|
||||
if(_target != null && _isAtFlightConsole)
|
||||
if (_target != null && _isAtFlightConsole)
|
||||
{
|
||||
_warpPrompt.SetVisibility(true);
|
||||
}
|
||||
@ -175,7 +170,7 @@ namespace NewHorizons.Components
|
||||
}
|
||||
catch (Exception) { }
|
||||
|
||||
if(texture != null)
|
||||
if (texture != null)
|
||||
{
|
||||
shipLogEntryCard._photo.sprite = MakeSprite((Texture2D)texture);
|
||||
newCard.transform.Find("EntryCardRoot/EntryCardBackground/PhotoImage").gameObject.SetActive(true);
|
||||
@ -321,9 +316,9 @@ namespace NewHorizons.Components
|
||||
|
||||
private void RemoveWarpTarget(bool playSound = false)
|
||||
{
|
||||
if(_warpNotificationData != null) NotificationManager.SharedInstance.UnpinNotification(_warpNotificationData);
|
||||
if (_warpNotificationData != null) NotificationManager.SharedInstance.UnpinNotification(_warpNotificationData);
|
||||
if (_target == null) return;
|
||||
if(playSound) _oneShotSource.PlayOneShot(global::AudioType.ShipLogMarkLocation, 1f);
|
||||
if (playSound) _oneShotSource.PlayOneShot(global::AudioType.ShipLogMarkLocation, 1f);
|
||||
_target.SetMarkedOnHUD(false);
|
||||
_target = null;
|
||||
|
||||
|
||||
@ -1,13 +1,6 @@
|
||||
using NewHorizons.Builder.General;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using NewHorizons.Utility;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
|
||||
namespace NewHorizons.Components
|
||||
{
|
||||
public class ShipWarpController : MonoBehaviour
|
||||
@ -124,7 +117,7 @@ namespace NewHorizons.Components
|
||||
|
||||
public void Update()
|
||||
{
|
||||
if(_isWarpingIn && LateInitializerManager.isDoneInitializing)
|
||||
if (_isWarpingIn && LateInitializerManager.isDoneInitializing)
|
||||
{
|
||||
Main.Instance.ModHelper.Events.Unity.FireInNUpdates(() => StartWarpInEffect(), 1);
|
||||
_isWarpingIn = false;
|
||||
@ -188,7 +181,7 @@ namespace NewHorizons.Components
|
||||
Locator.GetDeathManager()._invincible = false;
|
||||
|
||||
// For some reason warping into the ship makes you suffocate while in the ship
|
||||
if(_wearingSuit) resources.OnSuitUp();
|
||||
if (_wearingSuit) resources.OnSuitUp();
|
||||
var o2Volume = Locator.GetShipBody().GetComponent<OxygenVolume>();
|
||||
var atmoVolume = GameObject.Find("Ship_Body/Volumes/ShipAtmosphereVolume").GetComponent<SimpleFluidVolume>();
|
||||
|
||||
|
||||
@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
using UnityEngine;
|
||||
namespace NewHorizons.Components.SizeControllers
|
||||
{
|
||||
public class SizeController : MonoBehaviour
|
||||
|
||||
@ -1,11 +1,5 @@
|
||||
using NewHorizons.Builder.Body;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NewHorizons.Components.SizeControllers
|
||||
{
|
||||
public class StarAtmosphereSizeController : SizeController
|
||||
|
||||
@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
using UnityEngine;
|
||||
namespace NewHorizons.Components.SizeControllers
|
||||
{
|
||||
public class WaterSizeController : SizeController
|
||||
|
||||
@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
using UnityEngine;
|
||||
namespace NewHorizons.Components
|
||||
{
|
||||
public class StarController : MonoBehaviour
|
||||
|
||||
@ -1,12 +1,6 @@
|
||||
using NewHorizons.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
|
||||
namespace NewHorizons.Components
|
||||
{
|
||||
[RequireComponent(typeof(SunLightController))]
|
||||
@ -46,7 +40,7 @@ namespace NewHorizons.Components
|
||||
if (Instance._activeStar != null && Instance._activeStar.Equals(star))
|
||||
{
|
||||
Instance._stars.Remove(star);
|
||||
if(Instance._stars.Count > 0) Instance.ChangeActiveStar(Instance._stars[0]);
|
||||
if (Instance._stars.Count > 0) Instance.ChangeActiveStar(Instance._stars[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -66,7 +60,7 @@ namespace NewHorizons.Components
|
||||
return;
|
||||
}
|
||||
|
||||
foreach(var star in _stars)
|
||||
foreach (var star in _stars)
|
||||
{
|
||||
if (star == null) continue;
|
||||
|
||||
@ -89,7 +83,7 @@ namespace NewHorizons.Components
|
||||
{
|
||||
if (_sunLightController == null || _sunLightParamUpdater == null) return;
|
||||
|
||||
if(_activeStar != null) _activeStar.Disable();
|
||||
if (_activeStar != null) _activeStar.Disable();
|
||||
|
||||
Logger.Log($"Switching active star: {star.gameObject.name}");
|
||||
|
||||
|
||||
@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
using UnityEngine;
|
||||
namespace NewHorizons.Components
|
||||
{
|
||||
public class TimeLoopController : MonoBehaviour
|
||||
@ -21,7 +15,7 @@ namespace NewHorizons.Components
|
||||
{
|
||||
// Stock gives like 33 seconds after the sun collapses
|
||||
// Gonna assume it takes like 7 seconds to collapse after the supernova trigger
|
||||
if(_supernovaHappened && Time.time > _supernovaTime + 40f)
|
||||
if (_supernovaHappened && Time.time > _supernovaTime + 40f)
|
||||
{
|
||||
Locator.GetDeathManager().KillPlayer(DeathType.TimeLoop);
|
||||
}
|
||||
|
||||
@ -1,11 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NewHorizons.Components
|
||||
namespace NewHorizons.Components
|
||||
{
|
||||
public class TornadoFix : SectoredMonoBehaviour
|
||||
{
|
||||
@ -19,7 +12,7 @@ namespace NewHorizons.Components
|
||||
|
||||
tornadoController._formationDuration = 1f;
|
||||
tornadoController._collapseDuration = 1f;
|
||||
if(_sector != null)
|
||||
if (_sector != null)
|
||||
{
|
||||
_sector.OnOccupantEnterSector += OnOccupantEnterSector;
|
||||
_sector.OnOccupantExitSector += OnOccupantExitSector;
|
||||
@ -28,7 +21,7 @@ namespace NewHorizons.Components
|
||||
|
||||
public new void SetSector(Sector sector)
|
||||
{
|
||||
if(_sector != null)
|
||||
if (_sector != null)
|
||||
{
|
||||
_sector.OnOccupantEnterSector -= OnOccupantEnterSector;
|
||||
_sector.OnOccupantExitSector -= OnOccupantExitSector;
|
||||
|
||||
7
NewHorizons/External/Configs/Config.cs
vendored
7
NewHorizons/External/Configs/Config.cs
vendored
@ -1,10 +1,7 @@
|
||||
using NewHorizons.Utility;
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace NewHorizons.External.Configs
|
||||
{
|
||||
public class Config
|
||||
|
||||
34
NewHorizons/External/Configs/IPlanetConfig.cs
vendored
34
NewHorizons/External/Configs/IPlanetConfig.cs
vendored
@ -1,34 +0,0 @@
|
||||
using NewHorizons.External.VariableSize;
|
||||
using NewHorizons.Utility;
|
||||
|
||||
namespace NewHorizons.External.Configs
|
||||
{
|
||||
public interface IPlanetConfig
|
||||
{
|
||||
string Name { get; }
|
||||
string StarSystem { get; }
|
||||
bool Destroy { get; }
|
||||
string[] ChildrenToDestroy { get; }
|
||||
int BuildPriority { get; }
|
||||
bool CanShowOnTitle { get; }
|
||||
bool IsQuantumState { get; }
|
||||
BaseModule Base { get; }
|
||||
AtmosphereModule Atmosphere { get; }
|
||||
OrbitModule Orbit { get; }
|
||||
RingModule Ring { get; }
|
||||
HeightMapModule HeightMap { get; }
|
||||
ProcGenModule ProcGen { get; }
|
||||
AsteroidBeltModule AsteroidBelt { get; }
|
||||
StarModule Star { get; }
|
||||
FocalPointModule FocalPoint { get; }
|
||||
PropModule Props { get; }
|
||||
ShipLogModule ShipLog { get; }
|
||||
SpawnModule Spawn { get; }
|
||||
SignalModule Signal { get; }
|
||||
SingularityModule Singularity { get; }
|
||||
LavaModule Lava { get; }
|
||||
SandModule Sand { get; }
|
||||
WaterModule Water { get; }
|
||||
FunnelModule Funnel { get; }
|
||||
}
|
||||
}
|
||||
43
NewHorizons/External/Configs/PlanetConfig.cs
vendored
43
NewHorizons/External/Configs/PlanetConfig.cs
vendored
@ -1,14 +1,13 @@
|
||||
using NewHorizons.External.VariableSize;
|
||||
using NewHorizons.Utility;
|
||||
using System;
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.External.Modules.VariableSize;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
|
||||
namespace NewHorizons.External.Configs
|
||||
{
|
||||
public class PlanetConfig : Config, IPlanetConfig
|
||||
public class PlanetConfig : Config
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string Version { get; set; }
|
||||
public string StarSystem { get; set; } = "SolarSystem";
|
||||
public bool Destroy { get; set; }
|
||||
public string[] ChildrenToDestroy { get; set; }
|
||||
@ -37,9 +36,39 @@ namespace NewHorizons.External.Configs
|
||||
public PlanetConfig(Dictionary<string, object> dict) : base(dict)
|
||||
{
|
||||
// Always have to have a base module
|
||||
if(Base == null) Base = new BaseModule();
|
||||
if(Orbit == null) Orbit = new OrbitModule();
|
||||
if (Base == null) Base = new BaseModule();
|
||||
if (Orbit == null) Orbit = new OrbitModule();
|
||||
if (ShipLog == null) ShipLog = new ShipLogModule();
|
||||
}
|
||||
|
||||
public void Validate()
|
||||
{
|
||||
if (Base.CenterOfSolarSystem) Orbit.IsStatic = true;
|
||||
|
||||
if (Base.WaterSize != 0)
|
||||
{
|
||||
Water = new WaterModule();
|
||||
Water.Size = Base.WaterSize;
|
||||
Water.Tint = Base.WaterTint;
|
||||
}
|
||||
|
||||
if (Base.LavaSize != 0)
|
||||
{
|
||||
Lava = new LavaModule();
|
||||
Lava.Size = Base.LavaSize;
|
||||
}
|
||||
|
||||
if(Base.BlackHoleSize != 0)
|
||||
{
|
||||
Singularity = new SingularityModule();
|
||||
Singularity.Type = "BlackHole";
|
||||
Singularity.Size = Base.BlackHoleSize;
|
||||
}
|
||||
|
||||
if(Base.IsSatellite)
|
||||
{
|
||||
Base.ShowMinimap = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,10 +1,4 @@
|
||||
using NewHorizons.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using System.Collections.Generic;
|
||||
namespace NewHorizons.External.Configs
|
||||
{
|
||||
public class StarSystemConfig : Config
|
||||
|
||||
@ -1,12 +1,6 @@
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
|
||||
namespace NewHorizons.External.Configs
|
||||
{
|
||||
public class TranslationConfig
|
||||
@ -19,7 +13,7 @@ namespace NewHorizons.External.Configs
|
||||
{
|
||||
Dictionary<string, object> dict = JObject.Parse(File.ReadAllText(filename)).ToObject<Dictionary<string, object>>();
|
||||
|
||||
if(dict.ContainsKey(nameof(DialogueDictionary)))
|
||||
if (dict.ContainsKey(nameof(DialogueDictionary)))
|
||||
{
|
||||
DialogueDictionary = (Dictionary<string, string>)(dict[nameof(DialogueDictionary)] as Newtonsoft.Json.Linq.JObject).ToObject(typeof(Dictionary<string, string>));
|
||||
}
|
||||
|
||||
14
NewHorizons/External/FocalPointModule.cs
vendored
14
NewHorizons/External/FocalPointModule.cs
vendored
@ -1,14 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace NewHorizons.External
|
||||
{
|
||||
public class FocalPointModule
|
||||
{
|
||||
public string Primary { get; set; }
|
||||
public string Secondary { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace NewHorizons.External
|
||||
namespace NewHorizons.External.Modules
|
||||
{
|
||||
public class AsteroidBeltModule : Module
|
||||
{
|
||||
@ -1,11 +1,5 @@
|
||||
using NewHorizons.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace NewHorizons.External
|
||||
namespace NewHorizons.External.Modules
|
||||
{
|
||||
public class AtmosphereModule : Module
|
||||
{
|
||||
@ -1,11 +1,5 @@
|
||||
using NewHorizons.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace NewHorizons.External
|
||||
namespace NewHorizons.External.Modules
|
||||
{
|
||||
public class BaseModule : Module
|
||||
{
|
||||
@ -20,11 +14,13 @@ namespace NewHorizons.External
|
||||
public MVector3 CometTailRotation { get; set; }
|
||||
public bool HasReferenceFrame { get; set; } = true;
|
||||
public bool CenterOfSolarSystem { get; set; } = false;
|
||||
public bool IsSatellite { get; set; }
|
||||
public float CloakRadius { get; set; } = 0f;
|
||||
public bool InvulnerableToSun { get; set; }
|
||||
public bool ShowMinimap { get; set; } = true;
|
||||
|
||||
// Old, see SingularityModule instead
|
||||
|
||||
// Obsolete
|
||||
public bool IsSatellite { get; set; }
|
||||
public float BlackHoleSize { get; set; }
|
||||
public float LavaSize { get; set; }
|
||||
public float WaterSize { get; set; }
|
||||
8
NewHorizons/External/Modules/FocalPointModule.cs
vendored
Normal file
8
NewHorizons/External/Modules/FocalPointModule.cs
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
namespace NewHorizons.External.Modules
|
||||
{
|
||||
public class FocalPointModule
|
||||
{
|
||||
public string Primary { get; set; }
|
||||
public string Secondary { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,7 +1,5 @@
|
||||
using NewHorizons.Utility;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NewHorizons.External
|
||||
namespace NewHorizons.External.Modules
|
||||
{
|
||||
public class HeightMapModule : Module
|
||||
{
|
||||
@ -1,11 +1,6 @@
|
||||
using NewHorizons.Utility;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace NewHorizons.External
|
||||
namespace NewHorizons.External.Modules
|
||||
{
|
||||
public abstract class Module
|
||||
{
|
||||
@ -1,12 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using NewHorizons.Handlers;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
|
||||
namespace NewHorizons.External
|
||||
namespace NewHorizons.External.Modules
|
||||
{
|
||||
public static class NewHorizonsData
|
||||
{
|
||||
@ -30,7 +25,7 @@ namespace NewHorizons.External
|
||||
_activeProfile = _saveFile.Profiles[_activeProfileName];
|
||||
Logger.Log($"Loaded save data for {_activeProfileName}");
|
||||
}
|
||||
catch(Exception)
|
||||
catch (Exception)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -41,7 +36,7 @@ namespace NewHorizons.External
|
||||
Main.Instance.ModHelper.Storage.Save(_saveFile, _fileName);
|
||||
Logger.Log($"Loaded save data for {_activeProfileName}");
|
||||
}
|
||||
catch(Exception e)
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.LogError($"Couldn't create save data {e.Message}, {e.StackTrace}");
|
||||
}
|
||||
@ -67,7 +62,7 @@ namespace NewHorizons.External
|
||||
Save();
|
||||
}
|
||||
|
||||
# region Frequencies
|
||||
#region Frequencies
|
||||
|
||||
public static bool KnowsFrequency(string frequency)
|
||||
{
|
||||
@ -90,9 +85,9 @@ namespace NewHorizons.External
|
||||
return (_activeProfile != null && _activeProfile.KnownFrequencies.Count > 0);
|
||||
}
|
||||
|
||||
# endregion
|
||||
#endregion
|
||||
|
||||
# region Signals
|
||||
#region Signals
|
||||
|
||||
public static bool KnowsSignal(string signal)
|
||||
{
|
||||
@ -110,9 +105,9 @@ namespace NewHorizons.External
|
||||
}
|
||||
}
|
||||
|
||||
# endregion
|
||||
#endregion
|
||||
|
||||
# region Newly Revealed Facts
|
||||
#region Newly Revealed Facts
|
||||
|
||||
public static void AddNewlyRevealedFactID(string id)
|
||||
{
|
||||
@ -131,7 +126,7 @@ namespace NewHorizons.External
|
||||
Save();
|
||||
}
|
||||
|
||||
# endregion
|
||||
#endregion
|
||||
|
||||
private class NewHorizonsSaveFile
|
||||
{
|
||||
@ -1,12 +1,6 @@
|
||||
using NewHorizons.Components.Orbital;
|
||||
using NewHorizons.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace NewHorizons.External
|
||||
namespace NewHorizons.External.Modules
|
||||
{
|
||||
public class OrbitModule : Module, IOrbitalParameters
|
||||
{
|
||||
@ -1,11 +1,5 @@
|
||||
using NewHorizons.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace NewHorizons.External
|
||||
namespace NewHorizons.External.Modules
|
||||
{
|
||||
public class ProcGenModule : Module
|
||||
{
|
||||
@ -1,11 +1,5 @@
|
||||
using NewHorizons.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace NewHorizons.External
|
||||
namespace NewHorizons.External.Modules
|
||||
{
|
||||
public class PropModule : Module
|
||||
{
|
||||
@ -1,6 +1,5 @@
|
||||
using NewHorizons.Utility;
|
||||
|
||||
namespace NewHorizons.External
|
||||
namespace NewHorizons.External.Modules
|
||||
{
|
||||
public class ShipLogModule : Module
|
||||
{
|
||||
@ -1,11 +1,5 @@
|
||||
using NewHorizons.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace NewHorizons.External
|
||||
namespace NewHorizons.External.Modules
|
||||
{
|
||||
public class SignalModule : Module
|
||||
{
|
||||
@ -1,11 +1,5 @@
|
||||
using NewHorizons.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace NewHorizons.External
|
||||
namespace NewHorizons.External.Modules
|
||||
{
|
||||
public class SpawnModule : Module
|
||||
{
|
||||
@ -1,11 +1,5 @@
|
||||
using NewHorizons.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace NewHorizons.External.VariableSize
|
||||
namespace NewHorizons.External.Modules.VariableSize
|
||||
{
|
||||
public class FunnelModule : VariableSizeModule
|
||||
{
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user