@@ -8,15 +8,15 @@ namespace AquaMai.Mods.GameSystem;
88
99[ ConfigSection (
1010 name : "快速重开" ,
11- en : "Hold the bottom four buttons (3456) for quick retry (like in Freedom Mode, default non-utage only). Also works when Freedom Mode time runs out. " ,
12- zh : "按住下方四个按钮(3456)快速重开本局游戏(像在 Freedom Mode 中一样,默认仅对非宴谱有效)。自由模式时间用完后也可使用 " ) ]
11+ en : "Hold the bottom four buttons (3456) for quick retry (like in Freedom Mode, default non-utage only)." ,
12+ zh : "按住下方四个按钮(3456)快速重开本局游戏(像在 Freedom Mode 中一样,默认仅对非宴谱有效)" ) ]
1313[ EnableGameVersion ( 23000 ) ]
1414public class QuickRetry
1515{
1616 [ ConfigEntry (
1717 name : "更快触发" ,
18- en : "Instant quick retry on simultaneous 4-button press ." ,
19- zh : "四键同时按下即刻触发快速重开 " ) ]
18+ en : "Make quick retry faster ." ,
19+ zh : "将长按时间修改为 0.5 秒 " ) ]
2020 private static readonly bool quickerRetry = false ;
2121
2222 [ ConfigEntry (
@@ -44,40 +44,9 @@ public static bool OnQuickRetryIsQuickRetryEnable(ref bool __result)
4444 [ HarmonyPostfix ]
4545 [ HarmonyPatch ( typeof ( Monitor . QuickRetry ) , "Execute" ) ]
4646 [ EnableIf ( nameof ( quickerRetry ) ) ]
47- public static void ExecutePostfix ( bool ____execQuickRetry , bool ____quickRetryTrigger )
47+ public static void ExecutePostfix ( double ____pushTimer )
4848 {
49- if ( ____execQuickRetry ) return ;
50- if ( ! ____quickRetryTrigger ) return ;
49+ if ( ____pushTimer < 500 ) return ;
5150 Singleton < GamePlayManager > . Instance . SetQuickRetryFrag ( flag : true ) ;
5251 }
53-
54- // Allow quick retry even when Freedom Mode time runs out.
55- // Hook GetFreedomModeMSec to return a fake positive value when called from Execute,
56- // so the original timer/countdown/sound logic proceeds normally.
57- private static bool _inQuickRetryExecute ;
58-
59- [ HarmonyPrefix ]
60- [ HarmonyPatch ( typeof ( Monitor . QuickRetry ) , "Execute" ) ]
61- public static void PreExecute ( )
62- {
63- _inQuickRetryExecute = true ;
64- }
65-
66- [ HarmonyPostfix ]
67- [ HarmonyPatch ( typeof ( Monitor . QuickRetry ) , "Execute" ) ]
68- public static void PostExecute ( )
69- {
70- _inQuickRetryExecute = false ;
71- }
72-
73- // Return 120000 to also bypass the long music check (IsLongMusic && startTime < 120000).
74- [ HarmonyPostfix ]
75- [ HarmonyPatch ( typeof ( GameManager ) , "GetFreedomModeMSec" ) ]
76- public static void OnGetFreedomModeMSec ( ref long __result )
77- {
78- if ( _inQuickRetryExecute && __result <= 0 )
79- {
80- __result = 120000 ;
81- }
82- }
8352}
0 commit comments