[+] AquaMai: Skip event and info screen for new users

pull/34/head
Azalea 2024-05-08 21:47:36 +08:00
parent 7992568c0f
commit fb72317c6f
4 changed files with 42 additions and 0 deletions

View File

@ -275,6 +275,7 @@
<Compile Include="UX\LoadAssetBundleWithoutManifest.cs" />
<Compile Include="UX\QuickSkip.cs" />
<Compile Include="UX\SinglePlayer.cs" />
<Compile Include="UX\SkipEventInfo.cs" />
<Compile Include="UX\SkipWarningScreen.cs" />
<Compile Include="UX\SkipToMusicSelection.cs" />
</ItemGroup>

View File

@ -22,6 +22,8 @@ LoadJacketPng=true
QuickSkip=true
# Add ".ab" image resources without the need of rebuilding a manifest
LoadAssetBundleWithoutManifest=true
# Skip "New Event" and "Information" text boxes for new users
SkipEventInfo=true
[Performance]
# Disable some useless delays to speed up the game boot process

View File

@ -16,6 +16,7 @@ This mod is heavily WIP. More details will be added as the development progresse
* Disable daily automatic reboot
* Customize version text
* Skip the current song by holding 7
* Skip "new event" and "information" screen for new players.
**Bug Fixes**

View File

@ -0,0 +1,38 @@
using HarmonyLib;
using MelonLoader;
using Monitor.Information;
using UnityEngine.Assertions;
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)
{
// 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);
}
}
}