mirror of
https://github.com/osukey/osukey.git
synced 2025-08-02 14:17:06 +09:00
Only set initial source in Reset()
This commit is contained in:
@ -29,17 +29,22 @@ namespace osu.Game.Screens.Play
|
||||
/// </summary>
|
||||
protected readonly DecoupleableInterpolatingFramedClock AdjustableSource;
|
||||
|
||||
/// <summary>
|
||||
/// The source clock.
|
||||
/// </summary>
|
||||
protected IClock SourceClock { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="GameplayClockContainer"/>.
|
||||
/// </summary>
|
||||
/// <param name="sourceClock">The source <see cref="IClock"/> used for timing.</param>
|
||||
protected GameplayClockContainer(IClock sourceClock)
|
||||
{
|
||||
SourceClock = sourceClock;
|
||||
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
|
||||
AdjustableSource = new DecoupleableInterpolatingFramedClock { IsCoupled = false };
|
||||
AdjustableSource.ChangeSource(sourceClock);
|
||||
|
||||
IsPaused.BindValueChanged(OnIsPausedChanged);
|
||||
}
|
||||
|
||||
@ -86,6 +91,8 @@ namespace osu.Game.Screens.Play
|
||||
/// </summary>
|
||||
public virtual void Reset()
|
||||
{
|
||||
ChangeSource(SourceClock);
|
||||
|
||||
AdjustableSource.Seek(0);
|
||||
AdjustableSource.Stop();
|
||||
|
||||
@ -93,6 +100,12 @@ namespace osu.Game.Screens.Play
|
||||
Start();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Changes the source clock.
|
||||
/// </summary>
|
||||
/// <param name="sourceClock">The new source.</param>
|
||||
protected void ChangeSource(IClock sourceClock) => AdjustableSource.ChangeSource(SourceClock = sourceClock);
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
if (!IsPaused.Value)
|
||||
|
Reference in New Issue
Block a user