1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-23 01:37:31 +08:00

Ensure operations are not performed during loading

This commit is contained in:
Dean Herbert 2021-08-05 14:14:07 +09:00
parent 22bd6c7556
commit bf720f7e06
3 changed files with 14 additions and 0 deletions

View File

@ -25,6 +25,8 @@ namespace osu.Game.Screens.OnlinePlay.Match.Components
protected abstract OsuButton SubmitButton { get; }
protected abstract bool IsLoading { get; }
[BackgroundDependencyLoader]
private void load()
{
@ -52,6 +54,9 @@ namespace osu.Game.Screens.OnlinePlay.Match.Components
switch (action)
{
case GlobalAction.Select:
if (IsLoading)
return true;
if (SubmitButton.Enabled.Value)
{
SubmitButton.TriggerClick();

View File

@ -32,6 +32,11 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
protected override OsuButton SubmitButton => settings.ApplyButton;
[Resolved]
private OngoingOperationTracker ongoingOperationTracker { get; set; }
protected override bool IsLoading => ongoingOperationTracker.InProgress.Value;
protected override void SelectBeatmap() => settings.SelectBeatmap();
protected override OnlinePlayComposite CreateSettings()

View File

@ -30,6 +30,8 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
protected override OsuButton SubmitButton => settings.ApplyButton;
protected override bool IsLoading => settings.IsLoading; // should probably be replaced with an OngoingOperationTracker.
protected override void SelectBeatmap() => EditPlaylist();
protected override OnlinePlayComposite CreateSettings()
@ -51,6 +53,8 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
public RoomAvailabilityPicker AvailabilityPicker;
public TriangleButton ApplyButton;
public bool IsLoading => loadingLayer.State.Value == Visibility.Visible;
public OsuSpriteText ErrorText;
private LoadingLayer loadingLayer;