mirror of
https://github.com/ppy/osu
synced 2025-02-18 11:26:57 +00:00
Remove necessity of AlwaysPresent
for ProgressUpdate
completion posting
This commit is contained in:
parent
0d4ee6bd80
commit
f754686521
@ -71,7 +71,6 @@ namespace osu.Game.Overlays
|
||||
},
|
||||
mainContent = new Container
|
||||
{
|
||||
AlwaysPresent = true,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
@ -137,9 +136,9 @@ namespace osu.Game.Overlays
|
||||
|
||||
private readonly Scheduler postScheduler = new Scheduler();
|
||||
|
||||
public override bool IsPresent => base.IsPresent
|
||||
|| postScheduler.HasPendingTasks
|
||||
|| toastTray.IsDisplayingToasts;
|
||||
public override bool IsPresent =>
|
||||
// Delegate presence as we need to consider the toast tray in addition to the main overlay.
|
||||
State.Value == Visibility.Visible || mainContent.IsPresent || toastTray.IsPresent || postScheduler.HasPendingTasks;
|
||||
|
||||
private bool processingPosts = true;
|
||||
|
||||
|
@ -70,7 +70,7 @@ namespace osu.Game.Overlays
|
||||
postEffectDrawable.AutoSizeAxes = Axes.None;
|
||||
postEffectDrawable.RelativeSizeAxes = Axes.X;
|
||||
})),
|
||||
toastFlow = new AlwaysUpdateFillFlowContainer<Notification>
|
||||
toastFlow = new FillFlowContainer<Notification>
|
||||
{
|
||||
LayoutDuration = 150,
|
||||
LayoutEasing = Easing.OutQuart,
|
||||
|
@ -88,7 +88,12 @@ namespace osu.Game.Overlays.Notifications
|
||||
state = value;
|
||||
|
||||
if (IsLoaded)
|
||||
{
|
||||
Schedule(updateState);
|
||||
|
||||
if (state == ProgressNotificationState.Completed)
|
||||
CompletionTarget?.Invoke(CreateCompletionNotification());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -141,7 +146,7 @@ namespace osu.Game.Overlays.Notifications
|
||||
|
||||
case ProgressNotificationState.Completed:
|
||||
loadingSpinner.Hide();
|
||||
Completed();
|
||||
base.Close();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -154,12 +159,6 @@ namespace osu.Game.Overlays.Notifications
|
||||
Text = CompletionText
|
||||
};
|
||||
|
||||
protected void Completed()
|
||||
{
|
||||
CompletionTarget?.Invoke(CreateCompletionNotification());
|
||||
base.Close();
|
||||
}
|
||||
|
||||
public override bool DisplayOnTop => false;
|
||||
|
||||
public override bool IsImportant => false;
|
||||
|
Loading…
Reference in New Issue
Block a user