mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Bug fixes
This commit is contained in:
parent
338baf21ff
commit
fdde9a2238
@ -24,24 +24,29 @@ namespace NewHorizons.Builder.Body
|
||||
|
||||
public static void Make(GameObject body, Sector sector, OWRigidbody OWRB, IPlanetConfig config)
|
||||
{
|
||||
|
||||
var size = config.Base.BlackHoleSize;
|
||||
string pairedSingularity = null;
|
||||
var polarity = Polarity.BlackHole;
|
||||
|
||||
if (config.Singularity != null)
|
||||
// Backwards compatibility
|
||||
if(config.Singularity == null)
|
||||
{
|
||||
size = config.Singularity.Size;
|
||||
pairedSingularity = config.Singularity.PairedSingularity;
|
||||
if(config.Singularity.Type != null && config.Singularity.Type.ToUpper().Equals("WHITEHOLE"))
|
||||
if(config.Base.BlackHoleSize != 0)
|
||||
{
|
||||
polarity = Polarity.WhiteHole;
|
||||
MakeBlackHole(body, sector, Vector3.zero, config.Base.BlackHoleSize, true, null);
|
||||
}
|
||||
return;
|
||||
}
|
||||
bool isWormHole = config.Singularity.TargetStarSystem != null;
|
||||
|
||||
var size = config.Singularity.Size;
|
||||
var pairedSingularity = config.Singularity.PairedSingularity;
|
||||
|
||||
var polarity = Polarity.BlackHole;
|
||||
if (config.Singularity.Type != null && config.Singularity.Type.ToUpper().Equals("WHITEHOLE"))
|
||||
{
|
||||
polarity = Polarity.WhiteHole;
|
||||
}
|
||||
|
||||
bool isWormHole = config.Singularity?.TargetStarSystem != null;
|
||||
bool hasHazardVolume = !isWormHole && (pairedSingularity == null);
|
||||
|
||||
Vector3 localPosition = config.Singularity.Position == null ? Vector3.zero : (Vector3)config.Singularity.Position;
|
||||
Vector3 localPosition = config.Singularity?.Position == null ? Vector3.zero : (Vector3)config.Singularity.Position;
|
||||
|
||||
GameObject newSingularity = null;
|
||||
switch (polarity)
|
||||
|
||||
@ -110,8 +110,6 @@ namespace NewHorizons.Builder.General
|
||||
primary.transform.position = point.transform.position + primaryCartesianState.Item1;
|
||||
secondary.transform.position = point.transform.position + secondaryCartesianState.Item1;
|
||||
|
||||
Logger.Log($"Positions: {primary.transform.position}, {secondary.transform.position}");
|
||||
|
||||
var primaryOriginal = mapping[primaryHB];
|
||||
var secondaryOriginal = mapping[secondaryHB];
|
||||
|
||||
@ -159,10 +157,6 @@ namespace NewHorizons.Builder.General
|
||||
{
|
||||
trackingOrbitSecondary.TrailTime = period;
|
||||
}
|
||||
|
||||
Logger.Log($"{parent}: {mapping[parent]}");
|
||||
Logger.Log($"{primaryHB}: {mapping[primaryHB]}");
|
||||
Logger.Log($"{secondaryHB}: {mapping[secondaryHB]}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,6 +12,36 @@ namespace NewHorizons.Builder.General
|
||||
{
|
||||
static class PlanetDestroyer
|
||||
{
|
||||
private static readonly string[] _solarSystemBodies = new string[]
|
||||
{
|
||||
"Ash Twin",
|
||||
"Attlerock",
|
||||
"Brittle Hollow",
|
||||
"Dark Bramble",
|
||||
"DreamWorld",
|
||||
"Ember Twin",
|
||||
"Giant's Deep",
|
||||
"Hollow's Lantern",
|
||||
"Interloper",
|
||||
"Map Satellite",
|
||||
"Orbital Probe Cannon",
|
||||
"Quantum Moon",
|
||||
"RingWorld",
|
||||
"Sun",
|
||||
"Sun Station",
|
||||
"Timber Hearth",
|
||||
"White Hole"
|
||||
};
|
||||
|
||||
public static void RemoveSolarSystem()
|
||||
{
|
||||
foreach(var name in _solarSystemBodies)
|
||||
{
|
||||
var ao = AstroObjectLocator.GetAstroObject(name);
|
||||
if (ao != null) RemoveBody(ao);
|
||||
}
|
||||
}
|
||||
|
||||
public static void RemoveBody(AstroObject ao, List<AstroObject> toDestroy = null)
|
||||
{
|
||||
Logger.Log($"Removing {ao.name}");
|
||||
|
||||
@ -85,8 +85,6 @@ namespace NewHorizons
|
||||
|
||||
_isChangingStarSystem = false;
|
||||
|
||||
HeavenlyBodyBuilder.Reset();
|
||||
|
||||
if (scene.name.Equals("TitleScreen")) DisplayBodyOnTitleScreen();
|
||||
|
||||
if (scene.name != "SolarSystem")
|
||||
@ -96,6 +94,8 @@ namespace NewHorizons
|
||||
return;
|
||||
}
|
||||
|
||||
HeavenlyBodyBuilder.Reset();
|
||||
|
||||
NewHorizonsData.Load();
|
||||
|
||||
Instance.ModHelper.Events.Unity.FireOnNextUpdate(() => ShipLogBuilder.Init());
|
||||
@ -192,14 +192,10 @@ namespace NewHorizons
|
||||
// I don't know what these do but they look really weird from a distance
|
||||
Instance.ModHelper.Events.Unity.FireOnNextUpdate(() => PlanetDestroyer.RemoveDistantProxyClones());
|
||||
|
||||
if(!_currentStarSystem.Equals("SolarSystem")) Instance.ModHelper.Events.Unity.FireOnNextUpdate(() => PlanetDestroyer.RemoveSolarSystem());
|
||||
|
||||
var map = GameObject.FindObjectOfType<MapController>();
|
||||
if (map != null) map._maxPanDistance = FurthestOrbit * 1.5f;
|
||||
/*
|
||||
foreach(var cam in GameObject.FindObjectsOfType<OWCamera>())
|
||||
{
|
||||
cam.farClipPlane = FurthestOrbit * 3f;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
public void DisplayBodyOnTitleScreen()
|
||||
@ -349,6 +345,7 @@ namespace NewHorizons
|
||||
{
|
||||
var config = mod.ModHelper.Storage.Load<PlanetConfig>(file.Replace(folder, ""));
|
||||
Logger.Log($"Loaded {config.Name}");
|
||||
if (config.Base.CenterOfSolarSystem) config.Orbit.IsStatic = true;
|
||||
BodyList.Add(new NewHorizonsBody(config, mod.ModHelper.Assets, mod.ModHelper.Manifest.UniqueName));
|
||||
}
|
||||
catch (Exception e)
|
||||
@ -460,7 +457,7 @@ namespace NewHorizons
|
||||
SpawnPointBuilder.Make(go, body.Config.Spawn, owRigidBody);
|
||||
}
|
||||
|
||||
if (body.Config.Orbit.ShowOrbitLine) OrbitlineBuilder.Make(body.Object, ao, body.Config.Orbit.IsMoon, body.Config);
|
||||
if (body.Config.Orbit.ShowOrbitLine && !body.Config.Orbit.IsStatic) OrbitlineBuilder.Make(body.Object, ao, body.Config.Orbit.IsMoon, body.Config);
|
||||
|
||||
if (!body.Config.Orbit.IsStatic) DetectorBuilder.Make(go, owRigidBody, primaryBody, ao);
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
"author": "xen",
|
||||
"name": "New Horizons",
|
||||
"uniqueName": "xen.NewHorizons",
|
||||
"version": "0.5.0",
|
||||
"version": "0.5.1",
|
||||
"owmlVersion": "2.1.0",
|
||||
"dependencies": [ "PacificEngine.OW_CommonResources" ]
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user