From 2ef8219f15d32eab914bf0bb1810d8d4898f7ea3 Mon Sep 17 00:00:00 2001 From: Clansty Date: Sun, 26 May 2024 13:21:03 +0800 Subject: [PATCH] [F] Skip Event Info --- AquaMai/Config.cs | 1 + AquaMai/UX/SkipEventInfo.cs | 31 ++++-------------------------- AquaMai/UX/SkipToMusicSelection.cs | 2 -- 3 files changed, 5 insertions(+), 29 deletions(-) diff --git a/AquaMai/Config.cs b/AquaMai/Config.cs index cf07b56c..e340fdc4 100644 --- a/AquaMai/Config.cs +++ b/AquaMai/Config.cs @@ -26,6 +26,7 @@ namespace AquaMai public bool RandomBgm { get; set; } public bool DemoMaster { get; set; } public bool ExtendTimer { get; set; } + public bool SkipEventInfo { get; set; } public string CustomVersionString { get; set; } public string ExecOnIdle { get; set; } public string ExecOnEntry { get; set; } diff --git a/AquaMai/UX/SkipEventInfo.cs b/AquaMai/UX/SkipEventInfo.cs index 330cfbdc..4b2ea4be 100644 --- a/AquaMai/UX/SkipEventInfo.cs +++ b/AquaMai/UX/SkipEventInfo.cs @@ -1,38 +1,15 @@ using HarmonyLib; -using MelonLoader; -using Monitor.Information; -using UnityEngine.Assertions; +using Process.Information; namespace AquaMai.UX { public class SkipEventInfo { - // public override void Initialize(int monIndex, bool active) - // Postfix: Set this.state to DispState.End [HarmonyPostfix] - [HarmonyPatch(typeof(InformationMonitor), "Initialize", new []{typeof(int), typeof(bool)})] - public static void Initialize(InformationMonitor __instance, int monIndex, bool active) + [HarmonyPatch(typeof(InformationProcess), "OnStart")] + public static void InformationProcessPreStart(ref uint ____state) { - // State is private, cannot access directly - // __instance.state = InformationMonitor.DispState.End; - - // Use reflection to set the state - // var stateField = typeof(InformationMonitor).GetField("state", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); - // if (stateField == null) - // { - // MelonLogger.Msg("Failed to get state field"); - // return; - // } - // stateField.SetValue(__instance, InformationMonitor.DispState.End); - - // Use reflection to set _dispTime to 0 - var dispTimeField = typeof(InformationMonitor).GetField("_dispTime", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); - if (dispTimeField == null) - { - MelonLogger.Msg("Failed to get _dispTime field"); - return; - } - dispTimeField.SetValue(__instance, 0); + ____state = 3; } } } \ No newline at end of file diff --git a/AquaMai/UX/SkipToMusicSelection.cs b/AquaMai/UX/SkipToMusicSelection.cs index 2be1a99f..7f73b439 100644 --- a/AquaMai/UX/SkipToMusicSelection.cs +++ b/AquaMai/UX/SkipToMusicSelection.cs @@ -1,8 +1,6 @@ using HarmonyLib; using MAI2.Util; using Manager; -using Manager.UserDatas; -using MelonLoader; using Monitor; using Process; using Process.Information;