From daad0bf78ac06105698be8a598b0df5d3b270e9f Mon Sep 17 00:00:00 2001 From: doombubbles Date: Fri, 27 Jan 2023 20:54:24 -0800 Subject: [PATCH] ModSettingHotkeys and mods menu fixes --- BloonsTD6 Mod Helper/LATEST.md | 8 +++----- BloonsTD6 Mod Helper/MelonMain.Settings.cs | 1 + .../Patches/UI/HotkeysScreenField_UpdateUI.cs | 14 ++++++++++++++ BloonsTD6 Mod Helper/UI/Menus/ModBrowserMenu.cs | 1 + BloonsTD6 Mod Helper/UI/Menus/ModSettingsMenu.cs | 1 + 5 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 BloonsTD6 Mod Helper/Patches/UI/HotkeysScreenField_UpdateUI.cs diff --git a/BloonsTD6 Mod Helper/LATEST.md b/BloonsTD6 Mod Helper/LATEST.md index 38f6c47ba..5b8b74152 100644 --- a/BloonsTD6 Mod Helper/LATEST.md +++ b/BloonsTD6 Mod Helper/LATEST.md @@ -1,5 +1,3 @@ -- Fixed Exporting Game Data button for modders -- Added `application/x-msdos-program` as an allowed download content type for the Mod Browser -- Increased the default mod browser download limit from 50 MB to 75 MB - - Added a more descriptive error message for mods that are too big -- Fixed some upgrade screen UI glitches \ No newline at end of file +- Fixed ModSettingHotkeys to allow easier overlap with vanilla hotkeys +- Fixed filtering mods menu empty page +- Fixes for ModSettingEnums (thanks Baydock!) \ No newline at end of file diff --git a/BloonsTD6 Mod Helper/MelonMain.Settings.cs b/BloonsTD6 Mod Helper/MelonMain.Settings.cs index c812e707a..afc8f945d 100644 --- a/BloonsTD6 Mod Helper/MelonMain.Settings.cs +++ b/BloonsTD6 Mod Helper/MelonMain.Settings.cs @@ -7,6 +7,7 @@ using BTD_Mod_Helper.Api.Enums; using BTD_Mod_Helper.Api.Helpers; using BTD_Mod_Helper.Api.ModOptions; +using BTD_Mod_Helper.Api.Towers; using UnityEngine; using static BTD_Mod_Helper.Api.Enums.VanillaSprites; diff --git a/BloonsTD6 Mod Helper/Patches/UI/HotkeysScreenField_UpdateUI.cs b/BloonsTD6 Mod Helper/Patches/UI/HotkeysScreenField_UpdateUI.cs new file mode 100644 index 000000000..94147377d --- /dev/null +++ b/BloonsTD6 Mod Helper/Patches/UI/HotkeysScreenField_UpdateUI.cs @@ -0,0 +1,14 @@ +using Il2CppAssets.Scripts.Unity.UI_New.Settings; +namespace BTD_Mod_Helper.Patches.UI; + +/// +/// Ignore any exceptions coming from this method +/// +[HarmonyPatch(typeof(HotkeysScreenField), nameof(HotkeysScreenField.UpdateUi))] +internal static class HotkeysScreenField_UpdateUI +{ + [HarmonyPostfix] + private static void Postfix() + { + } +} \ No newline at end of file diff --git a/BloonsTD6 Mod Helper/UI/Menus/ModBrowserMenu.cs b/BloonsTD6 Mod Helper/UI/Menus/ModBrowserMenu.cs index dca8304b8..841e0171d 100644 --- a/BloonsTD6 Mod Helper/UI/Menus/ModBrowserMenu.cs +++ b/BloonsTD6 Mod Helper/UI/Menus/ModBrowserMenu.cs @@ -170,6 +170,7 @@ public void AddNewElements() new Action(i => { currentTopic = topics[i]; + SetPage(0); RecalculateCurrentMods(); }), VanillaSprites.BlueInsertPanelRound, 80f); } diff --git a/BloonsTD6 Mod Helper/UI/Menus/ModSettingsMenu.cs b/BloonsTD6 Mod Helper/UI/Menus/ModSettingsMenu.cs index 9f69b5d74..921c97ade 100644 --- a/BloonsTD6 Mod Helper/UI/Menus/ModSettingsMenu.cs +++ b/BloonsTD6 Mod Helper/UI/Menus/ModSettingsMenu.cs @@ -29,6 +29,7 @@ public override bool OnMenuOpened(Object data) { var gameObject = GameMenu.gameObject; gameObject.DestroyAllChildren(); + GameMenu.saved = true; CommonForegroundHeader.SetText(BloonsMod.Info.Name);