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:
parent
22bd6c7556
commit
bf720f7e06
@ -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();
|
||||
|
@ -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()
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user