mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-19 15:51:58 +00:00
20 lines
645 B
C#
20 lines
645 B
C#
using System.Text.RegularExpressions;
|
|
using HarmonyLib;
|
|
using UnityEngine;
|
|
|
|
namespace EHR;
|
|
|
|
[HarmonyPatch(typeof(JoinGameButton), nameof(JoinGameButton.OnClick))]
|
|
internal class JoinGameButtonPatch
|
|
{
|
|
public static void Prefix(JoinGameButton __instance)
|
|
{
|
|
if (__instance.GameIdText == null) return;
|
|
|
|
if (__instance.GameIdText.text == "" && Regex.IsMatch(GUIUtility.systemCopyBuffer.Trim('\r', '\n'), "^[A-Z]{6}$"))
|
|
{
|
|
Logger.Info($"{GUIUtility.systemCopyBuffer}", "ClipBoard");
|
|
__instance.GameIdText.SetText(GUIUtility.systemCopyBuffer.Trim('\r', '\n'));
|
|
}
|
|
}
|
|
} |