From 407822560565eae179d322bf56d88d4a2dcda921 Mon Sep 17 00:00:00 2001 From: _nebula <41904486+misternebula@users.noreply.github.com> Date: Wed, 20 Mar 2024 19:32:25 +0000 Subject: [PATCH 1/6] fixed Configure not being called --- src/OWML.ModHelper.Menus/NewMenuSystem/MenuManager.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/OWML.ModHelper.Menus/NewMenuSystem/MenuManager.cs b/src/OWML.ModHelper.Menus/NewMenuSystem/MenuManager.cs index 65022c26..6374f6fa 100644 --- a/src/OWML.ModHelper.Menus/NewMenuSystem/MenuManager.cs +++ b/src/OWML.ModHelper.Menus/NewMenuSystem/MenuManager.cs @@ -221,6 +221,7 @@ void SaveConfig() { mod.ModHelper.Config.SetSettingsValue(name, newValue); mod.ModHelper.Storage.Save(mod.ModHelper.Config, Constants.ModConfigFileName); + mod.Configure(mod.ModHelper.Config); }; break; case SettingType.TOGGLE: @@ -233,6 +234,7 @@ void SaveConfig() { mod.ModHelper.Config.SetSettingsValue(name, newValue); mod.ModHelper.Storage.Save(mod.ModHelper.Config, Constants.ModConfigFileName); + mod.Configure(mod.ModHelper.Config); }; break; case SettingType.SELECTOR: @@ -245,6 +247,7 @@ void SaveConfig() { mod.ModHelper.Config.SetSettingsValue(name, newSelection); mod.ModHelper.Storage.Save(mod.ModHelper.Config, Constants.ModConfigFileName); + mod.Configure(mod.ModHelper.Config); }; break; case SettingType.SEPARATOR: @@ -261,6 +264,7 @@ void SaveConfig() _console.WriteLine($"changed to {newValue}"); mod.ModHelper.Config.SetSettingsValue(name, newValue); mod.ModHelper.Storage.Save(mod.ModHelper.Config, Constants.ModConfigFileName); + mod.Configure(mod.ModHelper.Config); }; break; case SettingType.TEXT: @@ -273,6 +277,7 @@ void SaveConfig() _console.WriteLine($"changed to {newValue}"); mod.ModHelper.Config.SetSettingsValue(name, newValue); mod.ModHelper.Storage.Save(mod.ModHelper.Config, Constants.ModConfigFileName); + mod.Configure(mod.ModHelper.Config); }; break; case SettingType.NUMBER: @@ -285,6 +290,7 @@ void SaveConfig() _console.WriteLine($"changed to {newValue}"); mod.ModHelper.Config.SetSettingsValue(name, newValue); mod.ModHelper.Storage.Save(mod.ModHelper.Config, Constants.ModConfigFileName); + mod.Configure(mod.ModHelper.Config); }; break; default: From 3ea6d22488ad7773fac2411f782a0e40cf465564 Mon Sep 17 00:00:00 2001 From: _nebula <41904486+misternebula@users.noreply.github.com> Date: Wed, 20 Mar 2024 19:51:26 +0000 Subject: [PATCH 2/6] fix some title buttons not appearing --- src/OWML.ModHelper.Menus/NewMenuSystem/MenuManager.cs | 10 +++------- .../NewMenuSystem/PopupMenuManager.cs | 6 +++++- .../NewMenuSystem/TitleMenuManager.cs | 2 ++ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/OWML.ModHelper.Menus/NewMenuSystem/MenuManager.cs b/src/OWML.ModHelper.Menus/NewMenuSystem/MenuManager.cs index 6374f6fa..b40f1bfa 100644 --- a/src/OWML.ModHelper.Menus/NewMenuSystem/MenuManager.cs +++ b/src/OWML.ModHelper.Menus/NewMenuSystem/MenuManager.cs @@ -49,7 +49,7 @@ public MenuManager( _owmlConfig = owmlConfig; _unityEvents = unityEvents; TitleMenuManager = new TitleMenuManager(); - PopupMenuManager = new PopupMenuManager(console, harmony); + PopupMenuManager = new PopupMenuManager(console, harmony, this); OptionsMenuManager = new OptionsMenuManager(console, unityEvents, PopupMenuManager); PauseMenuManager = new PauseMenuManager(console); @@ -58,18 +58,14 @@ public MenuManager( LoadManager.OnCompleteSceneLoad += (_, newScene) => { - if (newScene is OWScene.TitleScreen or OWScene.SolarSystem or OWScene.EyeOfTheUniverse) + if (newScene is OWScene.SolarSystem or OWScene.EyeOfTheUniverse) { SetupMenus(((IMenuManager)this).ModList); } }; - - modUnityEvents.RunWhen( - PlayerData.IsLoaded, - () => SetupMenus(((IMenuManager)this).ModList)); } - private void SetupMenus(IList modList) + internal void SetupMenus(IList modList) { void SaveConfig() { diff --git a/src/OWML.ModHelper.Menus/NewMenuSystem/PopupMenuManager.cs b/src/OWML.ModHelper.Menus/NewMenuSystem/PopupMenuManager.cs index 087479f8..1790841f 100644 --- a/src/OWML.ModHelper.Menus/NewMenuSystem/PopupMenuManager.cs +++ b/src/OWML.ModHelper.Menus/NewMenuSystem/PopupMenuManager.cs @@ -23,9 +23,10 @@ public class PopupMenuManager : IPopupMenuManager private GameObject _twoChoicePopupBase; private GameObject _inputPopupBase; - public PopupMenuManager(IModConsole console, IHarmonyHelper harmony) + public PopupMenuManager(IModConsole console, IHarmonyHelper harmony, IMenuManager menuManager) { _console = console; + StartupPopupPatches.menuManager = menuManager as MenuManager; LoadManager.OnCompleteSceneLoad += LoadManager_OnCompleteSceneLoad; @@ -323,6 +324,8 @@ public IOWMLFourChoicePopupMenu CreateFourChoicePopup(string message, string con public static class StartupPopupPatches { + public static MenuManager menuManager; + public static bool DetermineStartupPopups(TitleScreenManager __instance) { if (__instance._profileManager.currentProfileGameSave.version == "NONE") @@ -375,6 +378,7 @@ public static bool TryShowStartupPopupsAndShowMenu(TitleScreenManager __instance if (firstTimeRun) { + menuManager.SetupMenus((menuManager as IMenuManager).ModList); __instance.FadeInMenuOptions(); return false; } diff --git a/src/OWML.ModHelper.Menus/NewMenuSystem/TitleMenuManager.cs b/src/OWML.ModHelper.Menus/NewMenuSystem/TitleMenuManager.cs index fac32ceb..4f0923c3 100644 --- a/src/OWML.ModHelper.Menus/NewMenuSystem/TitleMenuManager.cs +++ b/src/OWML.ModHelper.Menus/NewMenuSystem/TitleMenuManager.cs @@ -39,6 +39,8 @@ public SubmitAction CreateTitleButton(string text, int index, bool fromTop) titleScreenManager._mainMenuTextFields = titleScreenManager._mainMenuTextFields.Append(submitAction.GetComponentInChildren()).ToArray(); + newButton.SetActive(true); + return submitAction; } From 7a5532cc191a6a2d4786f39ae152e88c06c6db8d Mon Sep 17 00:00:00 2001 From: _nebula <41904486+misternebula@users.noreply.github.com> Date: Wed, 20 Mar 2024 19:57:40 +0000 Subject: [PATCH 3/6] add extra check to startup popups --- src/OWML.ModHelper.Menus/NewMenuSystem/PopupMenuManager.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/OWML.ModHelper.Menus/NewMenuSystem/PopupMenuManager.cs b/src/OWML.ModHelper.Menus/NewMenuSystem/PopupMenuManager.cs index 1790841f..2b9b6450 100644 --- a/src/OWML.ModHelper.Menus/NewMenuSystem/PopupMenuManager.cs +++ b/src/OWML.ModHelper.Menus/NewMenuSystem/PopupMenuManager.cs @@ -366,7 +366,7 @@ public static bool TryShowStartupPopupsAndShowMenu(TitleScreenManager __instance return false; } - if (PopupMenuManager.PopupsToShow.Count == 0) + if (PopupMenuManager.PopupsToShow == null || PopupMenuManager.PopupsToShow.Count == 0) { __instance._okCancelPopup.ResetPopup(); __instance.SetUpMainMenu(); @@ -395,6 +395,11 @@ public static bool TryShowStartupPopups(TitleScreenManager __instance) { string text = "AAAAGGGGGHH"; + if (PopupMenuManager.PopupsToShow == null || PopupMenuManager.PopupsToShow.Count == 0) + { + __instance.TryShowStartupPopupsAndShowMenu(true); + } + PopupMenuManager.ActivePopup = PopupMenuManager.PopupsToShow.First(); if (PopupMenuManager.ActivePopup <= 2) From 477c88081f5979e9234738f53e11e5dac90b3063 Mon Sep 17 00:00:00 2001 From: _nebula <41904486+misternebula@users.noreply.github.com> Date: Wed, 20 Mar 2024 19:58:13 +0000 Subject: [PATCH 4/6] Update OWML.Manifest.json --- src/OWML.Launcher/OWML.Manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OWML.Launcher/OWML.Manifest.json b/src/OWML.Launcher/OWML.Manifest.json index 06d55c71..78a9e37f 100644 --- a/src/OWML.Launcher/OWML.Manifest.json +++ b/src/OWML.Launcher/OWML.Manifest.json @@ -3,7 +3,7 @@ "author": "Alek", "name": "OWML", "uniqueName": "Alek.OWML", - "version": "2.10.0", + "version": "2.10.1", "minGameVersion": "1.1.14.768", "maxGameVersion": "1.1.14.768" } From 74dae7b136f14b2f0e16247a3f2395716c75dc58 Mon Sep 17 00:00:00 2001 From: _nebula <41904486+misternebula@users.noreply.github.com> Date: Wed, 20 Mar 2024 20:00:11 +0000 Subject: [PATCH 5/6] Update PopupMenuManager.cs --- src/OWML.ModHelper.Menus/NewMenuSystem/PopupMenuManager.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/OWML.ModHelper.Menus/NewMenuSystem/PopupMenuManager.cs b/src/OWML.ModHelper.Menus/NewMenuSystem/PopupMenuManager.cs index 2b9b6450..749a45eb 100644 --- a/src/OWML.ModHelper.Menus/NewMenuSystem/PopupMenuManager.cs +++ b/src/OWML.ModHelper.Menus/NewMenuSystem/PopupMenuManager.cs @@ -398,6 +398,7 @@ public static bool TryShowStartupPopups(TitleScreenManager __instance) if (PopupMenuManager.PopupsToShow == null || PopupMenuManager.PopupsToShow.Count == 0) { __instance.TryShowStartupPopupsAndShowMenu(true); + return false; } PopupMenuManager.ActivePopup = PopupMenuManager.PopupsToShow.First(); From 6987cebccfe8960e3cc9141deeac1e35d3d819e7 Mon Sep 17 00:00:00 2001 From: _nebula <41904486+misternebula@users.noreply.github.com> Date: Wed, 20 Mar 2024 20:03:11 +0000 Subject: [PATCH 6/6] removed logs --- src/OWML.ModHelper.Menus/NewMenuSystem/MenuManager.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/OWML.ModHelper.Menus/NewMenuSystem/MenuManager.cs b/src/OWML.ModHelper.Menus/NewMenuSystem/MenuManager.cs index b40f1bfa..0c2944a5 100644 --- a/src/OWML.ModHelper.Menus/NewMenuSystem/MenuManager.cs +++ b/src/OWML.ModHelper.Menus/NewMenuSystem/MenuManager.cs @@ -257,7 +257,6 @@ void SaveConfig() settingSlider.ModSettingKey = name; settingSlider.OnValueChanged += (float newValue) => { - _console.WriteLine($"changed to {newValue}"); mod.ModHelper.Config.SetSettingsValue(name, newValue); mod.ModHelper.Storage.Save(mod.ModHelper.Config, Constants.ModConfigFileName); mod.Configure(mod.ModHelper.Config); @@ -270,7 +269,6 @@ void SaveConfig() textInput.OnConfirmEntry += () => { var newValue = textInput.GetInputText(); - _console.WriteLine($"changed to {newValue}"); mod.ModHelper.Config.SetSettingsValue(name, newValue); mod.ModHelper.Storage.Save(mod.ModHelper.Config, Constants.ModConfigFileName); mod.Configure(mod.ModHelper.Config); @@ -283,7 +281,6 @@ void SaveConfig() numberInput.OnConfirmEntry += () => { var newValue = double.Parse(numberInput.GetInputText()); - _console.WriteLine($"changed to {newValue}"); mod.ModHelper.Config.SetSettingsValue(name, newValue); mod.ModHelper.Storage.Save(mod.ModHelper.Config, Constants.ModConfigFileName); mod.Configure(mod.ModHelper.Config);