diff --git a/Reactor.Debugger/Patches.cs b/Reactor.Debugger/Patches.cs index 3e67e3a..ec7ce5e 100644 --- a/Reactor.Debugger/Patches.cs +++ b/Reactor.Debugger/Patches.cs @@ -1,4 +1,7 @@ +using System.Linq; using HarmonyLib; +using UnhollowerBaseLib; +using UnityEngine; namespace Reactor.Debugger { @@ -40,5 +43,28 @@ namespace Reactor.Debugger return !PluginSingleton.Instance.Component.DisableGameEnd; } } + + [HarmonyPatch(typeof(GameSettingMenu), nameof(GameSettingMenu.OnEnable))] + public static class GameSettingMenuPatch + { + public static void Prefix(GameSettingMenu __instance) + { + // Unlocks map/impostor amount changing in online (for testing on your custom servers) + __instance.HideForOnline = new Il2CppReferenceArray(0); + } + } + + [HarmonyPatch(typeof(GameOptionsMenu), nameof(GameOptionsMenu.Start))] + [HarmonyPriority(Priority.First)] + public static class GameOptionsMenuPatch + { + public static void Postfix(GameOptionsMenu __instance) + { + __instance.Children + .Single(o => o.Title == StringNames.GameNumImpostors) + .Cast() + .ValidRange = new FloatRange(0, byte.MaxValue); + } + } } }