From 598f29b820b58bcc58f4a5a0462d10681761af9b Mon Sep 17 00:00:00 2001 From: Shadnix Date: Fri, 28 May 2021 02:03:05 +0200 Subject: [PATCH] Cleanup --- Plugin.cs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Plugin.cs b/Plugin.cs index bb94423..8b34213 100644 --- a/Plugin.cs +++ b/Plugin.cs @@ -19,7 +19,6 @@ public class Plugin { public static string PluginName => "SaberTailor"; public static SemVer.Version PluginVersion { get; private set; } = new SemVer.Version("0.0.0"); // Default - internal static bool IsBSMLMenuLoaded = false; [Init] public void Init(IPALogger logger, PluginMetadata metadata) @@ -40,7 +39,6 @@ public void Init(IPALogger logger, PluginMetadata metadata) public void OnActiveSceneChanged(Scene prevScene, Scene nextScene) { - Logger.log.Info("Switching scene. Prev scene name is '" + prevScene.name + "' and next scene name is '" + nextScene.name + "'"); if (nextScene.name == "GameCore") { if (Configuration.Scale.TweakEnabled) @@ -48,11 +46,6 @@ public void OnActiveSceneChanged(Scene prevScene, Scene nextScene) new GameObject(PluginName).AddComponent(); } } - else if (nextScene.name == "MainMenu" && !IsBSMLMenuLoaded) - { - BSMLSettings.instance.AddSettingsMenu("SaberTailor", "SaberTailor.Settings.UI.Views.mainsettings.bsml", MainSettings.instance); - IsBSMLMenuLoaded = true; - } } private void Load() @@ -62,6 +55,7 @@ private void Load() AddEvents(); + BSMLSettings.instance.AddSettingsMenu("SaberTailor", "SaberTailor.Settings.UI.Views.mainsettings.bsml", MainSettings.instance); Logger.log.Info($"{PluginName} v.{PluginVersion} has started."); } @@ -70,6 +64,8 @@ private void Unload() SaberTailorPatches.RemoveHarmonyPatches(); Configuration.Save(); RemoveEvents(); + + BSMLSettings.instance.RemoveSettingsMenu(MainSettings.instance); } private void AddEvents()