2021-08-07 03:36:40 +08:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
using osu.Framework.Testing;
|
|
|
|
using osu.Game.Overlays;
|
|
|
|
using osu.Game.Tests.Visual.Navigation;
|
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual.Menus
|
|
|
|
{
|
|
|
|
public class TestSceneSideOverlays : OsuGameTestScene
|
|
|
|
{
|
|
|
|
[SetUpSteps]
|
|
|
|
public override void SetUpSteps()
|
|
|
|
{
|
|
|
|
base.SetUpSteps();
|
|
|
|
|
|
|
|
AddAssert("no screen offset applied", () => Game.ScreenOffsetContainer.X == 0f);
|
2021-08-07 05:36:52 +08:00
|
|
|
AddUntilStep("wait for overlays", () => Game.Settings.IsLoaded && Game.Notifications.IsLoaded);
|
2021-08-07 03:36:40 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void TestScreenOffsettingOnSettingsOverlay()
|
|
|
|
{
|
|
|
|
AddStep("open settings", () => Game.Settings.Show());
|
2021-08-13 15:29:36 +08:00
|
|
|
AddUntilStep("right screen offset applied", () => Game.ScreenOffsetContainer.X == SettingsPanel.WIDTH * TestOsuGame.SIDE_OVERLAY_OFFSET_RATIO);
|
2021-08-07 03:36:40 +08:00
|
|
|
|
|
|
|
AddStep("hide settings", () => Game.Settings.Hide());
|
|
|
|
AddUntilStep("screen offset removed", () => Game.ScreenOffsetContainer.X == 0f);
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void TestScreenOffsettingOnNotificationOverlay()
|
|
|
|
{
|
|
|
|
AddStep("open notifications", () => Game.Notifications.Show());
|
2021-08-13 15:29:36 +08:00
|
|
|
AddUntilStep("right screen offset applied", () => Game.ScreenOffsetContainer.X == -NotificationOverlay.WIDTH * TestOsuGame.SIDE_OVERLAY_OFFSET_RATIO);
|
2021-08-07 03:36:40 +08:00
|
|
|
|
|
|
|
AddStep("hide notifications", () => Game.Notifications.Hide());
|
|
|
|
AddUntilStep("screen offset removed", () => Game.ScreenOffsetContainer.X == 0f);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|