From 070e68f235060a6e9977143cfcf36834e6c10155 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 6 Apr 2018 19:14:04 +0900 Subject: [PATCH] Give the test case clock an accurate IsRunning value --- osu.Game/Tests/Visual/EditorClockTestCase.cs | 21 +++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/osu.Game/Tests/Visual/EditorClockTestCase.cs b/osu.Game/Tests/Visual/EditorClockTestCase.cs index 3e42f7a242..5cc03a4553 100644 --- a/osu.Game/Tests/Visual/EditorClockTestCase.cs +++ b/osu.Game/Tests/Visual/EditorClockTestCase.cs @@ -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) {