1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-30 06:52:53 +08:00

Make buttons only respond to MatchStartCountdown

This commit is contained in:
Dan Balasescu 2022-04-21 23:01:16 +09:00
parent cbb07d4011
commit ef1955d8ab
2 changed files with 16 additions and 2 deletions

View File

@ -77,7 +77,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
private void onRoomUpdated() => Scheduler.AddOnce(() => private void onRoomUpdated() => Scheduler.AddOnce(() =>
{ {
bool countdownActive = multiplayerClient.Room?.Countdown != null; bool countdownActive = multiplayerClient.Room?.Countdown is MatchStartCountdown;
if (countdownActive) if (countdownActive)
{ {

View File

@ -55,7 +55,21 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
private void onRoomUpdated() => Scheduler.AddOnce(() => private void onRoomUpdated() => Scheduler.AddOnce(() =>
{ {
if (countdown != room?.Countdown) MultiplayerCountdown newCountdown;
switch (room?.Countdown)
{
case MatchStartCountdown _:
newCountdown = room.Countdown;
break;
// Clear the countdown with any other (including non-null) countdown values.
default:
newCountdown = null;
break;
}
if (newCountdown != countdown)
{ {
countdown = room?.Countdown; countdown = room?.Countdown;
countdownChangeTime = Time.Current; countdownChangeTime = Time.Current;