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