mirror of
https://github.com/ppy/osu.git
synced 2025-01-27 02:32:59 +08:00
Scren async changes in line with framework changes
Makes editor not stutter on load, amongst other screens.
This commit is contained in:
parent
33b38b68cc
commit
31ade986a7
@ -1 +1 @@
|
||||
Subproject commit 85b3494117ccef1b396b70957e1cffaba06e2b54
|
||||
Subproject commit d4cb1117fb23453c20e7a8116f1c1f99d9a13611
|
@ -26,14 +26,14 @@ namespace osu.Game.Screens
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool Push(Screen screen)
|
||||
public override void Push(Screen screen)
|
||||
{
|
||||
// When trying to push a non-loaded screen, load it asynchronously and re-invoke Push
|
||||
// once it's done.
|
||||
if (screen.LoadState == LoadState.NotLoaded)
|
||||
{
|
||||
LoadComponentAsync(screen, d => Push((BackgroundScreen)d));
|
||||
return true;
|
||||
return;
|
||||
}
|
||||
|
||||
// Make sure the in-progress loading is complete before pushing the screen.
|
||||
@ -41,8 +41,6 @@ namespace osu.Game.Screens
|
||||
Thread.Sleep(1);
|
||||
|
||||
base.Push(screen);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
|
@ -173,7 +173,7 @@ namespace osu.Game.Screens.Edit
|
||||
}
|
||||
|
||||
currentScreen.Beatmap.BindTo(Beatmap);
|
||||
screenContainer.Add(currentScreen);
|
||||
LoadComponentAsync(currentScreen, screenContainer.Add);
|
||||
}
|
||||
|
||||
protected override void OnResuming(Screen last)
|
||||
|
@ -159,14 +159,11 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
loadTask = null;
|
||||
|
||||
if (!Push(player))
|
||||
Exit();
|
||||
else
|
||||
{
|
||||
//By default, we want to load the player and never be returned to.
|
||||
//Note that this may change if the player we load requested a re-run.
|
||||
ValidForResume = false;
|
||||
}
|
||||
//By default, we want to load the player and never be returned to.
|
||||
//Note that this may change if the player we load requested a re-run.
|
||||
ValidForResume = false;
|
||||
|
||||
Push(player);
|
||||
});
|
||||
}, 500);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user