1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 14:17:26 +08:00

Remove notification blocking behaviour of first run setup

This commit is contained in:
Dean Herbert 2022-08-31 00:57:18 +09:00
parent ed11b1ba6f
commit a62ba9e0d9
2 changed files with 2 additions and 17 deletions

View File

@ -26,16 +26,7 @@ namespace osu.Game.Tests.Visual.Navigation
public void TestImportantNotificationDoesntInterruptSetup()
{
AddStep("post important notification", () => Game.Notifications.Post(new SimpleNotification { Text = "Important notification" }));
AddAssert("no notification posted", () => Game.Notifications.UnreadCount.Value == 0);
AddAssert("first-run setup still visible", () => Game.FirstRunOverlay.State.Value == Visibility.Visible);
AddUntilStep("finish first-run setup", () =>
{
Game.FirstRunOverlay.NextButton.TriggerClick();
return Game.FirstRunOverlay.State.Value == Visibility.Hidden;
});
AddWaitStep("wait for post delay", 5);
AddAssert("notifications shown", () => Game.Notifications.State.Value == Visibility.Visible);
AddAssert("notification posted", () => Game.Notifications.UnreadCount.Value == 1);
}

View File

@ -38,8 +38,6 @@ namespace osu.Game.Overlays
[Cached]
private OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Purple);
private readonly IBindable<Visibility> firstRunSetupVisibility = new Bindable<Visibility>();
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos)
{
if (State.Value == Visibility.Visible)
@ -58,7 +56,7 @@ namespace osu.Game.Overlays
private Container mainContent = null!;
[BackgroundDependencyLoader]
private void load(FirstRunSetupOverlay? firstRunSetup)
private void load()
{
X = WIDTH;
Width = WIDTH;
@ -104,16 +102,13 @@ namespace osu.Game.Overlays
}
},
};
if (firstRunSetup != null)
firstRunSetupVisibility.BindTo(firstRunSetup.State);
}
private ScheduledDelegate? notificationsEnabler;
private void updateProcessingMode()
{
bool enabled = (OverlayActivationMode.Value == OverlayActivation.All && firstRunSetupVisibility.Value != Visibility.Visible) || State.Value == Visibility.Visible;
bool enabled = OverlayActivationMode.Value == OverlayActivation.All || State.Value == Visibility.Visible;
notificationsEnabler?.Cancel();
@ -129,7 +124,6 @@ namespace osu.Game.Overlays
base.LoadComplete();
State.BindValueChanged(_ => updateProcessingMode());
firstRunSetupVisibility.BindValueChanged(_ => updateProcessingMode());
OverlayActivationMode.BindValueChanged(_ => updateProcessingMode(), true);
}