mirror of
https://github.com/osukey/osukey.git
synced 2025-07-25 04:10:03 +09:00
Make visual test more visible
This commit is contained in:
@ -4,11 +4,8 @@
|
|||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Colour;
|
using osu.Framework.Graphics.Colour;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Graphics.Sprites;
|
|
||||||
using osu.Game.Graphics;
|
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Graphics.Sprites;
|
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
|
|
||||||
@ -18,8 +15,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
public class TestSceneOsuHoverContainer : ManualInputManagerTestScene
|
public class TestSceneOsuHoverContainer : ManualInputManagerTestScene
|
||||||
{
|
{
|
||||||
private OsuHoverTestContainer hoverContainer;
|
private OsuHoverTestContainer hoverContainer;
|
||||||
private OsuSpriteText textContainer;
|
private Box colourContainer;
|
||||||
private ColourInfo currentColour => textContainer.DrawColourInfo.Colour;
|
|
||||||
|
|
||||||
[SetUp]
|
[SetUp]
|
||||||
public void SetUp() => Schedule(() =>
|
public void SetUp() => Schedule(() =>
|
||||||
@ -28,19 +24,11 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
AutoSizeAxes = Axes.Both,
|
Size = new Vector2(100),
|
||||||
Child = new FillFlowContainer<SpriteText>
|
Child = colourContainer = new Box
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Children = new[]
|
|
||||||
{
|
|
||||||
textContainer = new OsuSpriteText
|
|
||||||
{
|
|
||||||
Text = "Test",
|
|
||||||
Font = OsuFont.GetFont(weight: FontWeight.Medium, size: 20),
|
|
||||||
},
|
},
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -192,6 +180,8 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
private void waitUntilColourIs(ColourInfo expectedColour)
|
private void waitUntilColourIs(ColourInfo expectedColour)
|
||||||
=> AddUntilStep($"Wait until hover colour is {expectedColour}", () => currentColour.Equals(expectedColour));
|
=> AddUntilStep($"Wait until hover colour is {expectedColour}", () => currentColour.Equals(expectedColour));
|
||||||
|
|
||||||
|
private ColourInfo currentColour => colourContainer.DrawColourInfo.Colour;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Moves the cursor to top left corner of the screen
|
/// Moves the cursor to top left corner of the screen
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Reference in New Issue
Block a user