[+] QuickEndPlay button when notes play end
Build AquaMai / build (push) Has been cancelled Details

pull/69/head
Clansty 2024-10-16 01:01:32 +08:00
parent f716ab0c1b
commit 1810bbe2d5
No known key found for this signature in database
GPG Key ID: 3A6BE8BAF2EDE134
7 changed files with 79 additions and 0 deletions

View File

@ -125,6 +125,8 @@ SkipGameOverScreen=true
SkipTrackStart=true
# Show reason when net icon is gray
ShowNetErrorDetail=true
# Show a "skip" button like AstroDX after the notes end
ShowQuickEndPlay=true
[WindowState]
# If not enabled, no operations will be performed on the game window

View File

@ -144,6 +144,8 @@ IWontTapOrSlideVigorously=true
SkipGameOverScreen=true
# 跳过乐曲开始界面
SkipTrackStart=true
# 音符结束之后显示像 AstroDX 一样的“跳过”按钮
ShowQuickEndPlay=true
[WindowState]
# 不启用的话,不会对游戏窗口做任何操作

View File

@ -85,6 +85,7 @@ namespace AquaMai
public bool IWontTapOrSlideVigorously { get; set; }
public bool SkipGameOverScreen { get; set; }
public bool SkipTrackStart { get; set; }
public bool ShowQuickEndPlay { get; set; }
}
public class WindowStateConfig

View File

@ -215,6 +215,15 @@ namespace AquaMai.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Skip.
/// </summary>
internal static string Skip {
get {
return ResourceManager.GetString("Skip", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Speed.
/// </summary>

View File

@ -84,4 +84,7 @@
<data name="RatingUpWhenSSSp" xml:space="preserve">
<value>SSS+ =&gt; DXRating += {0}</value>
</data>
<data name="Skip" xml:space="preserve">
<value>Skip</value>
</data>
</root>

View File

@ -77,4 +77,7 @@
<data name="RatingUpWhenSSSp" xml:space="preserve">
<value>推到鸟加可上 {0} 分</value>
</data>
<data name="Skip" xml:space="preserve">
<value>跳过</value>
</data>
</root>

View File

@ -0,0 +1,59 @@
using System.Collections.Generic;
using AquaMai.Helpers;
using AquaMai.Resources;
using HarmonyLib;
using MAI2.Util;
using Manager;
using Monitor;
using Process;
using UnityEngine;
namespace AquaMai.TimeSaving;
public class ShowQuickEndPlay
{
private static bool _showUi;
[HarmonyPatch(typeof(GameProcess), "OnStart")]
[HarmonyPostfix]
public static void GameProcessPostStart(GameMonitor[] ____monitors)
{
_showUi = false;
____monitors[0].gameObject.AddComponent<Ui>();
}
[HarmonyPatch(typeof(GameProcess), "OnUpdate")]
[HarmonyPostfix]
public static void GameProcessPostUpdate(GameProcess __instance, Message[] ____message, ProcessDataContainer ___container, byte ____sequence)
{
if (____sequence > 4)
{
_showUi = true;
}
if (_showUi && (InputManager.GetTouchPanelAreaDown(InputManager.TouchPanelArea.B4) || InputManager.GetTouchPanelAreaDown(InputManager.TouchPanelArea.E4)))
{
var traverse = Traverse.Create(__instance);
___container.processManager.SendMessage(____message[0]);
Singleton<GamePlayManager>.Instance.SetSyncResult(0);
traverse.Method("SetRelease").GetValue();
}
}
private class Ui : MonoBehaviour
{
public void OnGUI()
{
if (!_showUi) return;
var style = GUI.skin.GetStyle("button");
style.fontSize = GuiSizes.FontSize;
var x = GuiSizes.PlayerCenter;
var y = Screen.height - GuiSizes.PlayerWidth * .37f;
var width = GuiSizes.PlayerWidth * .25f;
var height = GuiSizes.PlayerWidth * .13f;
GUI.Button(new Rect(x, y, width, height), Locale.Skip);
}
}
}