From e55d17fd08f559a153100429842a0e7ce1b617ee Mon Sep 17 00:00:00 2001 From: Clansty Date: Sun, 26 May 2024 09:40:24 +0800 Subject: [PATCH] [+] Skip the wait progress after one player login in 1p mode --- AquaMai/UX/SinglePlayer.cs | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/AquaMai/UX/SinglePlayer.cs b/AquaMai/UX/SinglePlayer.cs index f2f18ccd..84c09252 100644 --- a/AquaMai/UX/SinglePlayer.cs +++ b/AquaMai/UX/SinglePlayer.cs @@ -1,6 +1,12 @@ -using System; using HarmonyLib; +using MAI2.Util; +using Manager; +using MelonLoader; +using Monitor.Common; +using Monitor.Entry; +using Monitor.Entry.Parts.Screens; using UnityEngine; +using Type = System.Type; namespace AquaMai.UX { @@ -26,5 +32,27 @@ namespace AquaMai.UX __result = RectTransformUtility.RectangleContainsScreenPoint(__instance.GetComponent(), point, Camera.main); return false; } + + [HarmonyPostfix] + [HarmonyPatch(typeof(EntryMonitor), "DecideEntry")] + public static void PostDecideEntry(EntryMonitor __instance) + { + MelonLogger.Msg("Confirm Entry"); + TimeManager.MarkGameStartTime(); + Singleton.Instance.UpdateEvent(); + Singleton.Instance.UpdateData(); + __instance.Process.CreateDownloadProcess(); + __instance.ProcessManager.SendMessage(new Message(ProcessType.CommonProcess, 30001)); + __instance.ProcessManager.SendMessage(new Message(ProcessType.CommonProcess, 40000, 0, OperationInformationController.InformationType.Hide)); + __instance.Process.SetNextProcess(); + } + + // To prevent the "長押受付終了" overlay from appearing + [HarmonyPrefix] + [HarmonyPatch(typeof(WaitPartner), "Open")] + public static bool WaitPartnerPreOpen() + { + return false; + } } } \ No newline at end of file