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) };
private Container content;
[SetUp]
public void SetUp() => Schedule(() =>
{
Children = new[]
{
new Container
content = new Container
{
Size = new Vector2(300),
Anchor = Anchor.Centre,
@ -60,7 +62,7 @@ namespace osu.Game.Tests.Visual.UserInterface
});
[Test]
public void ShowHide()
public void TestShowHide()
{
AddAssert("not visible", () => !overlay.IsPresent);
@ -74,7 +76,7 @@ namespace osu.Game.Tests.Visual.UserInterface
}
[Test]
public void ContentRestoreOnDispose()
public void TestContentRestoreOnDispose()
{
AddAssert("not visible", () => !overlay.IsPresent);
@ -82,9 +84,23 @@ namespace osu.Game.Tests.Visual.UserInterface
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);
}
[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
{
public class TestSceneLoadingAnimation : OsuGridTestScene
public class TestSceneLoadingSpinner : OsuGridTestScene
{
public TestSceneLoadingAnimation()
public TestSceneLoadingSpinner()
: base(2, 2)
{
LoadingSpinner loading;
@ -34,7 +34,7 @@ namespace osu.Game.Tests.Visual.UserInterface
Colour = Color4.White,
RelativeSizeAxes = Axes.Both
},
loading = new LoadingSpinner()
loading = new LoadingSpinner(true)
});
loading.Show();

View File

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