mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 00:02:54 +08:00
Internalize both looping and stopping
This commit is contained in:
parent
1d314a1f4b
commit
7e4f58c2d3
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user