Unlock & improve hidden game options (#9)

This commit is contained in:
Galster-dev authored and GitHub committed 2021-02-07 16:20:32 +01:00
1 parent 27799cfdf4
commit 1dcb40a688
1 file changed
+26
+26
View File
@@ -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<DebuggerPlugin>.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<Transform>(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<NumberOption>()
.ValidRange = new FloatRange(0, byte.MaxValue);
}
}
}
}