Skip to content

Commit efefa5a

Browse files
committed
add Home to KeyMap
1 parent cc2c9aa commit efefa5a

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;
@@ -131,6 +132,12 @@ private static class PolyFill
131132
{
132133
public static bool isPause;
133134
public static double timer;
135+
public static KeyCode Home = SetHome();
136+
137+
private static KeyCode SetHome() {
138+
try {return (KeyCode)Enum.Parse(typeof(KeyCode), KeyMap.GetHome());}
139+
catch (Exception) {return KeyCode.Home;}
140+
}
134141

135142
public static void DebugTimeSkip(int addMsec)
136143
{
@@ -179,7 +186,7 @@ public static void Postfix(byte ____sequence)
179186
timer += GameManager.GetGameMSecAddD();
180187
}
181188

182-
if (Input.GetKeyDown(KeyCode.Home))
189+
if (Input.GetKeyDown(Home))
183190
{
184191
GameManager.AutoPlay = (GameManager.AutoPlayMode)((int)(GameManager.AutoPlay + 1) % Enum.GetNames(typeof(GameManager.AutoPlayMode)).Length);
185192
}

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 string Home = "Home";
137+
138+
public static string GetHome() {return Home;}
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)