mirror of
https://github.com/ppy/osu
synced 2024-12-14 02:46:27 +00:00
Make scheduling more legible
This commit is contained in:
parent
f83d413b33
commit
3def8428aa
@ -57,7 +57,12 @@ namespace osu.Game.Overlays
|
||||
// a DialogOverlay instance has finished loading.
|
||||
CurrentDialog = dialog;
|
||||
|
||||
Scheduler.Add(() =>
|
||||
if (IsLoaded)
|
||||
Scheduler.Add(pushDialog, false);
|
||||
else
|
||||
Schedule(pushDialog);
|
||||
|
||||
void pushDialog()
|
||||
{
|
||||
// if any existing dialog is being displayed, dismiss it before showing a new one.
|
||||
lastDialog?.Hide();
|
||||
@ -65,7 +70,7 @@ namespace osu.Game.Overlays
|
||||
dialogContainer.Add(dialog);
|
||||
|
||||
Show();
|
||||
}, !IsLoaded);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool IsPresent => Scheduler.HasPendingTasks || dialogContainer.Children.Count > 0;
|
||||
|
Loading…
Reference in New Issue
Block a user