Update async load usage to new style.

This commit is contained in:
Dean Herbert
2017-04-02 15:56:12 +09:00
parent 9bd19e99ee
commit 6f1fff4ee7
18 changed files with 146 additions and 170 deletions

View File

@ -27,21 +27,13 @@ namespace osu.Game.Screens
return false;
}
private Framework.Game game;
[BackgroundDependencyLoader]
private void load(Framework.Game game)
{
this.game = game;
}
public override bool Push(Screen screen)
{
// When trying to push a non-loaded GameMode, load it asynchronously and re-invoke Push
// once it's done.
if (screen.LoadState == LoadState.NotLoaded)
{
screen.LoadAsync(game, d => Push((BackgroundScreen)d));
LoadComponentAsync(screen, d => Push((BackgroundScreen)d));
return true;
}