mirror of https://github.com/hykilpikonna/AquaDX
[+] Support official quick retry (3456) in UX/QuickSkip
Merge pull request #60 * Official quick retrypull/58/head^2
parent
81e0232712
commit
cdfb86e021
|
@ -26,6 +26,7 @@ LoadAssetsPng=true
|
||||||
# Use together with `LoadJacketPng`
|
# Use together with `LoadJacketPng`
|
||||||
LoadLocalBga=true
|
LoadLocalBga=true
|
||||||
# Press key "7" for 1 second to skip to next step or restart current song
|
# Press key "7" for 1 second to skip to next step or restart current song
|
||||||
|
# Hold the bottom four buttons (3456) for official quick retry (non-utage only)
|
||||||
QuickSkip=true
|
QuickSkip=true
|
||||||
# Add ".ab" image resources without the need of rebuilding a manifest
|
# Add ".ab" image resources without the need of rebuilding a manifest
|
||||||
LoadAssetBundleWithoutManifest=true
|
LoadAssetBundleWithoutManifest=true
|
||||||
|
|
|
@ -33,6 +33,7 @@ LoadLocalBga=true
|
||||||
# - 在选歌界面直接结束游戏
|
# - 在选歌界面直接结束游戏
|
||||||
# 在游玩界面,按一下 “7” 或者 Service 键重开当前的歌,按 1P 的“选择”键立即结束当前乐曲
|
# 在游玩界面,按一下 “7” 或者 Service 键重开当前的歌,按 1P 的“选择”键立即结束当前乐曲
|
||||||
# 打完最后一个音符之后也可以
|
# 打完最后一个音符之后也可以
|
||||||
|
# 按住下方四个按钮(3456)使用官方快速重开(仅对非宴谱有效)
|
||||||
QuickSkip=true
|
QuickSkip=true
|
||||||
# 优化图片资源的加载,就算没有 AssetBundleImages.manifest 也可以正常加载 ab 格式的图片资源
|
# 优化图片资源的加载,就算没有 AssetBundleImages.manifest 也可以正常加载 ab 格式的图片资源
|
||||||
# 导入了删除曲包之类的话,应该需要开启这个
|
# 导入了删除曲包之类的话,应该需要开启这个
|
||||||
|
|
|
@ -6,6 +6,7 @@ using MAI2.Util;
|
||||||
using Main;
|
using Main;
|
||||||
using Manager;
|
using Manager;
|
||||||
using MelonLoader;
|
using MelonLoader;
|
||||||
|
using Monitor;
|
||||||
using Process;
|
using Process;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
|
@ -84,5 +85,33 @@ namespace AquaMai.UX
|
||||||
Singleton<GamePlayManager>.Instance.SetQuickRetryFrag(flag: true);
|
Singleton<GamePlayManager>.Instance.SetQuickRetryFrag(flag: true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HarmonyPrefix]
|
||||||
|
[HarmonyPatch(typeof(QuickRetry), "IsQuickRetryEnable")]
|
||||||
|
public static bool OnQuickRetryIsQuickRetryEnable(ref bool __result)
|
||||||
|
{
|
||||||
|
var isUtageProperty = Traverse.Create(typeof(GameManager)).Property("IsUtage");
|
||||||
|
__result = !isUtageProperty.PropertyExists() || !isUtageProperty.GetValue<bool>();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fix for the game not resetting Fast and Late counts when quick retrying
|
||||||
|
// For game version < 1.35.0
|
||||||
|
[HarmonyPostfix]
|
||||||
|
[HarmonyPatch(typeof(GamePlayManager), "SetQuickRetryFrag")]
|
||||||
|
public static void PostGamePlayManagerSetQuickRetryFrag(GamePlayManager __instance, bool flag)
|
||||||
|
{
|
||||||
|
// Since 1.35.0, `GameScoreList.Initialize()` resets the Fast and Late counts
|
||||||
|
if (flag && !Traverse.Create(typeof(GameScoreList)).Methods().Contains("Initialize"))
|
||||||
|
{
|
||||||
|
for (int i = 0; i < 4; i++)
|
||||||
|
{
|
||||||
|
var gameScoreList = __instance.GetGameScore(i);
|
||||||
|
var traverse = Traverse.Create(gameScoreList);
|
||||||
|
traverse.Property("Fast").SetValue((uint)0);
|
||||||
|
traverse.Property("Late").SetValue((uint)0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue