1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 23:12:56 +08:00

Ensure PlayerInputManager's initial time is transferred at load.

This commit is contained in:
Dean Herbert 2017-04-27 17:38:00 +09:00
parent 4ab636cbb8
commit 59a3e23879

View File

@ -13,7 +13,7 @@ namespace osu.Game.Screens.Play
{ {
public class PlayerInputManager : PassThroughInputManager public class PlayerInputManager : PassThroughInputManager
{ {
private readonly ManualClock clock = new ManualClock(); private ManualClock clock;
private IFrameBasedClock parentClock; private IFrameBasedClock parentClock;
private ReplayInputHandler replayInputHandler; private ReplayInputHandler replayInputHandler;
@ -47,8 +47,14 @@ namespace osu.Game.Screens.Play
{ {
base.LoadComplete(); base.LoadComplete();
//our clock will now be our parent's clock, but we want to replace this to allow manual control.
parentClock = Clock; parentClock = Clock;
Clock = new FramedClock(clock);
Clock = new FramedClock(clock = new ManualClock
{
CurrentTime = parentClock.CurrentTime,
Rate = parentClock.Rate,
});
} }
/// <summary> /// <summary>