From 6442f6bb2218a93b9980014f7f5f07ae179f4f1f Mon Sep 17 00:00:00 2001 From: TerrificTrifid <99054745+TerrificTrifid@users.noreply.github.com> Date: Thu, 23 Feb 2023 23:30:53 -0600 Subject: [PATCH] Creation handler --- NewHorizons/Builder/General/AmbientLightBuilder.cs | 2 +- NewHorizons/Handlers/PlanetCreationHandler.cs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/NewHorizons/Builder/General/AmbientLightBuilder.cs b/NewHorizons/Builder/General/AmbientLightBuilder.cs index 634051a0..2a1f326c 100644 --- a/NewHorizons/Builder/General/AmbientLightBuilder.cs +++ b/NewHorizons/Builder/General/AmbientLightBuilder.cs @@ -5,7 +5,7 @@ namespace NewHorizons.Builder.General { public static class AmbientLightBuilder { - public static Light Make(GameObject planetGO, Sector sector, AmbientLightModule config) + public static Light Make(GameObject planetGO, Sector sector, AmbientLightModule config, float surfaceSize) { var ambientLight = Main.Instance.CurrentStarSystem == "EyeOfTheUniverse" ? SearchUtilities.Find("EyeOfTheUniverse_Body/Sector_EyeOfTheUniverse/SixthPlanet_Root/QuantumMoonProxy_Pivot/QuantumMoonProxy_Root/MoonState_Root/AmbientLight_QM") : SearchUtilities.Find("QuantumMoon_Body/AmbientLight_QM"); if (ambientLight == null) return null; diff --git a/NewHorizons/Handlers/PlanetCreationHandler.cs b/NewHorizons/Handlers/PlanetCreationHandler.cs index 196061dc..e69411ee 100644 --- a/NewHorizons/Handlers/PlanetCreationHandler.cs +++ b/NewHorizons/Handlers/PlanetCreationHandler.cs @@ -498,9 +498,10 @@ namespace NewHorizons.Handlers var sphereOfInfluence = GetSphereOfInfluence(body); Light[] ambientLight = null; - if (body.Config.Base.ambientLight != 0) + if (body.Config.AmbientLights != null) { - ambientLight = AmbientLightBuilder.Make(go, sector, sphereOfInfluence, body.Config.Base.ambientLight); + ambientLight = new Light[0]; + foreach (var light in body.Config.AmbientLights) ambientLight.Append(AmbientLightBuilder.Make(go, sector, light, body.Config.Base.surfaceSize)).ToArray(); } if (body.Config.Base.groundSize != 0)