mirror of
https://github.com/osukey/osukey.git
synced 2025-08-08 00:53:56 +09:00
Fix attempt to change ruleset/beatmap bindables while screen is not active
This commit is contained in:
@ -63,6 +63,11 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
private IBindable<WeakReference<BeatmapSetInfo>> managerUpdated;
|
private IBindable<WeakReference<BeatmapSetInfo>> managerUpdated;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Becomes true if a new state is waiting to be loaded (while this screen was not active).
|
||||||
|
/// </summary>
|
||||||
|
private bool newStatePending;
|
||||||
|
|
||||||
public Spectator([NotNull] User targetUser)
|
public Spectator([NotNull] User targetUser)
|
||||||
{
|
{
|
||||||
this.targetUser = targetUser ?? throw new ArgumentNullException(nameof(targetUser));
|
this.targetUser = targetUser ?? throw new ArgumentNullException(nameof(targetUser));
|
||||||
@ -162,7 +167,21 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
this.state = state;
|
this.state = state;
|
||||||
|
|
||||||
|
if (this.IsCurrentScreen())
|
||||||
Schedule(attemptStart);
|
Schedule(attemptStart);
|
||||||
|
else
|
||||||
|
newStatePending = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnResuming(IScreen last)
|
||||||
|
{
|
||||||
|
base.OnResuming(last);
|
||||||
|
|
||||||
|
if (newStatePending)
|
||||||
|
{
|
||||||
|
attemptStart();
|
||||||
|
newStatePending = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void userFinishedPlaying(int userId, SpectatorState state)
|
private void userFinishedPlaying(int userId, SpectatorState state)
|
||||||
|
Reference in New Issue
Block a user