mirror of
https://github.com/osukey/osukey.git
synced 2025-08-08 00:53:56 +09:00
Merge pull request #21166 from peppy/close-side-overlays-when-main-overlay
Closes https://github.com/ppy/osu/issues/21162
This commit is contained in:
@ -513,6 +513,40 @@ namespace osu.Game.Tests.Visual.Navigation
|
|||||||
AddWaitStep("wait two frames", 2);
|
AddWaitStep("wait two frames", 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestMainOverlaysClosesNotificationOverlay()
|
||||||
|
{
|
||||||
|
ChangelogOverlay getChangelogOverlay() => Game.ChildrenOfType<ChangelogOverlay>().FirstOrDefault();
|
||||||
|
|
||||||
|
AddUntilStep("Wait for notifications to load", () => Game.Notifications.IsLoaded);
|
||||||
|
AddStep("Show notifications", () => Game.Notifications.Show());
|
||||||
|
AddUntilStep("wait for notifications shown", () => Game.Notifications.IsPresent && Game.Notifications.State.Value == Visibility.Visible);
|
||||||
|
AddStep("Show changelog listing", () => Game.ShowChangelogListing());
|
||||||
|
AddUntilStep("wait for changelog shown", () => getChangelogOverlay()?.IsPresent == true && getChangelogOverlay()?.State.Value == Visibility.Visible);
|
||||||
|
AddAssert("Notifications is hidden", () => Game.Notifications.State.Value == Visibility.Hidden);
|
||||||
|
|
||||||
|
AddStep("Show notifications", () => Game.Notifications.Show());
|
||||||
|
AddUntilStep("wait for notifications shown", () => Game.Notifications.State.Value == Visibility.Visible);
|
||||||
|
AddUntilStep("changelog still visible", () => getChangelogOverlay().State.Value == Visibility.Visible);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestMainOverlaysClosesSettingsOverlay()
|
||||||
|
{
|
||||||
|
ChangelogOverlay getChangelogOverlay() => Game.ChildrenOfType<ChangelogOverlay>().FirstOrDefault();
|
||||||
|
|
||||||
|
AddUntilStep("Wait for settings to load", () => Game.Settings.IsLoaded);
|
||||||
|
AddStep("Show settings", () => Game.Settings.Show());
|
||||||
|
AddUntilStep("wait for settings shown", () => Game.Settings.IsPresent && Game.Settings.State.Value == Visibility.Visible);
|
||||||
|
AddStep("Show changelog listing", () => Game.ShowChangelogListing());
|
||||||
|
AddUntilStep("wait for changelog shown", () => getChangelogOverlay()?.IsPresent == true && getChangelogOverlay()?.State.Value == Visibility.Visible);
|
||||||
|
AddAssert("Settings is hidden", () => Game.Settings.State.Value == Visibility.Hidden);
|
||||||
|
|
||||||
|
AddStep("Show settings", () => Game.Settings.Show());
|
||||||
|
AddUntilStep("wait for settings shown", () => Game.Settings.State.Value == Visibility.Visible);
|
||||||
|
AddUntilStep("changelog still visible", () => getChangelogOverlay().State.Value == Visibility.Visible);
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestOverlayClosing()
|
public void TestOverlayClosing()
|
||||||
{
|
{
|
||||||
|
@ -1002,6 +1002,9 @@ namespace osu.Game
|
|||||||
{
|
{
|
||||||
otherOverlays.Where(o => o != overlay).ForEach(o => o.Hide());
|
otherOverlays.Where(o => o != overlay).ForEach(o => o.Hide());
|
||||||
|
|
||||||
|
Settings.Hide();
|
||||||
|
Notifications.Hide();
|
||||||
|
|
||||||
// Partially visible so leave it at the current depth.
|
// Partially visible so leave it at the current depth.
|
||||||
if (overlay.IsPresent)
|
if (overlay.IsPresent)
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user