mirror of
https://github.com/ppy/osu
synced 2024-12-12 09:58:22 +00:00
Move OsuScreen activity logic to setUserActivity()
This commit is contained in:
parent
a50bbf7f42
commit
59b8da5c77
@ -68,10 +68,9 @@ namespace osu.Game.Screens
|
||||
set
|
||||
{
|
||||
if (value == activity) return;
|
||||
if (api == null) return;
|
||||
|
||||
activity = value;
|
||||
api.LocalUser.Value.Activity.Value = activity;
|
||||
setUserActivity(activity);
|
||||
}
|
||||
}
|
||||
|
||||
@ -150,7 +149,7 @@ namespace osu.Game.Screens
|
||||
sampleExit?.Play();
|
||||
applyArrivingDefaults(true);
|
||||
|
||||
ScreenActivity = ScreenActivity;
|
||||
setUserActivity(activity);
|
||||
|
||||
base.OnResuming(last);
|
||||
}
|
||||
@ -159,6 +158,8 @@ namespace osu.Game.Screens
|
||||
{
|
||||
base.OnSuspending(next);
|
||||
|
||||
setUserActivity(null);
|
||||
|
||||
onSuspendingLogo();
|
||||
}
|
||||
|
||||
@ -175,6 +176,8 @@ namespace osu.Game.Screens
|
||||
|
||||
public override bool OnExiting(IScreen next)
|
||||
{
|
||||
setUserActivity(null);
|
||||
|
||||
if (ValidForResume && logo != null)
|
||||
onExitingLogo();
|
||||
|
||||
@ -187,6 +190,13 @@ namespace osu.Game.Screens
|
||||
return false;
|
||||
}
|
||||
|
||||
private void setUserActivity(UserActivity activity)
|
||||
{
|
||||
if (api == null) return;
|
||||
|
||||
api.LocalUser.Value.Activity.Value = activity;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fired when this screen was entered or resumed and the logo state is required to be adjusted.
|
||||
/// </summary>
|
||||
|
Loading…
Reference in New Issue
Block a user