mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 18:33:20 +08:00
Update in line with inverse ShoudProcessClock default
This commit is contained in:
parent
8e78a7b114
commit
cff17f1864
@ -62,7 +62,6 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
||||
{
|
||||
// as we are currently very dependent on having a running clock, let's make our own clock for the time being.
|
||||
Clock = new FramedClock();
|
||||
ShouldProcessClock = true;
|
||||
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
|
||||
|
@ -101,6 +101,7 @@ namespace osu.Game.Rulesets.UI
|
||||
//our clock will now be our parent's clock, but we want to replace this to allow manual control.
|
||||
parentClock = Clock;
|
||||
|
||||
ShouldProcessClock = false;
|
||||
Clock = new FramedClock(clock = new ManualClock
|
||||
{
|
||||
CurrentTime = parentClock.CurrentTime,
|
||||
|
@ -44,19 +44,20 @@ namespace osu.Game.Screens.Play
|
||||
public Action OnResume;
|
||||
public Action OnPause;
|
||||
|
||||
public readonly IAdjustableClock AdjustableClock;
|
||||
public readonly FramedClock FramedClock;
|
||||
private readonly IAdjustableClock adjustableClock;
|
||||
private readonly FramedClock framedClock;
|
||||
|
||||
public PauseContainer(FramedClock framedClock, IAdjustableClock adjustableClock)
|
||||
{
|
||||
FramedClock = framedClock;
|
||||
AdjustableClock = adjustableClock;
|
||||
this.framedClock = framedClock;
|
||||
this.adjustableClock = adjustableClock;
|
||||
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
|
||||
AddInternal(content = new Container
|
||||
{
|
||||
Clock = FramedClock,
|
||||
Clock = this.framedClock,
|
||||
ShouldProcessClock = false,
|
||||
RelativeSizeAxes = Axes.Both
|
||||
});
|
||||
|
||||
@ -79,7 +80,7 @@ namespace osu.Game.Screens.Play
|
||||
if (IsPaused) return;
|
||||
|
||||
// stop the seekable clock (stops the audio eventually)
|
||||
AdjustableClock.Stop();
|
||||
adjustableClock.Stop();
|
||||
IsPaused = true;
|
||||
|
||||
OnPause?.Invoke();
|
||||
@ -98,8 +99,8 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
// seek back to the time of the framed clock.
|
||||
// this accounts for the audio clock potentially taking time to enter a completely stopped state.
|
||||
AdjustableClock.Seek(FramedClock.CurrentTime);
|
||||
AdjustableClock.Start();
|
||||
adjustableClock.Seek(framedClock.CurrentTime);
|
||||
adjustableClock.Start();
|
||||
|
||||
OnResume?.Invoke();
|
||||
pauseOverlay.Hide();
|
||||
@ -120,7 +121,7 @@ namespace osu.Game.Screens.Play
|
||||
Pause();
|
||||
|
||||
if (!IsPaused)
|
||||
FramedClock.ProcessFrame();
|
||||
framedClock.ProcessFrame();
|
||||
|
||||
base.Update();
|
||||
}
|
||||
|
@ -183,6 +183,7 @@ namespace osu.Game.Screens.Play
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Clock = offsetClock,
|
||||
ShouldProcessClock = false,
|
||||
Children = new[]
|
||||
{
|
||||
storyboardContainer = new Container
|
||||
@ -208,6 +209,7 @@ namespace osu.Game.Screens.Play
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Clock = offsetClock,
|
||||
ShouldProcessClock = false,
|
||||
Breaks = beatmap.Breaks
|
||||
}
|
||||
}
|
||||
|
@ -63,7 +63,10 @@ namespace osu.Game.Screens.Play
|
||||
var baseClock = Clock;
|
||||
|
||||
if (FramedClock != null)
|
||||
{
|
||||
Clock = FramedClock;
|
||||
ShouldProcessClock = false;
|
||||
}
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user