mirror of
https://github.com/MewoLab/AquaDX.git
synced 2026-02-13 05:27:58 +08:00
Merge branch 'v1-dev' of https://github.com/hykilpikonna/AquaDX into v1-dev
This commit is contained in:
@@ -266,8 +266,10 @@
|
|||||||
<Compile Include="Cheat\TicketUnlock.cs" />
|
<Compile Include="Cheat\TicketUnlock.cs" />
|
||||||
<Compile Include="Config.cs" />
|
<Compile Include="Config.cs" />
|
||||||
<Compile Include="Fix\FixCharaCrash.cs" />
|
<Compile Include="Fix\FixCharaCrash.cs" />
|
||||||
|
<Compile Include="Performance\ImproveLoadSpeed.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="Main.cs" />
|
<Compile Include="Main.cs" />
|
||||||
|
<Compile Include="UX\CustomVersionString.cs" />
|
||||||
<Compile Include="UX\SinglePlayer.cs" />
|
<Compile Include="UX\SinglePlayer.cs" />
|
||||||
<Compile Include="UX\SkipWarningScreen.cs" />
|
<Compile Include="UX\SkipWarningScreen.cs" />
|
||||||
<Compile Include="UX\SkipToMusicSelection.cs" />
|
<Compile Include="UX\SkipToMusicSelection.cs" />
|
||||||
|
|||||||
@@ -13,4 +13,11 @@ SkipWarningScreen=true
|
|||||||
# Single player: Show 1P only, at the center of the screen
|
# Single player: Show 1P only, at the center of the screen
|
||||||
SinglePlayer=true
|
SinglePlayer=true
|
||||||
# !!EXPERIMENTAL!! Skip from the card-scanning screen directly to music selection screen
|
# !!EXPERIMENTAL!! Skip from the card-scanning screen directly to music selection screen
|
||||||
SkipToMusicSelection=false
|
SkipToMusicSelection=false
|
||||||
|
# Set the version string displayed at the top-right corner of the screen
|
||||||
|
CustomVersionString=""
|
||||||
|
|
||||||
|
[Performance]
|
||||||
|
# Disable some useless checks and delays to speed up the game boot process
|
||||||
|
# !! Known issue: The game may crash if DX Pass scanning is enabled
|
||||||
|
ImproveLoadSpeed=false
|
||||||
@@ -7,6 +7,7 @@ namespace AquaMai
|
|||||||
{
|
{
|
||||||
public UXConfig UX { get; set; }
|
public UXConfig UX { get; set; }
|
||||||
public CheatConfig Cheat { get; set; }
|
public CheatConfig Cheat { get; set; }
|
||||||
|
public PerformanceConfig Performance { get; set; }
|
||||||
|
|
||||||
public class CheatConfig
|
public class CheatConfig
|
||||||
{
|
{
|
||||||
@@ -18,6 +19,12 @@ namespace AquaMai
|
|||||||
public bool SkipWarningScreen { get; set; }
|
public bool SkipWarningScreen { get; set; }
|
||||||
public bool SinglePlayer { get; set; }
|
public bool SinglePlayer { get; set; }
|
||||||
public bool SkipToMusicSelection { get; set; }
|
public bool SkipToMusicSelection { get; set; }
|
||||||
|
public string CustomVersionString { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class PerformanceConfig
|
||||||
|
{
|
||||||
|
public bool ImproveLoadSpeed { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using AquaMai.Fix;
|
using AquaMai.Fix;
|
||||||
|
using AquaMai.UX;
|
||||||
using MelonLoader;
|
using MelonLoader;
|
||||||
using Tomlet;
|
using Tomlet;
|
||||||
|
|
||||||
@@ -77,6 +78,7 @@ namespace AquaMai
|
|||||||
// Fixes that does not have side effects
|
// Fixes that does not have side effects
|
||||||
// These don't need to be configurable
|
// These don't need to be configurable
|
||||||
Patch(typeof(FixCharaCrash));
|
Patch(typeof(FixCharaCrash));
|
||||||
|
Patch(typeof(CustomVersionString));
|
||||||
|
|
||||||
MelonLogger.Msg("Loaded!");
|
MelonLogger.Msg("Loaded!");
|
||||||
}
|
}
|
||||||
|
|||||||
63
AquaMai/Performance/ImproveLoadSpeed.cs
Normal file
63
AquaMai/Performance/ImproveLoadSpeed.cs
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
using System.Diagnostics;
|
||||||
|
using HarmonyLib;
|
||||||
|
using MAI2.Util;
|
||||||
|
using Manager;
|
||||||
|
using Process;
|
||||||
|
|
||||||
|
namespace AquaMai.Performance
|
||||||
|
{
|
||||||
|
public class ImproveLoadSpeed
|
||||||
|
{
|
||||||
|
[HarmonyPrefix]
|
||||||
|
[HarmonyPatch(typeof(PowerOnProcess), "OnUpdate")]
|
||||||
|
public static bool PrePowerOnUpdate(PowerOnProcess __instance)
|
||||||
|
{
|
||||||
|
var traverse = Traverse.Create(__instance);
|
||||||
|
var state = traverse.Field("_state").GetValue<byte>();
|
||||||
|
switch (state)
|
||||||
|
{
|
||||||
|
case 3:
|
||||||
|
traverse.Field("_state").SetValue((byte)4);
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
case 6:
|
||||||
|
case 7:
|
||||||
|
traverse.Field("_state").SetValue((byte)8);
|
||||||
|
break;
|
||||||
|
case 9:
|
||||||
|
traverse.Field("_state").SetValue((byte)10);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
[HarmonyPrefix]
|
||||||
|
[HarmonyPatch(typeof(StartupProcess), "OnUpdate")]
|
||||||
|
public static bool PreStartupUpdate(StartupProcess __instance)
|
||||||
|
{
|
||||||
|
var traverse = Traverse.Create(__instance);
|
||||||
|
var state = traverse.Field("_state").GetValue<byte>();
|
||||||
|
switch (state)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
traverse.Field("_state").SetValue((byte)1);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
// AimeReader maybe typeof AimeReaderManager or ChimeReaderManager, must build with correct Assembly-CSharp.dll in Libs folder
|
||||||
|
if(SingletonStateMachine<AmManager, AmManager.EState>.Instance.AimeReader.GetType().FullName == "Manager.AimeReaderManager")
|
||||||
|
traverse.Field("_state").SetValue((byte)3);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
traverse.Field("_state").SetValue((byte)5);
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
var timer = traverse.Field("timer").GetValue<Stopwatch>();
|
||||||
|
Traverse.Create(timer).Field("elapsed").SetValue(2 * 10000000L);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
24
AquaMai/UX/CustomVersionString.cs
Normal file
24
AquaMai/UX/CustomVersionString.cs
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
using HarmonyLib;
|
||||||
|
|
||||||
|
namespace AquaMai.UX
|
||||||
|
{
|
||||||
|
public class CustomVersionString
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Patch displayVersionString Property Getter
|
||||||
|
*/
|
||||||
|
[HarmonyPrefix]
|
||||||
|
[HarmonyPatch(typeof(MAI2System.Config), "displayVersionString", MethodType.Getter)]
|
||||||
|
public static bool GetDisplayVersionString(ref string __result)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(AquaMai.AppConfig.UX.CustomVersionString))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
__result = AquaMai.AppConfig.UX.CustomVersionString;
|
||||||
|
// Return false to block the original method
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user