mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 07:22:54 +08:00
Recreate test beatmap of EditorTestScene
on set up
This commit is contained in:
parent
d8270fe14f
commit
a93873e8ca
@ -43,28 +43,16 @@ namespace osu.Game.Tests.Visual
|
||||
};
|
||||
|
||||
private TestBeatmapManager testBeatmapManager;
|
||||
private WorkingBeatmap working;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(GameHost host, AudioManager audio, RulesetStore rulesets)
|
||||
{
|
||||
Add(logo);
|
||||
|
||||
working = CreateWorkingBeatmap(Ruleset.Value);
|
||||
|
||||
if (IsolateSavingFromDatabase)
|
||||
Dependencies.CacheAs<BeatmapManager>(testBeatmapManager = new TestBeatmapManager(LocalStorage, Realm, rulesets, null, audio, Resources, host, Beatmap.Default));
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
Beatmap.Value = working;
|
||||
if (testBeatmapManager != null)
|
||||
testBeatmapManager.TestBeatmap = working;
|
||||
}
|
||||
|
||||
protected virtual bool EditorComponentsReady => Editor.ChildrenOfType<HitObjectComposer>().FirstOrDefault()?.IsLoaded == true
|
||||
&& Editor.ChildrenOfType<TimelineArea>().FirstOrDefault()?.IsLoaded == true;
|
||||
|
||||
@ -78,6 +66,11 @@ namespace osu.Game.Tests.Visual
|
||||
|
||||
protected virtual void LoadEditor()
|
||||
{
|
||||
Beatmap.Value = CreateWorkingBeatmap(Ruleset.Value);
|
||||
|
||||
if (testBeatmapManager != null)
|
||||
testBeatmapManager.TestBeatmap = Beatmap.Value;
|
||||
|
||||
LoadScreen(editorLoader = new TestEditorLoader());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user