Skip to content

Commit 9592771

Browse files
committed
[+] disableDebugFeatureHotkeys
1 parent b1bb4af commit 9592771

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

AquaMai.Mods/Fix/DebugFeature.cs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public static void Init(GameProcess __instance, MovieController ____gameMovie, G
6262
_gameMovie = ____gameMovie;
6363
_monitors = ____monitors;
6464
PolyFill.timer = 0;
65+
PolyFill.isPause = false;
6566
}
6667

6768
public static void OnBeforePatch(HarmonyLib.Harmony h)
@@ -166,9 +167,10 @@ private static class PolyFill
166167
public static double timer;
167168
public static KeyCode Autoplay = SetAutoplay();
168169

169-
private static KeyCode SetAutoplay() {
170-
try {return (KeyCode)Enum.Parse(typeof(KeyCode), KeyMap.GetAutoplay());}
171-
catch (Exception) {return KeyCode.Home;}
170+
private static KeyCode SetAutoplay()
171+
{
172+
try { return (KeyCode)Enum.Parse(typeof(KeyCode), KeyMap.GetAutoplay()); }
173+
catch (Exception) { return KeyCode.Home; }
172174
}
173175

174176
public static void DebugTimeSkip(int addMsec)
@@ -218,6 +220,8 @@ public static void Postfix(byte ____sequence)
218220
timer += GameManager.GetGameMSecAddD();
219221
}
220222

223+
if (KeyMap.disableDebugFeatureHotkeys) return;
224+
221225
if (Input.GetKeyDown(Autoplay))
222226
{
223227
GameManager.AutoPlay = (GameManager.AutoPlayMode)((int)(GameManager.AutoPlay + 1) % Enum.GetNames(typeof(GameManager.AutoPlayMode)).Length);
@@ -242,10 +246,12 @@ public static void Postfix(byte ____sequence)
242246
num23 = 1000;
243247
}
244248

245-
int addMsec = ((!DebugInput.GetKey(KeyCode.LeftShift) && !DebugInput.GetKey(KeyCode.RightShift)) ? ((!DebugInput.GetKey(KeyCode.LeftControl) && !DebugInput.GetKey(KeyCode.RightControl)) ? num23 : (num23 * 10)) : (num23 * 5));
249+
int addMsec = ((!DebugInput.GetKey(KeyCode.LeftShift) && !DebugInput.GetKey(KeyCode.RightShift))
250+
? ((!DebugInput.GetKey(KeyCode.LeftControl) && !DebugInput.GetKey(KeyCode.RightControl)) ? num23 : (num23 * 10))
251+
: (num23 * 5));
246252
Singleton<GamePlayManager>.Instance.Initialize();
247253
DebugTimeSkip(addMsec);
248254
}
249255
}
250256
}
251-
}
257+
}

AquaMai.Mods/GameSystem/KeyMap.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@ 如果使用 IO4 模拟,你可以在 segatools.ini 的 [io4] 和 [button] 部
4646
""")]
4747
public static readonly bool disableDebugInput = false; // Implemented in AquaMai.Mods/Fix/Common.cs
4848

49+
[ConfigEntry(
50+
en: """
51+
Disable DebugFeature Polyfill hotkeys, like Enter to pause, Left/Right to seek, etc.
52+
""",
53+
zh: """
54+
禁用 DebugFeature Polyfill 的快捷键,比如说回车暂停,左右键快进快退等。
55+
""")]
56+
public static readonly bool disableDebugFeatureHotkeys = false; // Implemented in DebugFeature
57+
4958
[EnableIf(nameof(disableIO4))]
5059
[HarmonyPatch("IO.Jvs+JvsSwitch", ".ctor", MethodType.Constructor, [typeof(int), typeof(string), typeof(KeyCode), typeof(bool), typeof(bool)])]
5160
[HarmonyPrefix]

0 commit comments

Comments
 (0)