Skip to content

Commit

Permalink
添加 ChartTimer记录点功能
Browse files Browse the repository at this point in the history
  • Loading branch information
WYH2004-MC committed Oct 13, 2024
1 parent f46b347 commit da927f9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 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 = "5bf972e";
public const string BuildDate = "2024-10-13T16:13:38.0560559+08:00";
public const string CommitHash = "559ffc9";
public const string BuildDate = "2024-10-14T02:30:34.8634970+08:00";
}
}
12 changes: 10 additions & 2 deletions Cheat/ChartTimer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,14 @@ public enum Button
TimeSkipAdd3,
TimeSkipSub,
TimeSkipSub2,
TimeSkipSub3
TimeSkipSub3,
Back
}

public static Button ButtonStatus = Button.None;
public static bool IsPlaying = false;
public static double Timer = 0.0;
public static int recordTime = 0;
private static MovieController gameMovie;
private static NotesManager notesManager;
private static GameProcess gameProcess;
Expand All @@ -63,6 +65,7 @@ private static void OnUpdate(GameProcess __instance)
{
IsPlaying = true;
Timer = 0.0;
recordTime = 0;
}
if (sequence == GameSequence.Play)
{
Expand Down Expand Up @@ -123,7 +126,12 @@ private static void OnUpdate(GameProcess __instance)
TimeSkip(-2500);
break;
case Button.Reset:
TimeSkip(-999999);
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
7 changes: 6 additions & 1 deletion GUI/ChartTimerPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,16 @@ public static void OnGUI()
if (GUILayout.Button(">>>", buttonStyle, GUILayout.Height(45f))) ChartTimer.ButtonStatus = ChartTimer.Button.TimeSkipAdd3;
GUILayout.EndHorizontal();
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("Back")) ChartTimer.ButtonStatus = ChartTimer.Button.Back;
GUILayout.EndHorizontal();
GUILayout.Label(
"While paused, you can use the LeftArrow and RightArrow keys to perform small range fast forward or rewind.",
new GUIStyle(MainGUI.Style.Text)
{
fontSize = 12,
fontSize = 11,
wordWrap = true
}
);
Expand Down

0 comments on commit da927f9

Please sign in to comment.