From 9dd43f56047113d63447e81c907e8137b02c7758 Mon Sep 17 00:00:00 2001 From: Nick Date: Mon, 15 Aug 2022 12:53:49 -0400 Subject: [PATCH 1/2] Add detectors to static bodies, just don't detect anything #217 --- NewHorizons/Builder/General/DetectorBuilder.cs | 2 +- NewHorizons/Handlers/PlanetCreationHandler.cs | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/NewHorizons/Builder/General/DetectorBuilder.cs b/NewHorizons/Builder/General/DetectorBuilder.cs index 82671951..99454263 100644 --- a/NewHorizons/Builder/General/DetectorBuilder.cs +++ b/NewHorizons/Builder/General/DetectorBuilder.cs @@ -36,7 +36,7 @@ namespace NewHorizons.Builder.General // Could copy the splash from the interloper as well some day } - SetDetector(primaryBody, astroObject, forceDetector); + if (!config.Orbit.isStatic) SetDetector(primaryBody, astroObject, forceDetector); detectorGO.SetActive(true); return detectorGO; diff --git a/NewHorizons/Handlers/PlanetCreationHandler.cs b/NewHorizons/Handlers/PlanetCreationHandler.cs index bffe3fea..5b705491 100644 --- a/NewHorizons/Handlers/PlanetCreationHandler.cs +++ b/NewHorizons/Handlers/PlanetCreationHandler.cs @@ -433,10 +433,7 @@ namespace NewHorizons.Handlers Delay.FireOnNextUpdate(() => OrbitlineBuilder.Make(body.Object, ao as NHAstroObject, body.Config.Orbit.isMoon, body.Config)); } - if (!body.Config.Orbit.isStatic) - { - DetectorBuilder.Make(go, owRigidBody, primaryBody, ao, body.Config); - } + DetectorBuilder.Make(go, owRigidBody, primaryBody, ao, body.Config); AstroObjectLocator.RegisterCustomAstroObject(ao); From 4d0664b4d592c9dc61f57d0a4fc0e87713f36528 Mon Sep 17 00:00:00 2001 From: TerrificTrifid <99054745+TerrificTrifid@users.noreply.github.com> Date: Mon, 15 Aug 2022 20:18:27 -0500 Subject: [PATCH 2/2] Ambient light tweaks --- NewHorizons/Builder/General/AmbientLightBuilder.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/NewHorizons/Builder/General/AmbientLightBuilder.cs b/NewHorizons/Builder/General/AmbientLightBuilder.cs index c51f90c0..c058a496 100644 --- a/NewHorizons/Builder/General/AmbientLightBuilder.cs +++ b/NewHorizons/Builder/General/AmbientLightBuilder.cs @@ -6,21 +6,26 @@ namespace NewHorizons.Builder.General { public static void Make(GameObject planetGO, Sector sector, float scale, float intensity) { - GameObject lightGO = GameObject.Instantiate(SearchUtilities.Find("BrittleHollow_Body/AmbientLight_BH_Surface"), sector?.transform ?? planetGO.transform); + GameObject lightGO = GameObject.Instantiate(SearchUtilities.Find("QuantumMoon_Body/AmbientLight_QM"), sector?.transform ?? planetGO.transform); lightGO.transform.position = planetGO.transform.position; - lightGO.name = "Light"; + lightGO.name = "AmbientLight"; var light = lightGO.GetComponent(); - light.name = "AmbientLight"; /* R is related to the inner radius of the ambient light volume * G is if its a shell or not. 1.0f for shell else 0.0f. * B is just 1.0 always I think, altho no because changing it changes the brightness so idk * A is the intensity and its like square rooted and squared and idgi */ - light.color = new Color(0.0f, 0.0f, 0.8f, 0.0225f); + light.color = new Color(0.5f, 0.0f, 0.8f, 0.0225f); light.range = scale; light.intensity = intensity; + + /*if (tint != null) + { + var cubemap = ImageUtilities.TintImage(ImageUtilities.GetTexture(Main.Instance, "Assets/textures/AmbientLight_QM.png"), tint.ToColor()); + light.cookie = cubemap; + }*/ } } }