mirror of
https://github.com/ppy/osu.git
synced 2025-03-28 03:07:19 +08:00
Fix countdown button being enabled
This commit is contained in:
parent
9ccd33a1ec
commit
8587652869
@ -381,28 +381,32 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestAbortMatch()
|
public void TestAbortMatch()
|
||||||
{
|
{
|
||||||
multiplayerClient.Setup(m => m.StartMatch())
|
AddStep("setup client", () =>
|
||||||
.Callback(() =>
|
{
|
||||||
{
|
multiplayerClient.Setup(m => m.StartMatch())
|
||||||
multiplayerClient.Raise(m => m.LoadRequested -= null);
|
.Callback(() =>
|
||||||
multiplayerClient.Object.Room!.State = MultiplayerRoomState.WaitingForLoad;
|
{
|
||||||
|
multiplayerClient.Raise(m => m.LoadRequested -= null);
|
||||||
|
multiplayerClient.Object.Room!.State = MultiplayerRoomState.WaitingForLoad;
|
||||||
|
|
||||||
// The local user state doesn't really matter, so let's do the same as the base implementation for these tests.
|
// The local user state doesn't really matter, so let's do the same as the base implementation for these tests.
|
||||||
changeUserState(localUser.UserID, MultiplayerUserState.Idle);
|
changeUserState(localUser.UserID, MultiplayerUserState.Idle);
|
||||||
});
|
});
|
||||||
|
|
||||||
multiplayerClient.Setup(m => m.AbortMatch())
|
multiplayerClient.Setup(m => m.AbortMatch())
|
||||||
.Callback(() =>
|
.Callback(() =>
|
||||||
{
|
{
|
||||||
multiplayerClient.Object.Room!.State = MultiplayerRoomState.Open;
|
multiplayerClient.Object.Room!.State = MultiplayerRoomState.Open;
|
||||||
raiseRoomUpdated();
|
raiseRoomUpdated();
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// Ready
|
// Ready
|
||||||
ClickButtonWhenEnabled<MultiplayerReadyButton>();
|
ClickButtonWhenEnabled<MultiplayerReadyButton>();
|
||||||
|
|
||||||
// Start match
|
// Start match
|
||||||
ClickButtonWhenEnabled<MultiplayerReadyButton>();
|
ClickButtonWhenEnabled<MultiplayerReadyButton>();
|
||||||
|
AddUntilStep("countdown button disabled", () => !this.ChildrenOfType<MultiplayerCountdownButton>().Single().Enabled.Value);
|
||||||
|
|
||||||
// Abort
|
// Abort
|
||||||
ClickButtonWhenEnabled<MultiplayerReadyButton>();
|
ClickButtonWhenEnabled<MultiplayerReadyButton>();
|
||||||
|
@ -223,6 +223,9 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
|
|||||||
if (!Client.IsHost)
|
if (!Client.IsHost)
|
||||||
readyButton.Enabled.Value &= Room.State == MultiplayerRoomState.Open;
|
readyButton.Enabled.Value &= Room.State == MultiplayerRoomState.Open;
|
||||||
|
|
||||||
|
// At all times, the countdown button should only be enabled when no match is in progress.
|
||||||
|
countdownButton.Enabled.Value &= Room.State == MultiplayerRoomState.Open;
|
||||||
|
|
||||||
if (newCountReady == countReady)
|
if (newCountReady == countReady)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user