mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2026-08-06 05:20:19 +08:00
fix: avoid NRE in BeltSignal reset and remove no-op GalaxySelectUI reset
This commit is contained in:
@@ -67,7 +67,7 @@ internal static class BeltSignalPatch
|
|||||||
internal static void ResetState()
|
internal static void ResetState()
|
||||||
{
|
{
|
||||||
_clusterSeedKey = 0L;
|
_clusterSeedKey = 0L;
|
||||||
_signalBelts = null;
|
_signalBelts = new Dictionary<int, uint>[64];
|
||||||
SignalBeltFactoryIndices.Clear();
|
SignalBeltFactoryIndices.Clear();
|
||||||
for (var i = 0; i < DarkFogItemsInVoid.Length; i++)
|
for (var i = 0; i < DarkFogItemsInVoid.Length; i++)
|
||||||
DarkFogItemsInVoid[i] = 0;
|
DarkFogItemsInVoid[i] = 0;
|
||||||
|
|||||||
@@ -30,21 +30,14 @@ public static class GalaxySelectUIPatch
|
|||||||
{
|
{
|
||||||
MoreSettings.Enabled.SettingChanged += OnEnabledChanged;
|
MoreSettings.Enabled.SettingChanged += OnEnabledChanged;
|
||||||
Enable(MoreSettings.Enabled.Value);
|
Enable(MoreSettings.Enabled.Value);
|
||||||
GameLogicProc.OnGameEnd += ResetState;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Uninit()
|
public static void Uninit()
|
||||||
{
|
{
|
||||||
GameLogicProc.OnGameEnd -= ResetState;
|
|
||||||
MoreSettings.Enabled.SettingChanged -= OnEnabledChanged;
|
MoreSettings.Enabled.SettingChanged -= OnEnabledChanged;
|
||||||
Enable(false);
|
Enable(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void ResetState()
|
|
||||||
{
|
|
||||||
// No per-game mutable fields in this file; UI references are lifecycle-safe.
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void OnEnabledChanged(object sender, System.EventArgs e)
|
private static void OnEnabledChanged(object sender, System.EventArgs e)
|
||||||
{
|
{
|
||||||
Enable(MoreSettings.Enabled.Value);
|
Enable(MoreSettings.Enabled.Value);
|
||||||
|
|||||||
Reference in New Issue
Block a user