mirror of
https://github.com/NuclearPowered/Reactor.git
synced 2026-10-19 15:51:54 +00:00
Unlock & improve hidden game options (#9)
This commit is contained in:
1 parent
27799cfdf4
commit
1dcb40a688
1 file changed
+26
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user