mirror of
https://github.com/ppy/osu
synced 2024-12-12 01:48:49 +00:00
Eliminate dependency on OsuGame
This commit is contained in:
parent
c397cc2027
commit
a9403b65b3
@ -105,9 +105,6 @@ namespace osu.Game.Screens.Edit
|
||||
[Resolved]
|
||||
private MusicController music { get; set; }
|
||||
|
||||
[Resolved(CanBeNull = true)]
|
||||
private OsuGame game { get; set; }
|
||||
|
||||
public Editor(EditorLoader loader = null)
|
||||
{
|
||||
this.loader = loader;
|
||||
@ -735,16 +732,12 @@ namespace osu.Game.Screens.Edit
|
||||
|
||||
private void switchToDifficulty(BeatmapInfo beatmapInfo)
|
||||
{
|
||||
if (loader != null)
|
||||
loader.ValidForResume = true;
|
||||
if (loader == null)
|
||||
return;
|
||||
|
||||
game?.PerformFromScreen(screen =>
|
||||
{
|
||||
if (screen == null || screen != loader)
|
||||
return;
|
||||
|
||||
loader.PushEditor(beatmapInfo);
|
||||
}, new[] { typeof(EditorLoader) });
|
||||
loader.ValidForResume = true;
|
||||
this.Exit();
|
||||
loader.PushEditor(beatmapInfo);
|
||||
}
|
||||
|
||||
public double SnapTime(double time, double? referenceTime) => editorBeatmap.SnapTime(time, referenceTime);
|
||||
|
@ -24,13 +24,13 @@ namespace osu.Game.Screens.Edit
|
||||
PushEditor();
|
||||
}
|
||||
|
||||
public void PushEditor([CanBeNull] BeatmapInfo beatmapInfo = null)
|
||||
public void PushEditor([CanBeNull] BeatmapInfo beatmapInfo = null) => Schedule(() =>
|
||||
{
|
||||
if (beatmapInfo != null)
|
||||
Beatmap.Value = beatmapManager.GetWorkingBeatmap(beatmapInfo);
|
||||
|
||||
this.Push(new Editor(this));
|
||||
ValidForResume = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user