mirror of
https://github.com/ppy/osu.git
synced 2025-01-29 00:32:57 +08:00
Add loading layer to multi song select to show during settings confirmation
This commit is contained in:
parent
12876d7fb6
commit
30357a9447
@ -2,12 +2,14 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Threading;
|
||||||
using Humanizer;
|
using Humanizer;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Logging;
|
using osu.Framework.Logging;
|
||||||
using osu.Framework.Screens;
|
using osu.Framework.Screens;
|
||||||
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Online.Multiplayer;
|
using osu.Game.Online.Multiplayer;
|
||||||
using osu.Game.Online.RealtimeMultiplayer;
|
using osu.Game.Online.RealtimeMultiplayer;
|
||||||
using osu.Game.Screens.Select;
|
using osu.Game.Screens.Select;
|
||||||
@ -26,11 +28,19 @@ namespace osu.Game.Screens.Multi.RealtimeMultiplayer
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private StatefulMultiplayerClient client { get; set; }
|
private StatefulMultiplayerClient client { get; set; }
|
||||||
|
|
||||||
|
private LoadingLayer loadingLayer;
|
||||||
|
|
||||||
public RealtimeMatchSongSelect()
|
public RealtimeMatchSongSelect()
|
||||||
{
|
{
|
||||||
Padding = new MarginPadding { Horizontal = HORIZONTAL_OVERFLOW_PADDING };
|
Padding = new MarginPadding { Horizontal = HORIZONTAL_OVERFLOW_PADDING };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load()
|
||||||
|
{
|
||||||
|
AddInternal(loadingLayer = new LoadingLayer(Carousel));
|
||||||
|
}
|
||||||
|
|
||||||
protected override bool OnStart()
|
protected override bool OnStart()
|
||||||
{
|
{
|
||||||
var item = new PlaylistItem();
|
var item = new PlaylistItem();
|
||||||
@ -45,13 +55,20 @@ namespace osu.Game.Screens.Multi.RealtimeMultiplayer
|
|||||||
// Otherwise, update the playlist directly in preparation for it to be submitted to the API on match creation.
|
// Otherwise, update the playlist directly in preparation for it to be submitted to the API on match creation.
|
||||||
if (client.Room != null)
|
if (client.Room != null)
|
||||||
{
|
{
|
||||||
client.ChangeSettings(item: item).ContinueWith(t => Schedule(() =>
|
loadingLayer.Show();
|
||||||
|
|
||||||
|
client.ChangeSettings(item: item).ContinueWith(t =>
|
||||||
{
|
{
|
||||||
|
return Schedule(() =>
|
||||||
|
{
|
||||||
|
loadingLayer.Hide();
|
||||||
|
|
||||||
if (t.IsCompletedSuccessfully)
|
if (t.IsCompletedSuccessfully)
|
||||||
this.Exit();
|
this.Exit();
|
||||||
else
|
else
|
||||||
Logger.Log($"Could not use current beatmap ({t.Exception?.Message})", level: LogLevel.Important);
|
Logger.Log($"Could not use current beatmap ({t.Exception?.Message})", level: LogLevel.Important);
|
||||||
}));
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user