2023-06-22 16:37:25 +00:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
2020-07-16 08:35:02 +00:00
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Shapes;
|
|
|
|
|
using osu.Game.Rulesets.Mania.UI;
|
|
|
|
|
using osu.Game.Rulesets.UI.Scrolling;
|
|
|
|
|
using osu.Game.Tests.Visual;
|
|
|
|
|
using osuTK;
|
|
|
|
|
using osuTK.Graphics;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Mania.Tests
|
|
|
|
|
{
|
2022-11-24 05:32:20 +00:00
|
|
|
|
public partial class TestScenePlayfieldCoveringContainer : OsuTestScene
|
2020-07-16 08:35:02 +00:00
|
|
|
|
{
|
|
|
|
|
private readonly ScrollingTestContainer scrollingContainer;
|
2020-07-16 12:18:24 +00:00
|
|
|
|
private readonly PlayfieldCoveringWrapper cover;
|
2020-07-16 08:35:02 +00:00
|
|
|
|
|
|
|
|
|
public TestScenePlayfieldCoveringContainer()
|
|
|
|
|
{
|
|
|
|
|
Child = scrollingContainer = new ScrollingTestContainer(ScrollingDirection.Down)
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
Size = new Vector2(300, 500),
|
2020-07-16 12:18:24 +00:00
|
|
|
|
Child = cover = new PlayfieldCoveringWrapper(new Box
|
2020-07-16 12:17:51 +00:00
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
Colour = Color4.Orange
|
|
|
|
|
})
|
2020-07-16 08:35:02 +00:00
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void TestScrollingDownwards()
|
|
|
|
|
{
|
|
|
|
|
AddStep("set down scroll", () => scrollingContainer.Direction = ScrollingDirection.Down);
|
2024-02-06 14:32:54 +00:00
|
|
|
|
AddStep("set coverage = 0.5", () => cover.Coverage.Value = 0.5f);
|
|
|
|
|
AddStep("set coverage = 0.8f", () => cover.Coverage.Value = 0.8f);
|
|
|
|
|
AddStep("set coverage = 0.2f", () => cover.Coverage.Value = 0.2f);
|
2020-07-16 08:35:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void TestScrollingUpwards()
|
|
|
|
|
{
|
|
|
|
|
AddStep("set up scroll", () => scrollingContainer.Direction = ScrollingDirection.Up);
|
2024-02-06 14:32:54 +00:00
|
|
|
|
AddStep("set coverage = 0.5", () => cover.Coverage.Value = 0.5f);
|
|
|
|
|
AddStep("set coverage = 0.8f", () => cover.Coverage.Value = 0.8f);
|
|
|
|
|
AddStep("set coverage = 0.2f", () => cover.Coverage.Value = 0.2f);
|
2020-07-16 08:35:02 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|