diff --git a/osu.Game.Rulesets.Karaoke.Tests/Editor/TestSceneKaraokeEditor.cs b/osu.Game.Rulesets.Karaoke.Tests/Editor/TestSceneKaraokeEditor.cs index 466425aa1..716c38425 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Editor/TestSceneKaraokeEditor.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Editor/TestSceneKaraokeEditor.cs @@ -54,8 +54,6 @@ private void load() Dependencies.Cache(dialogOverlay); Dependencies.Cache(lyricCheckerManager); - - Dependencies.Cache(new EditorClock()); } } } diff --git a/osu.Game.Rulesets.Karaoke.Tests/Screens/TestSceneKaraokeSkinEditor.cs b/osu.Game.Rulesets.Karaoke.Tests/Screens/TestSceneKaraokeSkinEditor.cs index a4efdbb52..32266f56a 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Screens/TestSceneKaraokeSkinEditor.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Screens/TestSceneKaraokeSkinEditor.cs @@ -28,9 +28,6 @@ public class TestSceneKaraokeSkinEditor : ScreenTestScene [BackgroundDependencyLoader] private void load(SkinManager skinManager) { - // todo: karaoke skin editor might not need editor clock eventually? - Dependencies.Cache(new EditorClock()); - skinManager.CurrentSkinInfo.Value = DefaultKaraokeSkin.CreateInfo().ToLiveUnmanaged(); karaokeSkin = skinManager.CurrentSkin.Value as KaraokeSkin; diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/GenericEditor.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/GenericEditor.cs index 35acdc9af..fc4b11a35 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/GenericEditor.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/GenericEditor.cs @@ -41,9 +41,23 @@ public abstract class GenericEditor : ScreenWithBeatmapBackground w private GenericEditorMenuBar menuBar; + private DependencyContainer dependencies; + + protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) + => dependencies = new DependencyContainer(base.CreateChildDependencies(parent)); + [BackgroundDependencyLoader(true)] - private void load(OsuColour colours, EditorBeatmap beatmap) + private void load(OsuColour colours, EditorBeatmap editorBeatmap, BindableBeatDivisor beatDivisor) { + // todo: should re-inject editor clock because it will let track cannot change time because it's in another screen. + var clock = new EditorClock(editorBeatmap, beatDivisor) { IsCoupled = false }; + + var loadableBeatmap = Beatmap.Value; + clock.ChangeSource(loadableBeatmap.Track); + + dependencies.CacheAs(clock); + AddInternal(clock); + AddInternal(new OsuContextMenuContainer { RelativeSizeAxes = Axes.Both,