2021-07-21 15:38:18 +08:00
|
|
|
// 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.
|
|
|
|
|
2022-06-17 15:37:17 +08:00
|
|
|
#nullable disable
|
|
|
|
|
2021-07-21 15:38:18 +08:00
|
|
|
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
|
|
|
|
{
|
2022-11-24 13:32:20 +08:00
|
|
|
public partial class TestSceneModFlowDisplay : OsuTestScene
|
2021-07-21 15:38:18 +08:00
|
|
|
{
|
|
|
|
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 =
|
|
|
|
{
|
2021-09-10 10:09:13 +08:00
|
|
|
Value = new OsuRuleset().CreateAllMods().ToArray(),
|
2021-07-21 15:38:18 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
|
|
|
[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;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|