mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 07:32:55 +08:00
Only set button state once
This commit is contained in:
parent
b38d332268
commit
fd2a14a0bf
@ -105,14 +105,13 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
button.Enabled.Value = Client.Room?.State == MultiplayerRoomState.Open && !operationInProgress.Value;
|
bool enableButton = Client.Room?.State == MultiplayerRoomState.Open && !operationInProgress.Value;
|
||||||
|
|
||||||
// When the local user is the host and spectating the match, the "start match" state should be enabled.
|
// When the local user is the host and spectating the match, the "start match" state should be enabled if any users are ready.
|
||||||
if (localUser.State == MultiplayerUserState.Spectating)
|
if (localUser.State == MultiplayerUserState.Spectating)
|
||||||
{
|
enableButton &= Room?.Host?.Equals(localUser) == true && newCountReady > 0;
|
||||||
button.Enabled.Value &= Room?.Host?.Equals(localUser) == true;
|
|
||||||
button.Enabled.Value &= newCountReady > 0;
|
button.Enabled.Value = enableButton;
|
||||||
}
|
|
||||||
|
|
||||||
if (newCountReady != countReady)
|
if (newCountReady != countReady)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user