1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 14:02:55 +08:00
osu-lazer/osu.Game.Tests/Visual/Editing/TestSceneEditorComposeRadioButtons.cs
2022-11-27 00:00:27 +09:00

48 lines
1.7 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 NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Game.Overlays;
using osu.Game.Screens.Edit.Components.RadioButtons;
namespace osu.Game.Tests.Visual.Editing
{
[TestFixture]
public partial class TestSceneEditorComposeRadioButtons : OsuTestScene
{
[Cached]
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Aquamarine);
public TestSceneEditorComposeRadioButtons()
{
EditorRadioButtonCollection collection;
Add(collection = new EditorRadioButtonCollection
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Width = 150,
Items = new[]
{
new RadioButton("Item 1", () => { }),
new RadioButton("Item 2", () => { }),
new RadioButton("Item 3", () => { }, () => new SpriteIcon { Icon = FontAwesome.Regular.Angry }),
new RadioButton("Item 4", () => { }),
new RadioButton("Item 5", () => { })
}
});
for (int i = 0; i < collection.Items.Count; i++)
{
int l = i;
AddStep($"Select item {l + 1}", () => collection.Items[l].Select());
AddStep($"Deselect item {l + 1}", () => collection.Items[l].Deselect());
}
}
}
}