Skip to content

Commit

Permalink
Merge pull request #1106 from andy840119/editor-screen-should-have-it…
Browse files Browse the repository at this point in the history
…s-own-editor-click

Editor screen should have its own editor click.
  • Loading branch information
andy840119 authored Feb 7, 2022
2 parents 77adac0 + 61e1780 commit 54fc5a6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ private void load()

Dependencies.Cache(dialogOverlay);
Dependencies.Cache(lyricCheckerManager);

Dependencies.Cache(new EditorClock());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ public class TestSceneKaraokeSkinEditor : ScreenTestScene<KaraokeSkinEditor>
[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;
Expand Down
16 changes: 15 additions & 1 deletion osu.Game.Rulesets.Karaoke/Screens/Edit/GenericEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,23 @@ public abstract class GenericEditor<TScreenMode> : ScreenWithBeatmapBackground w

private GenericEditorMenuBar<TScreenMode> 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,
Expand Down

0 comments on commit 54fc5a6

Please sign in to comment.