mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Merge pull request #111 from xen-42/dev
Add more customization options to quantum states
This commit is contained in:
commit
d37f8431ac
@ -155,6 +155,8 @@ namespace NewHorizons.Handlers
|
|||||||
else Main.Instance.ModHelper.Events.Unity.FireInNUpdates(() => existingPlanet.SetActive(false), 2);
|
else Main.Instance.ModHelper.Events.Unity.FireInNUpdates(() => existingPlanet.SetActive(false), 2);
|
||||||
}
|
}
|
||||||
else if (body.Config.IsQuantumState)
|
else if (body.Config.IsQuantumState)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
var quantumPlanet = existingPlanet.GetComponent<QuantumPlanet>();
|
var quantumPlanet = existingPlanet.GetComponent<QuantumPlanet>();
|
||||||
if (quantumPlanet == null)
|
if (quantumPlanet == null)
|
||||||
@ -193,6 +195,12 @@ namespace NewHorizons.Handlers
|
|||||||
|
|
||||||
quantumPlanet.states.Add(new QuantumPlanet.State(sector, orbit));
|
quantumPlanet.states.Add(new QuantumPlanet.State(sector, orbit));
|
||||||
}
|
}
|
||||||
|
catch(Exception ex)
|
||||||
|
{
|
||||||
|
Logger.LogError($"Couldn't make quantum state for [{body.Config.Name}] : {ex.Message}, {ex.StackTrace}");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UpdateBody(body, existingPlanet);
|
UpdateBody(body, existingPlanet);
|
||||||
@ -295,11 +303,6 @@ namespace NewHorizons.Handlers
|
|||||||
var sector = MakeSector.Make(go, owRigidBody, sphereOfInfluence * 2f);
|
var sector = MakeSector.Make(go, owRigidBody, sphereOfInfluence * 2f);
|
||||||
ao._rootSector = sector;
|
ao._rootSector = sector;
|
||||||
|
|
||||||
if (body.Config.Base.GroundSize != 0)
|
|
||||||
{
|
|
||||||
GeometryBuilder.Make(go, sector, body.Config.Base.GroundSize);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (body.Config.Base.SurfaceGravity != 0)
|
if (body.Config.Base.SurfaceGravity != 0)
|
||||||
{
|
{
|
||||||
GravityBuilder.Make(go, ao, body.Config);
|
GravityBuilder.Make(go, ao, body.Config);
|
||||||
@ -315,28 +318,8 @@ namespace NewHorizons.Handlers
|
|||||||
MarkerBuilder.Make(go, body.Config.Name, body.Config);
|
MarkerBuilder.Make(go, body.Config.Name, body.Config);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (body.Config.Base.HasAmbientLight)
|
|
||||||
{
|
|
||||||
AmbientLightBuilder.Make(go, sector, sphereOfInfluence);
|
|
||||||
}
|
|
||||||
|
|
||||||
VolumesBuilder.Make(go, body.Config.Base.SurfaceSize, sphereOfInfluence, !body.Config.Base.IsSatellite);
|
VolumesBuilder.Make(go, body.Config.Base.SurfaceSize, sphereOfInfluence, !body.Config.Base.IsSatellite);
|
||||||
|
|
||||||
if (body.Config.HeightMap != null)
|
|
||||||
{
|
|
||||||
HeightMapBuilder.Make(go, sector, body.Config.HeightMap, body.Mod);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (body.Config.ProcGen != null)
|
|
||||||
{
|
|
||||||
ProcGenBuilder.Make(go, sector, body.Config.ProcGen);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (body.Config.Star != null)
|
|
||||||
{
|
|
||||||
StarLightController.AddStar(StarBuilder.Make(go, sector, body.Config.Star));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (body.Config.FocalPoint != null)
|
if (body.Config.FocalPoint != null)
|
||||||
{
|
{
|
||||||
FocalPointBuilder.Make(go, ao, body.Config, body.Mod);
|
FocalPointBuilder.Make(go, ao, body.Config, body.Mod);
|
||||||
@ -389,14 +372,47 @@ namespace NewHorizons.Handlers
|
|||||||
|
|
||||||
private static GameObject SharedGenerateBody(NewHorizonsBody body, GameObject go, Sector sector, OWRigidbody rb)
|
private static GameObject SharedGenerateBody(NewHorizonsBody body, GameObject go, Sector sector, OWRigidbody rb)
|
||||||
{
|
{
|
||||||
|
var sphereOfInfluence = GetSphereOfInfluence(body);
|
||||||
|
|
||||||
|
if (body.Config.Base.HasAmbientLight)
|
||||||
|
{
|
||||||
|
AmbientLightBuilder.Make(go, sector, sphereOfInfluence);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (body.Config.Base.GroundSize != 0)
|
||||||
|
{
|
||||||
|
GeometryBuilder.Make(go, sector, body.Config.Base.GroundSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (body.Config.HeightMap != null)
|
||||||
|
{
|
||||||
|
HeightMapBuilder.Make(go, sector, body.Config.HeightMap, body.Mod);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (body.Config.ProcGen != null)
|
||||||
|
{
|
||||||
|
ProcGenBuilder.Make(go, sector, body.Config.ProcGen);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (body.Config.Star != null)
|
||||||
|
{
|
||||||
|
StarLightController.AddStar(StarBuilder.Make(go, sector, body.Config.Star));
|
||||||
|
}
|
||||||
|
|
||||||
if (body.Config.Ring != null)
|
if (body.Config.Ring != null)
|
||||||
|
{
|
||||||
RingBuilder.Make(go, sector, body.Config.Ring, body.Mod);
|
RingBuilder.Make(go, sector, body.Config.Ring, body.Mod);
|
||||||
|
}
|
||||||
|
|
||||||
if (body.Config.AsteroidBelt != null)
|
if (body.Config.AsteroidBelt != null)
|
||||||
|
{
|
||||||
AsteroidBeltBuilder.Make(body.Config.Name, body.Config, body.Mod);
|
AsteroidBeltBuilder.Make(body.Config.Name, body.Config, body.Mod);
|
||||||
|
}
|
||||||
|
|
||||||
if (body.Config.Base.HasCometTail)
|
if (body.Config.Base.HasCometTail)
|
||||||
|
{
|
||||||
CometTailBuilder.Make(go, sector, body.Config, go.GetComponent<AstroObject>().GetPrimaryBody());
|
CometTailBuilder.Make(go, sector, body.Config, go.GetComponent<AstroObject>().GetPrimaryBody());
|
||||||
|
}
|
||||||
|
|
||||||
// Backwards compatability
|
// Backwards compatability
|
||||||
if (body.Config.Base.LavaSize != 0)
|
if (body.Config.Base.LavaSize != 0)
|
||||||
@ -407,7 +423,9 @@ namespace NewHorizons.Handlers
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (body.Config.Lava != null)
|
if (body.Config.Lava != null)
|
||||||
|
{
|
||||||
LavaBuilder.Make(go, sector, rb, body.Config.Lava);
|
LavaBuilder.Make(go, sector, rb, body.Config.Lava);
|
||||||
|
}
|
||||||
|
|
||||||
// Backwards compatability
|
// Backwards compatability
|
||||||
if (body.Config.Base.WaterSize != 0)
|
if (body.Config.Base.WaterSize != 0)
|
||||||
@ -419,10 +437,14 @@ namespace NewHorizons.Handlers
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (body.Config.Water != null)
|
if (body.Config.Water != null)
|
||||||
|
{
|
||||||
WaterBuilder.Make(go, sector, rb, body.Config.Water);
|
WaterBuilder.Make(go, sector, rb, body.Config.Water);
|
||||||
|
}
|
||||||
|
|
||||||
if (body.Config.Sand != null)
|
if (body.Config.Sand != null)
|
||||||
|
{
|
||||||
SandBuilder.Make(go, sector, rb, body.Config.Sand);
|
SandBuilder.Make(go, sector, rb, body.Config.Sand);
|
||||||
|
}
|
||||||
|
|
||||||
if (body.Config.Atmosphere != null)
|
if (body.Config.Atmosphere != null)
|
||||||
{
|
{
|
||||||
@ -454,20 +476,30 @@ namespace NewHorizons.Handlers
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (body.Config.Props != null)
|
if (body.Config.Props != null)
|
||||||
|
{
|
||||||
PropBuildManager.Make(go, sector, rb, body.Config, body.Mod, body.Mod.ModHelper.Manifest.UniqueName);
|
PropBuildManager.Make(go, sector, rb, body.Config, body.Mod, body.Mod.ModHelper.Manifest.UniqueName);
|
||||||
|
}
|
||||||
|
|
||||||
if (body.Config.Signal != null)
|
if (body.Config.Signal != null)
|
||||||
|
{
|
||||||
SignalBuilder.Make(go, sector, body.Config.Signal, body.Mod);
|
SignalBuilder.Make(go, sector, body.Config.Signal, body.Mod);
|
||||||
|
}
|
||||||
|
|
||||||
if (body.Config.Base.BlackHoleSize != 0 || body.Config.Singularity != null)
|
if (body.Config.Base.BlackHoleSize != 0 || body.Config.Singularity != null)
|
||||||
|
{
|
||||||
SingularityBuilder.Make(go, sector, rb, body.Config);
|
SingularityBuilder.Make(go, sector, rb, body.Config);
|
||||||
|
}
|
||||||
|
|
||||||
if (body.Config.Funnel != null)
|
if (body.Config.Funnel != null)
|
||||||
|
{
|
||||||
FunnelBuilder.Make(go, go.GetComponentInChildren<ConstantForceDetector>(), rb, body.Config.Funnel);
|
FunnelBuilder.Make(go, go.GetComponentInChildren<ConstantForceDetector>(), rb, body.Config.Funnel);
|
||||||
|
}
|
||||||
|
|
||||||
// Has to go last probably
|
// Has to go last probably
|
||||||
if (body.Config.Base.CloakRadius != 0f)
|
if (body.Config.Base.CloakRadius != 0f)
|
||||||
|
{
|
||||||
CloakBuilder.Make(go, sector, body.Config.Base.CloakRadius);
|
CloakBuilder.Make(go, sector, body.Config.Base.CloakRadius);
|
||||||
|
}
|
||||||
|
|
||||||
return go;
|
return go;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
"author": "xen, Bwc9876, & Book",
|
"author": "xen, Bwc9876, & Book",
|
||||||
"name": "New Horizons",
|
"name": "New Horizons",
|
||||||
"uniqueName": "xen.NewHorizons",
|
"uniqueName": "xen.NewHorizons",
|
||||||
"version": "0.15.1",
|
"version": "0.15.2",
|
||||||
"owmlVersion": "2.1.0",
|
"owmlVersion": "2.1.0",
|
||||||
"conflicts": [ "Raicuparta.QuantumSpaceBuddies", "Vesper.AutoResume", "PacificEngine.OW_Randomizer" ],
|
"conflicts": [ "Raicuparta.QuantumSpaceBuddies", "Vesper.AutoResume", "PacificEngine.OW_Randomizer" ],
|
||||||
"pathsToPreserve": [ "planets", "systems", "translations" ]
|
"pathsToPreserve": [ "planets", "systems", "translations" ]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user