1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-21 10:32:55 +08:00
osu-lazer/osu.Game.Tests/Visual/UserInterface/TestSceneModFlowDisplay.cs
2022-06-17 16:37:17 +09:00

52 lines
1.3 KiB
C#

// 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.
#nullable disable
using System.Linq;
using NUnit.Framework;
using osu.Framework.Graphics;
using osu.Game.Rulesets.Osu;
using osu.Game.Screens.Play.HUD;
namespace osu.Game.Tests.Visual.UserInterface
{
public class TestSceneModFlowDisplay : OsuTestScene
{
private ModFlowDisplay modFlow;
[SetUp]
public void SetUp() => Schedule(() =>
{
Child = modFlow = new ModFlowDisplay
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.None,
Width = 200,
Current =
{
Value = new OsuRuleset().CreateAllMods().ToArray(),
}
};
});
[Test]
public void TestWrapping()
{
AddSliderStep("icon size", 0.1f, 2, 1, val =>
{
if (modFlow != null)
modFlow.IconScale = val;
});
AddSliderStep("flow width", 100, 500, 200, val =>
{
if (modFlow != null)
modFlow.Width = val;
});
}
}
}