mirror of
https://github.com/NuclearPowered/Reactor.git
synced 2026-10-19 15:51:54 +00:00
Allow to change name always
This commit is contained in:
1 file changed
+21
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user