Skip to content

Commit 0a1a045

Browse files
authored
[+] add Home to KeyMap (#35)
* add Home to KeyMap * use KeyCodeID for ConfigEntry * change home to autoplay
1 parent 7e02805 commit 0a1a045

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

AquaMai.Mods/Fix/DebugFeature.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Reflection;
33
using AquaMai.Config.Attributes;
4+
using AquaMai.Mods.GameSystem;
45
using HarmonyLib;
56
using MAI2.Util;
67
using Manager;
@@ -163,6 +164,12 @@ private static class PolyFill
163164
{
164165
public static bool isPause;
165166
public static double timer;
167+
public static KeyCode Autoplay = SetAutoplay();
168+
169+
private static KeyCode SetAutoplay() {
170+
try {return (KeyCode)Enum.Parse(typeof(KeyCode), KeyMap.GetAutoplay());}
171+
catch (Exception) {return KeyCode.Home;}
172+
}
166173

167174
public static void DebugTimeSkip(int addMsec)
168175
{
@@ -211,7 +218,7 @@ public static void Postfix(byte ____sequence)
211218
timer += GameManager.GetGameMSecAddD();
212219
}
213220

214-
if (Input.GetKeyDown(KeyCode.Home))
221+
if (Input.GetKeyDown(Autoplay))
215222
{
216223
GameManager.AutoPlay = (GameManager.AutoPlayMode)((int)(GameManager.AutoPlay + 1) % Enum.GetNames(typeof(GameManager.AutoPlayMode)).Length);
217224
}

AquaMai.Mods/GameSystem/KeyMap.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,11 @@ public static bool PreGetHasOnNow(ref bool __result)
132132
[ConfigEntry]
133133
private static readonly KeyCodeID Select_2P = (KeyCodeID)84;
134134

135+
[ConfigEntry]
136+
private static readonly KeyCodeID Autoplay = (KeyCodeID)94;
137+
138+
public static string GetAutoplay() {return Autoplay.ToString();}
139+
135140
[HarmonyPatch(typeof(DB.JvsButtonTableRecord), MethodType.Constructor, typeof(int), typeof(string), typeof(string), typeof(int), typeof(string), typeof(int), typeof(int), typeof(int))]
136141
[HarmonyPostfix]
137142
public static void JvsButtonTableRecordConstructor(DB.JvsButtonTableRecord __instance, string Name)

0 commit comments

Comments
 (0)