Skip to content

Commit

Permalink
should inject local editor clock in every base editor screen.
Browse files Browse the repository at this point in the history
  • Loading branch information
andy840119 committed Feb 7, 2022
1 parent 77adac0 commit 7122aa0
Showing 1 changed file with 15 additions and 1 deletion.
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 7122aa0

Please sign in to comment.