From 37032ca222c5654d3a6ade675d4b3c4efb805b8d Mon Sep 17 00:00:00 2001 From: Nick Date: Tue, 22 Aug 2023 19:15:01 -0400 Subject: [PATCH] Add option to disable proxy generation #700 --- NewHorizons/External/Modules/BaseModule.cs | 6 ++++++ NewHorizons/Handlers/PlanetCreationHandler.cs | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/NewHorizons/External/Modules/BaseModule.cs b/NewHorizons/External/Modules/BaseModule.cs index 9d72301c..1e1c28d1 100644 --- a/NewHorizons/External/Modules/BaseModule.cs +++ b/NewHorizons/External/Modules/BaseModule.cs @@ -79,6 +79,12 @@ namespace NewHorizons.External.Modules /// public bool pushable; + /// + /// Set this to true to have no proxy be generated for this planet. + /// This is a small representation of the planet that appears when it is outside of the regular Unity camera range. + /// + public bool hideProxy; + #region Obsolete [Obsolete("IsSatellite is deprecated, please use ShowMinimap instead")] diff --git a/NewHorizons/Handlers/PlanetCreationHandler.cs b/NewHorizons/Handlers/PlanetCreationHandler.cs index 2b014cbf..d15c97a9 100644 --- a/NewHorizons/Handlers/PlanetCreationHandler.cs +++ b/NewHorizons/Handlers/PlanetCreationHandler.cs @@ -493,7 +493,7 @@ namespace NewHorizons.Handlers var remnant = otherBodies.Where(x => x.Config.isStellarRemnant && x.Config.name == body.Config.name).FirstOrDefault(); // TODO: add proxies for quantum states //var quantumStates = otherBodies.Where(x => x.Config.isQuantumState && x.Config.name == body.Config.name).ToArray(); - if (!(body.Config.Cloak != null && body.Config.Cloak.radius != 0f)) + if (!(body.Config.Cloak != null && body.Config.Cloak.radius != 0f) && !body.Config.Base.hideProxy) { Delay.FireOnNextUpdate(() => {