From c2f3b0d8f7e54a285324a792fd524a08e227ee37 Mon Sep 17 00:00:00 2001 From: Noah Pilarski Date: Thu, 18 Aug 2022 22:56:04 -0400 Subject: [PATCH] Use activated --- NewHorizons/Components/NHProxy.cs | 4 ++-- NewHorizons/Components/StellarRemnantController.cs | 6 ++++++ NewHorizons/Components/StellarRemnantProxy.cs | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/NewHorizons/Components/NHProxy.cs b/NewHorizons/Components/NHProxy.cs index 42f9cbbf..27680eff 100644 --- a/NewHorizons/Components/NHProxy.cs +++ b/NewHorizons/Components/NHProxy.cs @@ -90,7 +90,7 @@ namespace NewHorizons.Components if (_stellarRemnant != null) { - if (_stellarRemnant.IsActiveAndEnabled()) + if (_stellarRemnant.IsActivated()) { _realObjectDiameter = _stellarRemnant._realObjectDiameter; if (!_stellarRemnant.IsRenderingOn()) ToggleRendering(_outOfRange); @@ -110,7 +110,7 @@ namespace NewHorizons.Components if (_stellarRemnant != null) { _stellarRemnant.ToggleRendering(on); - on = on && !_stellarRemnant.IsActiveAndEnabled(); + on = on && !_stellarRemnant.IsActivated(); } base.ToggleRendering(on); diff --git a/NewHorizons/Components/StellarRemnantController.cs b/NewHorizons/Components/StellarRemnantController.cs index 59a267f4..753d4a5a 100644 --- a/NewHorizons/Components/StellarRemnantController.cs +++ b/NewHorizons/Components/StellarRemnantController.cs @@ -11,6 +11,8 @@ namespace NewHorizons.Components { private StellarRemnantType _type = StellarRemnantType.Default; + private bool _activated; + private StarEvolutionController _starEvolutionController; private StellarRemnantProxy _proxy; @@ -68,6 +70,10 @@ namespace NewHorizons.Components } if (_starController != null) StarLightController.AddStar(_starController); + + _activated = true; } + + public bool IsActivated() => _activated; } } diff --git a/NewHorizons/Components/StellarRemnantProxy.cs b/NewHorizons/Components/StellarRemnantProxy.cs index a5a4d6e8..fb14fbd4 100644 --- a/NewHorizons/Components/StellarRemnantProxy.cs +++ b/NewHorizons/Components/StellarRemnantProxy.cs @@ -62,7 +62,7 @@ namespace NewHorizons.Components public void ToggleRendering(bool on) { - on = on && IsActiveAndEnabled(); + on = on && IsActivated(); _renderingOn = on; @@ -146,7 +146,7 @@ namespace NewHorizons.Components controller.SetProxy(this); } - public bool IsActiveAndEnabled() => _stellarRemnantController.isActiveAndEnabled; + public bool IsActivated() => _stellarRemnantController.IsActivated(); public bool IsRenderingOn() => _renderingOn; } }