1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-26 19:32:55 +08:00

Move screen activity update to LoadComplete()

Fixes a potential crash when moving from main menu to editor after
having previously opened the login settings overlay. Setting the
activity in BDL as done before is unsafe, as that set can trigger value
change callbacks, which in turn can trigger adding transforms, which
should always be done on the update thread.

Semantically it also makes sense, as the user activity should change
once the screen they're moving to has actually loaded and displayed to
the user.
This commit is contained in:
Bartłomiej Dach 2021-01-08 21:13:36 +01:00
parent 8a7a1fc40a
commit 284d30d336

View File

@ -143,7 +143,11 @@ namespace osu.Game.Screens
private void load(OsuGame osu, AudioManager audio)
{
sampleExit = audio.Samples.Get(@"UI/screen-back");
}
protected override void LoadComplete()
{
base.LoadComplete();
Activity.Value ??= InitialActivity;
}