mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 18:52:55 +08:00
Refactor
This commit is contained in:
parent
15c9416244
commit
1b0fc8ca9d
@ -11,7 +11,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
|
|||||||
{
|
{
|
||||||
public ConfirmAbortDialog(Action onConfirm, Action onCancel)
|
public ConfirmAbortDialog(Action onConfirm, Action onCancel)
|
||||||
{
|
{
|
||||||
HeaderText = "Are you sure you want to go abort the match?";
|
HeaderText = "Are you sure you want to abort the match?";
|
||||||
|
|
||||||
Icon = FontAwesome.Solid.ExclamationTriangle;
|
Icon = FontAwesome.Solid.ExclamationTriangle;
|
||||||
|
|
||||||
|
@ -155,19 +155,14 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
|
|||||||
|
|
||||||
case MultiplayerUserState.Spectating:
|
case MultiplayerUserState.Spectating:
|
||||||
case MultiplayerUserState.Ready:
|
case MultiplayerUserState.Ready:
|
||||||
Text = room.Host?.Equals(localUser) == true
|
Text = multiplayerClient.IsHost
|
||||||
? $"Start match {countText}"
|
? $"Start match {countText}"
|
||||||
: $"Waiting for host... {countText}";
|
: $"Waiting for host... {countText}";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MultiplayerUserState.Idle:
|
// Show the abort button for the host as long as gameplay is in progress.
|
||||||
if (room.State == MultiplayerRoomState.Open || room.Host?.Equals(localUser) != true)
|
case MultiplayerUserState when multiplayerClient.IsHost && room.State != MultiplayerRoomState.Open:
|
||||||
{
|
Text = "Abort the match";
|
||||||
Text = "Ready";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
Text = "Abort!";
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -207,20 +202,15 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
|
|||||||
|
|
||||||
case MultiplayerUserState.Spectating:
|
case MultiplayerUserState.Spectating:
|
||||||
case MultiplayerUserState.Ready:
|
case MultiplayerUserState.Ready:
|
||||||
if (room?.Host?.Equals(localUser) == true && !room.ActiveCountdowns.Any(c => c is MatchStartCountdown))
|
if (multiplayerClient.IsHost && !room.ActiveCountdowns.Any(c => c is MatchStartCountdown))
|
||||||
setGreen();
|
setGreen();
|
||||||
else
|
else
|
||||||
setYellow();
|
setYellow();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MultiplayerUserState.Idle:
|
// Show the abort button for the host as long as gameplay is in progress.
|
||||||
if (room.State == MultiplayerRoomState.Open || room.Host?.Equals(localUser) != true)
|
case MultiplayerUserState when multiplayerClient.IsHost && room.State != MultiplayerRoomState.Open:
|
||||||
{
|
|
||||||
setGreen();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
setRed();
|
setRed();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user