mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 07:32:55 +08:00
Merge branch 'master' into net5.0
This commit is contained in:
commit
c3049f431a
@ -52,6 +52,7 @@ namespace osu.Game.Online.Multiplayer
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether the <see cref="StatefulMultiplayerClient"/> is currently connected.
|
/// Whether the <see cref="StatefulMultiplayerClient"/> is currently connected.
|
||||||
|
/// This is NOT thread safe and usage should be scheduled.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract IBindable<bool> IsConnected { get; }
|
public abstract IBindable<bool> IsConnected { get; }
|
||||||
|
|
||||||
|
@ -34,8 +34,8 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
|||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
isConnected.BindValueChanged(_ => updateState());
|
isConnected.BindValueChanged(_ => Scheduler.AddOnce(updateState));
|
||||||
operationInProgress.BindValueChanged(_ => updateState(), true);
|
operationInProgress.BindValueChanged(_ => Scheduler.AddOnce(updateState), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateState() => Enabled.Value = isConnected.Value && !operationInProgress.Value;
|
private void updateState() => Enabled.Value = isConnected.Value && !operationInProgress.Value;
|
||||||
|
@ -77,14 +77,14 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
|||||||
});
|
});
|
||||||
|
|
||||||
isConnected = client.IsConnected.GetBoundCopy();
|
isConnected = client.IsConnected.GetBoundCopy();
|
||||||
isConnected.BindValueChanged(connected =>
|
isConnected.BindValueChanged(connected => Schedule(() =>
|
||||||
{
|
{
|
||||||
if (!connected.NewValue)
|
if (!connected.NewValue)
|
||||||
{
|
{
|
||||||
// messaging to the user about this disconnect will be provided by the MultiplayerMatchSubScreen.
|
// messaging to the user about this disconnect will be provided by the MultiplayerMatchSubScreen.
|
||||||
failAndBail();
|
failAndBail();
|
||||||
}
|
}
|
||||||
}, true);
|
}), true);
|
||||||
|
|
||||||
Debug.Assert(client.Room != null);
|
Debug.Assert(client.Room != null);
|
||||||
}
|
}
|
||||||
|
@ -34,10 +34,8 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
|||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
isConnected.BindTo(multiplayerClient.IsConnected);
|
isConnected.BindTo(multiplayerClient.IsConnected);
|
||||||
isConnected.BindValueChanged(_ => Schedule(updatePolling));
|
isConnected.BindValueChanged(_ => Scheduler.AddOnce(updatePolling));
|
||||||
JoinedRoom.BindValueChanged(_ => updatePolling());
|
JoinedRoom.BindValueChanged(_ => Scheduler.AddOnce(updatePolling), true);
|
||||||
|
|
||||||
updatePolling();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void CreateRoom(Room room, Action<Room> onSuccess = null, Action<string> onError = null)
|
public override void CreateRoom(Room room, Action<Room> onSuccess = null, Action<string> onError = null)
|
||||||
|
@ -500,7 +500,7 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
if (beatmap != null)
|
if (beatmap != null)
|
||||||
{
|
{
|
||||||
if (beatmap.BeatmapSetInfoID == beatmapNoDebounce?.BeatmapSetInfoID)
|
if (beatmap.BeatmapSetInfoID == previous?.BeatmapInfo.BeatmapSetInfoID)
|
||||||
sampleChangeDifficulty.Play();
|
sampleChangeDifficulty.Play();
|
||||||
else
|
else
|
||||||
sampleChangeBeatmap.Play();
|
sampleChangeBeatmap.Play();
|
||||||
|
Loading…
Reference in New Issue
Block a user