mirror of
https://github.com/ppy/osu.git
synced 2024-12-18 13:52:54 +08:00
Use notification processing mode logic instead
This commit is contained in:
parent
ddeee09a51
commit
026bad7fc4
@ -38,6 +38,8 @@ namespace osu.Game.Overlays
|
|||||||
[Resolved(canBeNull: true)]
|
[Resolved(canBeNull: true)]
|
||||||
private FirstRunSetupOverlay firstRunSetup { get; set; }
|
private FirstRunSetupOverlay firstRunSetup { get; set; }
|
||||||
|
|
||||||
|
private IBindable<Visibility> firstRunSetupState;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
@ -84,7 +86,7 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
private void updateProcessingMode()
|
private void updateProcessingMode()
|
||||||
{
|
{
|
||||||
bool enabled = OverlayActivationMode.Value == OverlayActivation.All || State.Value == Visibility.Visible;
|
bool enabled = (OverlayActivationMode.Value == OverlayActivation.All && firstRunSetupState?.Value != Visibility.Visible) || State.Value == Visibility.Visible;
|
||||||
|
|
||||||
notificationsEnabler?.Cancel();
|
notificationsEnabler?.Cancel();
|
||||||
|
|
||||||
@ -100,6 +102,10 @@ namespace osu.Game.Overlays
|
|||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
State.ValueChanged += _ => updateProcessingMode();
|
State.ValueChanged += _ => updateProcessingMode();
|
||||||
|
|
||||||
|
firstRunSetupState = firstRunSetup.State.GetBoundCopy();
|
||||||
|
firstRunSetupState.ValueChanged += _ => updateProcessingMode();
|
||||||
|
|
||||||
OverlayActivationMode.BindValueChanged(_ => updateProcessingMode(), true);
|
OverlayActivationMode.BindValueChanged(_ => updateProcessingMode(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,9 +139,7 @@ namespace osu.Game.Overlays
|
|||||||
var section = sections.Children.FirstOrDefault(s => s.AcceptTypes.Any(accept => accept.IsAssignableFrom(ourType)));
|
var section = sections.Children.FirstOrDefault(s => s.AcceptTypes.Any(accept => accept.IsAssignableFrom(ourType)));
|
||||||
section?.Add(notification, notification.DisplayOnTop ? -runningDepth : runningDepth);
|
section?.Add(notification, notification.DisplayOnTop ? -runningDepth : runningDepth);
|
||||||
|
|
||||||
// we don't want important notifications interrupting user on first-run setup.
|
if (notification.IsImportant)
|
||||||
// (this can happen when importing beatmaps inside setup, which posts import notifications)
|
|
||||||
if (notification.IsImportant && firstRunSetup?.State.Value != Visibility.Visible)
|
|
||||||
Show();
|
Show();
|
||||||
|
|
||||||
updateCounts();
|
updateCounts();
|
||||||
|
Loading…
Reference in New Issue
Block a user