Set ScreenActivity to InitialScreenActivity only when ScreenActivity hasn't been set manually before.

This commit is contained in:
Lucas A 2019-06-11 19:24:36 +02:00
parent 141775d98c
commit 6c74998487

View File

@ -56,9 +56,13 @@ namespace osu.Game.Screens
/// <summary>
/// The <see cref="UserActivity"/> to set the user's activity automatically to when this screen is entered
/// <para>This <see cref="ScreenActivity"/> will be automatically set to <see cref="InitialScreenActivity"/> for this screen on entering unless
/// <see cref="ScreenActivity"/> is manually set before.</para>
/// </summary>
protected virtual UserActivity InitialScreenActivity => null;
private UserActivity screenActivity;
/// <summary>
/// The <see cref="UserActivity"/> for this screen.
/// </summary>
@ -74,8 +78,6 @@ namespace osu.Game.Screens
}
}
private UserActivity screenActivity;
/// <summary>
/// Whether to disallow changes to game-wise Beatmap/Ruleset bindables for this screen (and all children).
/// </summary>
@ -170,7 +172,8 @@ namespace osu.Game.Screens
backgroundStack?.Push(localBackground = CreateBackground());
ScreenActivity = InitialScreenActivity;
if (screenActivity == null)
ScreenActivity = InitialScreenActivity;
base.OnEntering(last);
}