Skip to content

Commit

Permalink
修改 ChartTimer快捷键添加
Browse files Browse the repository at this point in the history
  • Loading branch information
WYH2004-MC committed Oct 20, 2024
1 parent 716617a commit a0db14f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
4 changes: 2 additions & 2 deletions BuildInfo.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace SinmaiAssist {
public static partial class BuildInfo {
public const string CommitHash = "8425bd0";
public const string BuildDate = "2024-10-18T15:40:17.6707799+08:00";
public const string CommitHash = "c309880";
public const string BuildDate = "2024-10-21T01:49:23.4866521+08:00";
}
}
20 changes: 14 additions & 6 deletions Cheat/ChartTimer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public enum Button
TimeSkipSub,
TimeSkipSub2,
TimeSkipSub3,
Set,
Back
}

Expand Down Expand Up @@ -102,7 +103,19 @@ private static void OnUpdate(GameProcess __instance)
Singleton<GamePlayManager>.Instance.Initialize(IsPartyPlay);
TimeSkip(16);
}
else if (ButtonStatus != Button.None && ButtonStatus != Button.Pause)
else if (DebugInput.GetKeyDown(KeyCode.DownArrow) || ButtonStatus == Button.Set)
{
recordTime = (int)Timer;
MelonLogger.Msg($"Record Time: {recordTime}");
}
else if (DebugInput.GetKeyDown(KeyCode.UpArrow) || ButtonStatus == Button.Back)
{
int time = recordTime == 0 ? -999999 : -(int)Timer - recordTime;
TimeSkip(time);
TimeSkip(0);
MelonLogger.Msg($"Time Jump: {recordTime}({time})");
}
else if (ButtonStatus != Button.None)
{
Singleton<GamePlayManager>.Instance.Initialize(IsPartyPlay);
switch (ButtonStatus)
Expand All @@ -128,11 +141,6 @@ private static void OnUpdate(GameProcess __instance)
case Button.Reset:
Singleton<GamePlayManager>.Instance.SetQuickRetryFrag(flag: true);
break;
case Button.Back:
int time = recordTime == 0 ? 999999 : (int)Timer - recordTime;
TimeSkip(-time);
TimeSkip(0);
break;
default:
break;
}
Expand Down
2 changes: 1 addition & 1 deletion GUI/ChartTimerPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static void OnGUI()
if (GUILayout.Button("Reset", buttonStyle, GUILayout.Height(45f))) ChartTimer.ButtonStatus = ChartTimer.Button.Reset;
GUILayout.Label($"RecordTime: {ChartTimer.recordTime.ToString("0000000")}({-((int)ChartTimer.Timer - ChartTimer.recordTime)})", MainGUI.Style.Text);
GUILayout.BeginHorizontal();
if (GUILayout.Button("Set")) ChartTimer.recordTime = (int) ChartTimer.Timer;
if (GUILayout.Button("Set")) ChartTimer.ButtonStatus = ChartTimer.Button.Set;
if (GUILayout.Button("Back")) ChartTimer.ButtonStatus = ChartTimer.Button.Back;
GUILayout.EndHorizontal();
GUILayout.Label(
Expand Down

0 comments on commit a0db14f

Please sign in to comment.