diff --git a/Reactor/Patches/BetterGuestPatch.cs b/Reactor/Patches/BetterGuestPatch.cs index e326b4e..f6b3615 100644 --- a/Reactor/Patches/BetterGuestPatch.cs +++ b/Reactor/Patches/BetterGuestPatch.cs @@ -1,5 +1,6 @@ using HarmonyLib; using InnerNet; +using UnityEngine; namespace Reactor.Patches { @@ -14,5 +15,25 @@ namespace Reactor.Patches return false; } } + + [HarmonyPatch(typeof(AccountTab), nameof(AccountTab.Open))] + public static class EditNamePatch + { + public static void Prefix(AccountTab __instance) + { + Fix(__instance, __instance.guestMode); + Fix(__instance, __instance.offlineMode); + } + + private static void Fix(AccountTab __instance, GameObject mode) + { + var randomizeName = mode.transform.Find("RandomizeName").gameObject; + if (!randomizeName.active) + return; + + randomizeName.active = false; + Object.Instantiate(__instance.loggedInMode.editNameButton, mode.transform); + } + } } }