mirror of
https://github.com/ppy/osu.git
synced 2025-02-22 22:32:54 +08:00
Ensure externally run operations on LoungeSubScreen
are run after load is completed
This commit is contained in:
parent
ec3ce57bb9
commit
a5736085a9
@ -177,7 +177,7 @@ namespace osu.Game.Screens.OnlinePlay.Lounge
|
|||||||
this.HidePopover();
|
this.HidePopover();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Join(Room room, string password)
|
public void Join(Room room, string password) => Schedule(() =>
|
||||||
{
|
{
|
||||||
if (joiningRoomOperation != null)
|
if (joiningRoomOperation != null)
|
||||||
return;
|
return;
|
||||||
@ -194,25 +194,22 @@ namespace osu.Game.Screens.OnlinePlay.Lounge
|
|||||||
joiningRoomOperation?.Dispose();
|
joiningRoomOperation?.Dispose();
|
||||||
joiningRoomOperation = null;
|
joiningRoomOperation = null;
|
||||||
});
|
});
|
||||||
}
|
});
|
||||||
|
|
||||||
private void updateLoadingLayer()
|
|
||||||
{
|
|
||||||
if (operationInProgress.Value || !initialRoomsReceived.Value)
|
|
||||||
loadingLayer.Show();
|
|
||||||
else
|
|
||||||
loadingLayer.Hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Push a room as a new subscreen.
|
/// Push a room as a new subscreen.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual void Open(Room room)
|
public void Open(Room room) => Schedule(() =>
|
||||||
{
|
{
|
||||||
// Handles the case where a room is clicked 3 times in quick succession
|
// Handles the case where a room is clicked 3 times in quick succession
|
||||||
if (!this.IsCurrentScreen())
|
if (!this.IsCurrentScreen())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
OpenNewRoom(room);
|
||||||
|
});
|
||||||
|
|
||||||
|
protected virtual void OpenNewRoom(Room room)
|
||||||
|
{
|
||||||
selectedRoom.Value = room;
|
selectedRoom.Value = room;
|
||||||
|
|
||||||
this.Push(CreateRoomSubScreen(room));
|
this.Push(CreateRoomSubScreen(room));
|
||||||
@ -221,5 +218,13 @@ namespace osu.Game.Screens.OnlinePlay.Lounge
|
|||||||
protected abstract FilterControl CreateFilterControl();
|
protected abstract FilterControl CreateFilterControl();
|
||||||
|
|
||||||
protected abstract RoomSubScreen CreateRoomSubScreen(Room room);
|
protected abstract RoomSubScreen CreateRoomSubScreen(Room room);
|
||||||
|
|
||||||
|
private void updateLoadingLayer()
|
||||||
|
{
|
||||||
|
if (operationInProgress.Value || !initialRoomsReceived.Value)
|
||||||
|
loadingLayer.Show();
|
||||||
|
else
|
||||||
|
loadingLayer.Hide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,15 +20,15 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private MultiplayerClient client { get; set; }
|
private MultiplayerClient client { get; set; }
|
||||||
|
|
||||||
public override void Open(Room room)
|
protected override void OpenNewRoom(Room room)
|
||||||
{
|
{
|
||||||
if (!client.IsConnected.Value)
|
if (client?.IsConnected.Value != true)
|
||||||
{
|
{
|
||||||
Logger.Log("Not currently connected to the multiplayer server.", LoggingTarget.Runtime, LogLevel.Important);
|
Logger.Log("Not currently connected to the multiplayer server.", LoggingTarget.Runtime, LogLevel.Important);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
base.Open(room);
|
base.OpenNewRoom(room);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user