1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 09:32:55 +08:00

Clean up SpectatorScreen based on suggestions

This commit is contained in:
Dan Balasescu 2022-02-09 12:20:07 +09:00
parent ffc4c64f7e
commit 18251c9285
3 changed files with 8 additions and 8 deletions

View File

@ -207,7 +207,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate
}
}
protected override void OnUserStateChanged(int userId, SpectatorState spectatorState)
protected override void OnNewPlayingUserState(int userId, SpectatorState spectatorState)
{
}

View File

@ -166,7 +166,7 @@ namespace osu.Game.Screens.Play
automaticDownload.Current.BindValueChanged(_ => checkForAutomaticDownload());
}
protected override void OnUserStateChanged(int userId, SpectatorState spectatorState)
protected override void OnNewPlayingUserState(int userId, SpectatorState spectatorState)
{
clearDisplay();
showBeatmapPanel(spectatorState);

View File

@ -103,7 +103,7 @@ namespace osu.Game.Screens.Spectate
continue;
if (beatmapSet.Beatmaps.Any(b => b.OnlineID == userState.BeatmapID))
updateGameplayState(userId);
startGameplay(userId);
}
}
@ -141,8 +141,8 @@ namespace osu.Game.Screens.Spectate
break;
case SpectatedUserState.Playing:
Schedule(() => OnUserStateChanged(userId, newState));
updateGameplayState(userId);
Schedule(() => OnNewPlayingUserState(userId, newState));
startGameplay(userId);
break;
}
}
@ -161,7 +161,7 @@ namespace osu.Game.Screens.Spectate
Schedule(() => EndGameplay(userId, state));
}
private void updateGameplayState(int userId)
private void startGameplay(int userId)
{
Debug.Assert(userMap.ContainsKey(userId));
@ -195,11 +195,11 @@ namespace osu.Game.Screens.Spectate
}
/// <summary>
/// Invoked when a spectated user's state has changed.
/// Invoked when a spectated user's state has changed to a new state indicating the player is currently playing.
/// </summary>
/// <param name="userId">The user whose state has changed.</param>
/// <param name="spectatorState">The new state.</param>
protected abstract void OnUserStateChanged(int userId, [NotNull] SpectatorState spectatorState);
protected abstract void OnNewPlayingUserState(int userId, [NotNull] SpectatorState spectatorState);
/// <summary>
/// Starts gameplay for a user.