1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-28 10:17:19 +08:00

Merge branch 'centralise-loading-animations' into use-loading-inbeatmap-listing

This commit is contained in:
Dean Herbert 2020-02-21 17:01:13 +09:00
commit 0b589eff45
3 changed files with 25 additions and 7 deletions

View File

@ -21,12 +21,14 @@ namespace osu.Game.Tests.Visual.UserInterface
public override IReadOnlyList<Type> RequiredTypes => new[] { typeof(LoadingSpinner) }; public override IReadOnlyList<Type> RequiredTypes => new[] { typeof(LoadingSpinner) };
private Container content;
[SetUp] [SetUp]
public void SetUp() => Schedule(() => public void SetUp() => Schedule(() =>
{ {
Children = new[] Children = new[]
{ {
new Container content = new Container
{ {
Size = new Vector2(300), Size = new Vector2(300),
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
@ -60,7 +62,7 @@ namespace osu.Game.Tests.Visual.UserInterface
}); });
[Test] [Test]
public void ShowHide() public void TestShowHide()
{ {
AddAssert("not visible", () => !overlay.IsPresent); AddAssert("not visible", () => !overlay.IsPresent);
@ -74,7 +76,7 @@ namespace osu.Game.Tests.Visual.UserInterface
} }
[Test] [Test]
public void ContentRestoreOnDispose() public void TestContentRestoreOnDispose()
{ {
AddAssert("not visible", () => !overlay.IsPresent); AddAssert("not visible", () => !overlay.IsPresent);
@ -82,9 +84,23 @@ namespace osu.Game.Tests.Visual.UserInterface
AddUntilStep("wait for content dim", () => dimContent.Colour != Color4.White); AddUntilStep("wait for content dim", () => dimContent.Colour != Color4.White);
AddStep("hide", () => overlay.Expire()); AddStep("expire", () => overlay.Expire());
AddUntilStep("wait for content restore", () => dimContent.Colour == Color4.White); AddUntilStep("wait for content restore", () => dimContent.Colour == Color4.White);
} }
[Test]
public void TestLargeArea()
{
AddStep("show", () =>
{
content.RelativeSizeAxes = Axes.Both;
content.Size = new Vector2(1);
overlay.Show();
});
AddStep("hide", () => overlay.Hide());
}
} }
} }

View File

@ -8,9 +8,9 @@ using osuTK.Graphics;
namespace osu.Game.Tests.Visual.UserInterface namespace osu.Game.Tests.Visual.UserInterface
{ {
public class TestSceneLoadingAnimation : OsuGridTestScene public class TestSceneLoadingSpinner : OsuGridTestScene
{ {
public TestSceneLoadingAnimation() public TestSceneLoadingSpinner()
: base(2, 2) : base(2, 2)
{ {
LoadingSpinner loading; LoadingSpinner loading;
@ -34,7 +34,7 @@ namespace osu.Game.Tests.Visual.UserInterface
Colour = Color4.White, Colour = Color4.White,
RelativeSizeAxes = Axes.Both RelativeSizeAxes = Axes.Both
}, },
loading = new LoadingSpinner() loading = new LoadingSpinner(true)
}); });
loading.Show(); loading.Show();

View File

@ -35,6 +35,8 @@ namespace osu.Game.Graphics.UserInterface
MainContents.RelativeSizeAxes = Axes.None; MainContents.RelativeSizeAxes = Axes.None;
} }
public override bool HandleNonPositionalInput => false;
protected override bool Handle(UIEvent e) protected override bool Handle(UIEvent e)
{ {
switch (e) switch (e)