forked from Cookies_Github_mirror/AquaDX
[+] TouchToButtonInput On Aquamai (#58)
Co-authored-by: Clansty <i@gao4.pw>
This commit is contained in:
@@ -56,6 +56,8 @@ HideSelfMadeCharts=true
|
|||||||
CustomFont=false
|
CustomFont=false
|
||||||
# Provide the ability to use custom note skins (advanced feature)
|
# Provide the ability to use custom note skins (advanced feature)
|
||||||
CustomNoteSkin=false
|
CustomNoteSkin=false
|
||||||
|
# Map touch actions to buttons
|
||||||
|
TouchToButtonInput=false
|
||||||
# Delayed the animation of the song start screen
|
# Delayed the animation of the song start screen
|
||||||
# Hide "TRACK X" text and DX/Standard chart display box
|
# Hide "TRACK X" text and DX/Standard chart display box
|
||||||
# For recording chart confirmation
|
# For recording chart confirmation
|
||||||
|
|||||||
@@ -65,6 +65,8 @@ HideSelfMadeCharts=true
|
|||||||
CustomFont=false
|
CustomFont=false
|
||||||
# 提供自定义音符皮肤的能力(高级功能)
|
# 提供自定义音符皮肤的能力(高级功能)
|
||||||
CustomNoteSkin=false
|
CustomNoteSkin=false
|
||||||
|
# 映射触摸操作至实体按键
|
||||||
|
TouchToButtonInput=false
|
||||||
# 推迟了歌曲开始界面的动画
|
# 推迟了歌曲开始界面的动画
|
||||||
# 隐藏“TRACK X”字样和 DX/标准谱面的显示框
|
# 隐藏“TRACK X”字样和 DX/标准谱面的显示框
|
||||||
# 录制谱面确认用
|
# 录制谱面确认用
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ namespace AquaMai
|
|||||||
public bool HideSelfMadeCharts { get; set; }
|
public bool HideSelfMadeCharts { get; set; }
|
||||||
public bool CustomFont { get; set; }
|
public bool CustomFont { get; set; }
|
||||||
public bool CustomNoteSkin { get; set; }
|
public bool CustomNoteSkin { get; set; }
|
||||||
|
public bool TouchToButtonInput { get; set; }
|
||||||
public bool TrackStartProcessTweak { get; set; }
|
public bool TrackStartProcessTweak { get; set; }
|
||||||
public bool HideHanabi { get; set; }
|
public bool HideHanabi { get; set; }
|
||||||
public string CustomVersionString { get; set; } = "";
|
public string CustomVersionString { get; set; } = "";
|
||||||
|
|||||||
50
AquaMai/UX/TouchToButtonInput.cs
Normal file
50
AquaMai/UX/TouchToButtonInput.cs
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
using HarmonyLib;
|
||||||
|
using Manager;
|
||||||
|
using Process;
|
||||||
|
using static Manager.InputManager;
|
||||||
|
|
||||||
|
namespace AquaMai.UX;
|
||||||
|
|
||||||
|
public class TouchToButtonInput
|
||||||
|
{
|
||||||
|
private static bool _isPlaying = false;
|
||||||
|
|
||||||
|
[HarmonyPostfix]
|
||||||
|
[HarmonyPatch(typeof(GameProcess),"OnUpdate")]
|
||||||
|
public static void OnUpdate(GameProcess __instance)
|
||||||
|
{
|
||||||
|
var notesManager = new NotesManager();
|
||||||
|
_isPlaying = notesManager.IsPlaying();
|
||||||
|
}
|
||||||
|
|
||||||
|
[HarmonyPostfix]
|
||||||
|
[HarmonyPatch(typeof(Manager.InputManager), "GetButtonDown")]
|
||||||
|
public static void GetButtonDown(ref bool __result, int monitorId, ButtonSetting button)
|
||||||
|
{
|
||||||
|
if (_isPlaying || __result) return;
|
||||||
|
if (button.ToString().StartsWith("Button"))
|
||||||
|
{
|
||||||
|
__result = GetTouchPanelAreaDown(monitorId, (TouchPanelArea)button);
|
||||||
|
}
|
||||||
|
else if (button.ToString().Equals("Select"))
|
||||||
|
{
|
||||||
|
__result = GetTouchPanelAreaLongPush(monitorId, TouchPanelArea.C1, 500L) || GetTouchPanelAreaLongPush(monitorId, TouchPanelArea.C2, 500L);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[HarmonyPostfix]
|
||||||
|
[HarmonyPatch(typeof(Manager.InputManager), "GetButtonPush")]
|
||||||
|
public static void GetButtonPush(ref bool __result, int monitorId, ButtonSetting button)
|
||||||
|
{
|
||||||
|
if (_isPlaying || __result) return;
|
||||||
|
if (button.ToString().StartsWith("Button")) __result = GetTouchPanelAreaPush(monitorId, (TouchPanelArea)button);
|
||||||
|
}
|
||||||
|
|
||||||
|
[HarmonyPostfix]
|
||||||
|
[HarmonyPatch(typeof(Manager.InputManager), "GetButtonLongPush")]
|
||||||
|
public static void GetButtonLongPush(ref bool __result, int monitorId, ButtonSetting button, long msec)
|
||||||
|
{
|
||||||
|
if (_isPlaying || __result) return;
|
||||||
|
if (button.ToString().StartsWith("Button")) __result = GetTouchPanelAreaLongPush(monitorId, (TouchPanelArea)button, msec);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user