Skip to content

Commit

Permalink
[+] AutoSkip setting for GameSystem.SinglePlayer
Browse files Browse the repository at this point in the history
  • Loading branch information
clansty committed Dec 4, 2024
1 parent 3d36005 commit f535e19
Showing 1 changed file with 27 additions and 22 deletions.
49 changes: 27 additions & 22 deletions AquaMai.Mods/GameSystem/SinglePlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,32 +51,37 @@ public static bool IsPointInPolygon(Vector2[] polygon, ref Vector2 point, MeshBu
return false;
}

[ConfigEntry(
en: "Automatically skip the countdown when logging in with a card in single-player mode.",
zh: "单人模式下刷卡登录直接进入下一个界面,无需跳过倒计时")]
public static bool autoSkip = true;

[EnableGameVersion(21500, noWarn: true)]
public class SkipTimer
[EnableIf(nameof(autoSkip))]
[HarmonyPostfix]
[HarmonyPatch(typeof(EntryMonitor), "DecideEntry")]
public static void PostDecideEntry(EntryMonitor __instance)
{
[HarmonyPostfix]
[HarmonyPatch(typeof(EntryMonitor), "DecideEntry")]
public static void PostDecideEntry(EntryMonitor __instance)
{
# if DEBUG
MelonLogger.Msg("Confirm Entry");
MelonLogger.Msg("Confirm Entry");
# endif
TimeManager.MarkGameStartTime();
Singleton<EventManager>.Instance.UpdateEvent();
Singleton<ScoreRankingManager>.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();
}
TimeManager.MarkGameStartTime();
Singleton<EventManager>.Instance.UpdateEvent();
Singleton<ScoreRankingManager>.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;
}
// To prevent the "長押受付終了" overlay from appearing
[EnableGameVersion(21500, noWarn: true)]
[EnableIf(nameof(autoSkip))]
[HarmonyPrefix]
[HarmonyPatch(typeof(WaitPartner), "Open")]
public static bool WaitPartnerPreOpen()
{
return false;
}

[ConfigEntry(
Expand Down Expand Up @@ -111,4 +116,4 @@ public static void OnAfterPatch()
{
Core.Helpers.GuiSizes.SinglePlayer = true;
}
}
}

0 comments on commit f535e19

Please sign in to comment.