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