1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 12:07:23 +08:00

Merge pull request #9083 from peppy/editor-clock-cache

Cache EditorClock as its own type
This commit is contained in:
Dan Balasescu 2020-05-25 18:31:03 +09:00 committed by GitHub
commit 0728c2cd84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 59 additions and 76 deletions

View File

@ -4,8 +4,8 @@
using NUnit.Framework; using NUnit.Framework;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Timing;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Screens.Edit;
using osu.Game.Screens.Edit.Components; using osu.Game.Screens.Edit.Components;
using osuTK; using osuTK;
@ -17,9 +17,8 @@ namespace osu.Game.Tests.Visual.Editing
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()
{ {
var clock = new DecoupleableInterpolatingFramedClock { IsCoupled = false }; var clock = new EditorClock { IsCoupled = false };
Dependencies.CacheAs<IAdjustableClock>(clock); Dependencies.CacheAs(clock);
Dependencies.CacheAs<IFrameBasedClock>(clock);
var playback = new PlaybackControl var playback = new PlaybackControl
{ {

View File

@ -7,7 +7,6 @@ using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Framework.Timing;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Rulesets.Edit; using osu.Game.Rulesets.Edit;
@ -69,7 +68,7 @@ namespace osu.Game.Tests.Visual.Editing
private IBindable<WorkingBeatmap> beatmap { get; set; } private IBindable<WorkingBeatmap> beatmap { get; set; }
[Resolved] [Resolved]
private IAdjustableClock adjustableClock { get; set; } private EditorClock editorClock { get; set; }
public AudioVisualiser() public AudioVisualiser()
{ {
@ -96,13 +95,15 @@ namespace osu.Game.Tests.Visual.Editing
base.Update(); base.Update();
if (beatmap.Value.Track.IsLoaded) if (beatmap.Value.Track.IsLoaded)
marker.X = (float)(adjustableClock.CurrentTime / beatmap.Value.Track.Length); marker.X = (float)(editorClock.CurrentTime / beatmap.Value.Track.Length);
} }
} }
private class StartStopButton : OsuButton private class StartStopButton : OsuButton
{ {
private IAdjustableClock adjustableClock; [Resolved]
private EditorClock editorClock { get; set; }
private bool started; private bool started;
public StartStopButton() public StartStopButton()
@ -114,22 +115,16 @@ namespace osu.Game.Tests.Visual.Editing
Action = onClick; Action = onClick;
} }
[BackgroundDependencyLoader]
private void load(IAdjustableClock adjustableClock)
{
this.adjustableClock = adjustableClock;
}
private void onClick() private void onClick()
{ {
if (started) if (started)
{ {
adjustableClock.Stop(); editorClock.Stop();
Text = "Start"; Text = "Start";
} }
else else
{ {
adjustableClock.Start(); editorClock.Start();
Text = "Stop"; Text = "Stop";
} }

View File

@ -11,7 +11,6 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Input; using osu.Framework.Input;
using osu.Framework.Input.Events; using osu.Framework.Input.Events;
using osu.Framework.Logging; using osu.Framework.Logging;
using osu.Framework.Timing;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Beatmaps.ControlPoints; using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Rulesets.Configuration; using osu.Game.Rulesets.Configuration;
@ -38,14 +37,11 @@ namespace osu.Game.Rulesets.Edit
protected readonly Ruleset Ruleset; protected readonly Ruleset Ruleset;
[Resolved] [Resolved]
protected IFrameBasedClock EditorClock { get; private set; } protected EditorClock EditorClock { get; private set; }
[Resolved] [Resolved]
protected EditorBeatmap EditorBeatmap { get; private set; } protected EditorBeatmap EditorBeatmap { get; private set; }
[Resolved]
private IAdjustableClock adjustableClock { get; set; }
[Resolved] [Resolved]
protected IBeatSnapProvider BeatSnapProvider { get; private set; } protected IBeatSnapProvider BeatSnapProvider { get; private set; }
@ -68,7 +64,7 @@ namespace osu.Game.Rulesets.Edit
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(IFrameBasedClock framedClock) private void load()
{ {
Config = Dependencies.Get<RulesetConfigCache>().GetConfigFor(Ruleset); Config = Dependencies.Get<RulesetConfigCache>().GetConfigFor(Ruleset);
@ -76,7 +72,7 @@ namespace osu.Game.Rulesets.Edit
{ {
drawableRulesetWrapper = new DrawableEditRulesetWrapper<TObject>(CreateDrawableRuleset(Ruleset, EditorBeatmap.PlayableBeatmap)) drawableRulesetWrapper = new DrawableEditRulesetWrapper<TObject>(CreateDrawableRuleset(Ruleset, EditorBeatmap.PlayableBeatmap))
{ {
Clock = framedClock, Clock = EditorClock,
ProcessCustomClock = false ProcessCustomClock = false
}; };
} }
@ -221,8 +217,8 @@ namespace osu.Game.Rulesets.Edit
{ {
EditorBeatmap.Add(hitObject); EditorBeatmap.Add(hitObject);
if (adjustableClock.CurrentTime < hitObject.StartTime) if (EditorClock.CurrentTime < hitObject.StartTime)
adjustableClock.Seek(hitObject.StartTime); EditorClock.Seek(hitObject.StartTime);
} }
} }

View File

@ -6,10 +6,10 @@ using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Input.Events; using osu.Framework.Input.Events;
using osu.Framework.Timing;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Beatmaps.ControlPoints; using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects;
using osu.Game.Screens.Edit;
using osu.Game.Screens.Edit.Compose; using osu.Game.Screens.Edit.Compose;
using osuTK; using osuTK;
@ -30,7 +30,8 @@ namespace osu.Game.Rulesets.Edit
/// </summary> /// </summary>
protected readonly HitObject HitObject; protected readonly HitObject HitObject;
protected IClock EditorClock { get; private set; } [Resolved(canBeNull: true)]
protected EditorClock EditorClock { get; private set; }
private readonly IBindable<WorkingBeatmap> beatmap = new Bindable<WorkingBeatmap>(); private readonly IBindable<WorkingBeatmap> beatmap = new Bindable<WorkingBeatmap>();
@ -51,12 +52,10 @@ namespace osu.Game.Rulesets.Edit
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(IBindable<WorkingBeatmap> beatmap, IAdjustableClock clock) private void load(IBindable<WorkingBeatmap> beatmap)
{ {
this.beatmap.BindTo(beatmap); this.beatmap.BindTo(beatmap);
EditorClock = clock;
startTimeBindable = HitObject.StartTimeBindable.GetBoundCopy(); startTimeBindable = HitObject.StartTimeBindable.GetBoundCopy();
startTimeBindable.BindValueChanged(_ => ApplyDefaultsToHitObject(), true); startTimeBindable.BindValueChanged(_ => ApplyDefaultsToHitObject(), true);
} }
@ -84,9 +83,6 @@ namespace osu.Game.Rulesets.Edit
PlacementActive = false; PlacementActive = false;
} }
[Resolved(canBeNull: true)]
private IFrameBasedClock editorClock { get; set; }
/// <summary> /// <summary>
/// Updates the position of this <see cref="PlacementBlueprint"/> to a new screen-space position. /// Updates the position of this <see cref="PlacementBlueprint"/> to a new screen-space position.
/// </summary> /// </summary>
@ -94,7 +90,7 @@ namespace osu.Game.Rulesets.Edit
public virtual void UpdatePosition(SnapResult snapResult) public virtual void UpdatePosition(SnapResult snapResult)
{ {
if (!PlacementActive) if (!PlacementActive)
HitObject.StartTime = snapResult.Time ?? editorClock?.CurrentTime ?? Time.Current; HitObject.StartTime = snapResult.Time ?? EditorClock?.CurrentTime ?? Time.Current;
} }
/// <summary> /// <summary>

View File

@ -13,7 +13,6 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input.Events; using osu.Framework.Input.Events;
using osu.Framework.Timing;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
@ -26,7 +25,7 @@ namespace osu.Game.Screens.Edit.Components
private IconButton playButton; private IconButton playButton;
[Resolved] [Resolved]
private IAdjustableClock adjustableClock { get; set; } private EditorClock editorClock { get; set; }
private readonly BindableNumber<double> tempo = new BindableDouble(1); private readonly BindableNumber<double> tempo = new BindableDouble(1);
@ -87,17 +86,17 @@ namespace osu.Game.Screens.Edit.Components
private void togglePause() private void togglePause()
{ {
if (adjustableClock.IsRunning) if (editorClock.IsRunning)
adjustableClock.Stop(); editorClock.Stop();
else else
adjustableClock.Start(); editorClock.Start();
} }
protected override void Update() protected override void Update()
{ {
base.Update(); base.Update();
playButton.Icon = adjustableClock.IsRunning ? FontAwesome.Regular.PauseCircle : FontAwesome.Regular.PlayCircle; playButton.Icon = editorClock.IsRunning ? FontAwesome.Regular.PauseCircle : FontAwesome.Regular.PlayCircle;
} }
private class PlaybackTabControl : OsuTabControl<double> private class PlaybackTabControl : OsuTabControl<double>

View File

@ -5,7 +5,6 @@ using osu.Framework.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using System; using System;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Timing;
using osu.Game.Graphics; using osu.Game.Graphics;
namespace osu.Game.Screens.Edit.Components namespace osu.Game.Screens.Edit.Components
@ -15,7 +14,7 @@ namespace osu.Game.Screens.Edit.Components
private readonly OsuSpriteText trackTimer; private readonly OsuSpriteText trackTimer;
[Resolved] [Resolved]
private IAdjustableClock adjustableClock { get; set; } private EditorClock editorClock { get; set; }
public TimeInfoContainer() public TimeInfoContainer()
{ {
@ -35,7 +34,7 @@ namespace osu.Game.Screens.Edit.Components
{ {
base.Update(); base.Update();
trackTimer.Text = TimeSpan.FromMilliseconds(adjustableClock.CurrentTime).ToString(@"mm\:ss\:fff"); trackTimer.Text = TimeSpan.FromMilliseconds(editorClock.CurrentTime).ToString(@"mm\:ss\:fff");
} }
} }
} }

View File

@ -9,7 +9,6 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Framework.Input.Events; using osu.Framework.Input.Events;
using osu.Framework.Threading; using osu.Framework.Threading;
using osu.Framework.Timing;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Graphics; using osu.Game.Graphics;
@ -20,14 +19,14 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
/// </summary> /// </summary>
public class MarkerPart : TimelinePart public class MarkerPart : TimelinePart
{ {
private readonly Drawable marker; private Drawable marker;
private readonly IAdjustableClock adjustableClock; [Resolved]
private EditorClock editorClock { get; set; }
public MarkerPart(IAdjustableClock adjustableClock) [BackgroundDependencyLoader]
private void load()
{ {
this.adjustableClock = adjustableClock;
Add(marker = new MarkerVisualisation()); Add(marker = new MarkerVisualisation());
} }
@ -59,14 +58,14 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
return; return;
float markerPos = Math.Clamp(ToLocalSpace(screenPosition).X, 0, DrawWidth); float markerPos = Math.Clamp(ToLocalSpace(screenPosition).X, 0, DrawWidth);
adjustableClock.Seek(markerPos / DrawWidth * Beatmap.Value.Track.Length); editorClock.Seek(markerPos / DrawWidth * editorClock.TrackLength);
}); });
} }
protected override void Update() protected override void Update()
{ {
base.Update(); base.Update();
marker.X = (float)adjustableClock.CurrentTime; marker.X = (float)editorClock.CurrentTime;
} }
protected override void LoadBeatmap(WorkingBeatmap beatmap) protected override void LoadBeatmap(WorkingBeatmap beatmap)

View File

@ -6,7 +6,6 @@ using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Framework.Timing;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Screens.Edit.Components.Timelines.Summary.Parts; using osu.Game.Screens.Edit.Components.Timelines.Summary.Parts;
@ -18,11 +17,11 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary
public class SummaryTimeline : BottomBarContainer public class SummaryTimeline : BottomBarContainer
{ {
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours, IAdjustableClock adjustableClock) private void load(OsuColour colours)
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new MarkerPart(adjustableClock) { RelativeSizeAxes = Axes.Both }, new MarkerPart { RelativeSizeAxes = Axes.Both },
new ControlPointPart new ControlPointPart
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,

View File

@ -13,7 +13,6 @@ using osu.Framework.Graphics.Primitives;
using osu.Framework.Input; using osu.Framework.Input;
using osu.Framework.Input.Bindings; using osu.Framework.Input.Bindings;
using osu.Framework.Input.Events; using osu.Framework.Input.Events;
using osu.Framework.Timing;
using osu.Game.Rulesets.Edit; using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Objects.Drawables;
@ -38,7 +37,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
private IEditorChangeHandler changeHandler { get; set; } private IEditorChangeHandler changeHandler { get; set; }
[Resolved] [Resolved]
private IAdjustableClock adjustableClock { get; set; } private EditorClock editorClock { get; set; }
[Resolved] [Resolved]
private EditorBeatmap beatmap { get; set; } private EditorBeatmap beatmap { get; set; }
@ -144,7 +143,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
if (clickedBlueprint == null) if (clickedBlueprint == null)
return false; return false;
adjustableClock?.Seek(clickedBlueprint.HitObject.StartTime); editorClock?.Seek(clickedBlueprint.HitObject.StartTime);
return true; return true;
} }

View File

@ -9,7 +9,6 @@ using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Audio; using osu.Framework.Graphics.Audio;
using osu.Framework.Input.Events; using osu.Framework.Input.Events;
using osu.Framework.Timing;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Rulesets.Edit; using osu.Game.Rulesets.Edit;
@ -25,7 +24,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
public readonly IBindable<WorkingBeatmap> Beatmap = new Bindable<WorkingBeatmap>(); public readonly IBindable<WorkingBeatmap> Beatmap = new Bindable<WorkingBeatmap>();
[Resolved] [Resolved]
private IAdjustableClock adjustableClock { get; set; } private EditorClock editorClock { get; set; }
public Timeline() public Timeline()
{ {
@ -101,7 +100,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
Content.Margin = new MarginPadding { Horizontal = DrawWidth / 2 }; Content.Margin = new MarginPadding { Horizontal = DrawWidth / 2 };
// This needs to happen after transforms are updated, but before the scroll position is updated in base.UpdateAfterChildren // This needs to happen after transforms are updated, but before the scroll position is updated in base.UpdateAfterChildren
if (adjustableClock.IsRunning) if (editorClock.IsRunning)
scrollToTrackTime(); scrollToTrackTime();
} }
@ -111,21 +110,21 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
if (handlingDragInput) if (handlingDragInput)
seekTrackToCurrent(); seekTrackToCurrent();
else if (!adjustableClock.IsRunning) else if (!editorClock.IsRunning)
{ {
// The track isn't running. There are two cases we have to be wary of: // The track isn't running. There are two cases we have to be wary of:
// 1) The user flick-drags on this timeline: We want the track to follow us // 1) The user flick-drags on this timeline: We want the track to follow us
// 2) The user changes the track time through some other means (scrolling in the editor or overview timeline): We want to follow the track time // 2) The user changes the track time through some other means (scrolling in the editor or overview timeline): We want to follow the track time
// The simplest way to cover both cases is by checking whether the scroll position has changed and the audio hasn't been changed externally // The simplest way to cover both cases is by checking whether the scroll position has changed and the audio hasn't been changed externally
if (Current != lastScrollPosition && adjustableClock.CurrentTime == lastTrackTime) if (Current != lastScrollPosition && editorClock.CurrentTime == lastTrackTime)
seekTrackToCurrent(); seekTrackToCurrent();
else else
scrollToTrackTime(); scrollToTrackTime();
} }
lastScrollPosition = Current; lastScrollPosition = Current;
lastTrackTime = adjustableClock.CurrentTime; lastTrackTime = editorClock.CurrentTime;
} }
private void seekTrackToCurrent() private void seekTrackToCurrent()
@ -133,7 +132,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
if (!track.IsLoaded) if (!track.IsLoaded)
return; return;
adjustableClock.Seek(Current / Content.DrawWidth * track.Length); editorClock.Seek(Current / Content.DrawWidth * track.Length);
} }
private void scrollToTrackTime() private void scrollToTrackTime()
@ -141,7 +140,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
if (!track.IsLoaded || track.Length == 0) if (!track.IsLoaded || track.Length == 0)
return; return;
ScrollTo((float)(adjustableClock.CurrentTime / track.Length) * Content.DrawWidth, false); ScrollTo((float)(editorClock.CurrentTime / track.Length) * Content.DrawWidth, false);
} }
protected override bool OnMouseDown(MouseDownEvent e) protected override bool OnMouseDown(MouseDownEvent e)
@ -164,15 +163,15 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
private void beginUserDrag() private void beginUserDrag()
{ {
handlingDragInput = true; handlingDragInput = true;
trackWasPlaying = adjustableClock.IsRunning; trackWasPlaying = editorClock.IsRunning;
adjustableClock.Stop(); editorClock.Stop();
} }
private void endUserDrag() private void endUserDrag()
{ {
handlingDragInput = false; handlingDragInput = false;
if (trackWasPlaying) if (trackWasPlaying)
adjustableClock.Start(); editorClock.Start();
} }
[Resolved] [Resolved]

View File

@ -83,8 +83,7 @@ namespace osu.Game.Screens.Edit
clock = new EditorClock(Beatmap.Value, beatDivisor) { IsCoupled = false }; clock = new EditorClock(Beatmap.Value, beatDivisor) { IsCoupled = false };
clock.ChangeSource(sourceClock); clock.ChangeSource(sourceClock);
dependencies.CacheAs<IFrameBasedClock>(clock); dependencies.CacheAs(clock);
dependencies.CacheAs<IAdjustableClock>(clock);
// todo: remove caching of this and consume via editorBeatmap? // todo: remove caching of this and consume via editorBeatmap?
dependencies.Cache(beatDivisor); dependencies.Cache(beatDivisor);

View File

@ -37,6 +37,11 @@ namespace osu.Game.Screens.Edit
TrackLength = trackLength; TrackLength = trackLength;
} }
public EditorClock()
: this(new ControlPointInfo(), 1000, new BindableBeatDivisor())
{
}
/// <summary> /// <summary>
/// Seek to the closest snappable beat from a time. /// Seek to the closest snappable beat from a time.
/// </summary> /// </summary>

View File

@ -7,7 +7,6 @@ using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Framework.Timing;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Beatmaps.ControlPoints; using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Graphics; using osu.Game.Graphics;
@ -23,7 +22,7 @@ namespace osu.Game.Screens.Edit.Timing
private Bindable<ControlPointGroup> selectedGroup = new Bindable<ControlPointGroup>(); private Bindable<ControlPointGroup> selectedGroup = new Bindable<ControlPointGroup>();
[Resolved] [Resolved]
private IAdjustableClock clock { get; set; } private EditorClock clock { get; set; }
protected override Drawable CreateMainContent() => new GridContainer protected override Drawable CreateMainContent() => new GridContainer
{ {
@ -62,7 +61,7 @@ namespace osu.Game.Screens.Edit.Timing
private IBindableList<ControlPointGroup> controlGroups; private IBindableList<ControlPointGroup> controlGroups;
[Resolved] [Resolved]
private IFrameBasedClock clock { get; set; } private EditorClock clock { get; set; }
[Resolved] [Resolved]
protected IBindable<WorkingBeatmap> Beatmap { get; private set; } protected IBindable<WorkingBeatmap> Beatmap { get; private set; }

View File

@ -30,8 +30,7 @@ namespace osu.Game.Tests.Visual
var dependencies = new DependencyContainer(base.CreateChildDependencies(parent)); var dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
dependencies.Cache(BeatDivisor); dependencies.Cache(BeatDivisor);
dependencies.CacheAs<IFrameBasedClock>(Clock); dependencies.CacheAs(Clock);
dependencies.CacheAs<IAdjustableClock>(Clock);
return dependencies; return dependencies;
} }

View File

@ -8,6 +8,7 @@ using osu.Framework.Timing;
using osu.Game.Rulesets.Edit; using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Screens.Edit;
using osu.Game.Screens.Edit.Compose; using osu.Game.Screens.Edit.Compose;
namespace osu.Game.Tests.Visual namespace osu.Game.Tests.Visual
@ -32,7 +33,7 @@ namespace osu.Game.Tests.Visual
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
{ {
var dependencies = new DependencyContainer(base.CreateChildDependencies(parent)); var dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
dependencies.CacheAs<IAdjustableClock>(new StopwatchClock()); dependencies.CacheAs(new EditorClock());
return dependencies; return dependencies;
} }