1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 09:07:52 +08:00

Remove usage of case-when

This commit is contained in:
Dean Herbert 2023-12-05 16:58:16 +09:00
parent f317e06da1
commit 02178d8e61
No known key found for this signature in database

View File

@ -149,10 +149,6 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
{
switch (localUser?.State)
{
default:
Text = "Ready";
break;
case MultiplayerUserState.Spectating:
case MultiplayerUserState.Ready:
Text = multiplayerClient.IsHost
@ -160,9 +156,12 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
: $"Waiting for host... {countText}";
break;
// Show the abort button for the host as long as gameplay is in progress.
case MultiplayerUserState when multiplayerClient.IsHost && room.State != MultiplayerRoomState.Open:
Text = "Abort the match";
default:
// Show the abort button for the host as long as gameplay is in progress.
if (multiplayerClient.IsHost && room.State != MultiplayerRoomState.Open)
Text = "Abort the match";
else
Text = "Ready";
break;
}
}
@ -197,7 +196,11 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
switch (localUser?.State)
{
default:
setGreen();
// Show the abort button for the host as long as gameplay is in progress.
if (multiplayerClient.IsHost && room.State != MultiplayerRoomState.Open)
setRed();
else
setGreen();
break;
case MultiplayerUserState.Spectating:
@ -208,11 +211,6 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
setYellow();
break;
// Show the abort button for the host as long as gameplay is in progress.
case MultiplayerUserState when multiplayerClient.IsHost && room.State != MultiplayerRoomState.Open:
setRed();
break;
}
void setYellow() => BackgroundColour = colours.YellowDark;