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