1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 13:32:54 +08:00

Give the test case clock an accurate IsRunning value

This commit is contained in:
smoogipoo 2018-04-06 19:14:04 +09:00
parent e59124962c
commit 070e68f235

View File

@ -45,7 +45,26 @@ namespace osu.Game.Tests.Visual
beatmapChanged(osuGame.Beatmap.Value);
}
private void beatmapChanged(WorkingBeatmap working) => Clock.ControlPointInfo = working.Beatmap.ControlPointInfo;
private void beatmapChanged(WorkingBeatmap working)
{
Clock.ControlPointInfo = working.Beatmap.ControlPointInfo;
Clock.ChangeSource((IAdjustableClock)working.Track ?? new StopwatchClock());
Clock.ProcessFrame();
}
protected override void Update()
{
base.Update();
// We don't have any explicit way to start/stop the track, but want a relatively accurate IsRunning state
// The track's IsRunning state is used to determine our clock's IsRunning state
if (osuGame.Beatmap.Value.Track.IsRunning)
Clock.Start();
else
Clock.Stop();
Clock.ProcessFrame();
}
protected override bool OnWheel(InputState state)
{