mirror of
https://github.com/ppy/osu.git
synced 2026-05-26 14:30:46 +08:00
Internalize both looping and stopping
This commit is contained in:
@@ -87,9 +87,6 @@ namespace osu.Game.Screens.Edit.Components
|
||||
|
||||
private void togglePause()
|
||||
{
|
||||
if ((adjustableClock as EditorClock)?.PlaybackFinished == true)
|
||||
adjustableClock.Seek(0);
|
||||
|
||||
if (adjustableClock.IsRunning)
|
||||
adjustableClock.Stop();
|
||||
else
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace osu.Game.Screens.Edit
|
||||
|
||||
private readonly BindableBeatDivisor beatDivisor;
|
||||
|
||||
public bool PlaybackFinished { get; private set; }
|
||||
private bool playbackFinished;
|
||||
|
||||
public EditorClock(WorkingBeatmap beatmap, BindableBeatDivisor beatDivisor)
|
||||
{
|
||||
@@ -43,17 +43,19 @@ namespace osu.Game.Screens.Edit
|
||||
{
|
||||
base.ProcessFrame();
|
||||
|
||||
if (CurrentTime >= TrackLength)
|
||||
var playbackAlreadyStopped = playbackFinished;
|
||||
playbackFinished = CurrentTime >= TrackLength;
|
||||
|
||||
if (playbackFinished && IsRunning)
|
||||
{
|
||||
if (!PlaybackFinished)
|
||||
if (!playbackAlreadyStopped)
|
||||
{
|
||||
PlaybackFinished = true;
|
||||
Stop();
|
||||
Seek(TrackLength);
|
||||
}
|
||||
else
|
||||
Seek(0);
|
||||
}
|
||||
else
|
||||
PlaybackFinished = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user