Add loading spinner in case load takes longer than expected

This commit is contained in:
Dean Herbert 2021-09-07 14:34:47 +09:00
parent ddaa95a1ca
commit 7921ad4516
1 changed files with 16 additions and 3 deletions

View File

@ -6,6 +6,7 @@
using osu.Framework.Screens; using osu.Framework.Screens;
using osu.Framework.Threading; using osu.Framework.Threading;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Graphics.UserInterface;
using osu.Game.Screens.Menu; using osu.Game.Screens.Menu;
namespace osu.Game.Screens.Edit namespace osu.Game.Screens.Edit
@ -43,10 +44,16 @@ protected override void LogoArriving(OsuLogo logo, bool resuming)
} }
} }
private void pushEditor() [BackgroundDependencyLoader]
private void load()
{ {
this.Push(new Editor(this)); AddRangeInternal(new Drawable[]
ValidForResume = false; {
new LoadingSpinner(true)
{
State = { Value = Visibility.Visible },
}
});
} }
public void ScheduleDifficultySwitch(BeatmapInfo beatmapInfo) public void ScheduleDifficultySwitch(BeatmapInfo beatmapInfo)
@ -62,6 +69,12 @@ public void ScheduleDifficultySwitch(BeatmapInfo beatmapInfo)
}); });
} }
private void pushEditor()
{
this.Push(new Editor(this));
ValidForResume = false;
}
public void CancelPendingDifficultySwitch() public void CancelPendingDifficultySwitch()
{ {
scheduledDifficultySwitch?.Cancel(); scheduledDifficultySwitch?.Cancel();