Skip to content

Commit

Permalink
[O] Show quick skip after 1sec
Browse files Browse the repository at this point in the history
  • Loading branch information
clansty committed Nov 16, 2024
1 parent cd075a3 commit 29bb54d
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions AquaMai/TimeSaving/ShowQuickEndPlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,34 @@ namespace AquaMai.TimeSaving;

public class ShowQuickEndPlay
{
private static bool _showUi;
private static int _timer;

[HarmonyPatch(typeof(GameProcess), "OnStart")]
[HarmonyPostfix]
public static void GameProcessPostStart(GameMonitor[] ____monitors)
{
_showUi = false;
_timer = 0;
____monitors[0].gameObject.AddComponent<Ui>();
}

[HarmonyPatch(typeof(GameProcess), "OnUpdate")]
[HarmonyPostfix]
public static void GameProcessPostUpdate(GameProcess __instance, Message[] ____message, ProcessDataContainer ___container, byte ____sequence)
{
_showUi = ____sequence switch
switch (____sequence)
{
9 => false,
> 4 => true,
_ => false
};
case 9:
_timer = 0;
break;
case > 4:
_timer++;
break;
default:
_timer = 0;
break;
}

if (_showUi && (InputManager.GetTouchPanelAreaDown(InputManager.TouchPanelArea.B4) || InputManager.GetTouchPanelAreaDown(InputManager.TouchPanelArea.E4)))
if (_timer > 60 && (InputManager.GetTouchPanelAreaDown(InputManager.TouchPanelArea.B4) || InputManager.GetTouchPanelAreaDown(InputManager.TouchPanelArea.E4)))
{
var traverse = Traverse.Create(__instance);
___container.processManager.SendMessage(____message[0]);
Expand All @@ -46,7 +52,7 @@ private class Ui : MonoBehaviour
{
public void OnGUI()
{
if (!_showUi) return;
if (_timer < 60) return;

// 这里重新 setup 一下 style 也可以
var x = GuiSizes.PlayerCenter;
Expand Down

0 comments on commit 29bb54d

Please sign in to comment.