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