Make scheduling more legible

This commit is contained in:
Salman Ahmed 2022-07-14 06:06:56 +03:00
parent f83d413b33
commit 3def8428aa

View File

@ -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;