1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-30 19:32:54 +08:00
osu-lazer/osu.Game.Tests/Visual/Editing/TestSceneEditorComposeRadioButtons.cs

48 lines
1.7 KiB
C#
Raw Normal View History

// 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.
2018-04-13 17:19:50 +08:00
2022-06-17 15:37:17 +08:00
#nullable disable
2018-04-13 17:19:50 +08:00
using NUnit.Framework;
using osu.Framework.Allocation;
2018-04-13 17:19:50 +08:00
using osu.Framework.Graphics;
2020-09-09 17:35:25 +08:00
using osu.Framework.Graphics.Sprites;
using osu.Game.Overlays;
2018-11-06 17:14:46 +08:00
using osu.Game.Screens.Edit.Components.RadioButtons;
2018-04-13 17:19:50 +08:00
namespace osu.Game.Tests.Visual.Editing
2018-04-13 17:19:50 +08:00
{
[TestFixture]
2022-11-24 13:32:20 +08:00
public partial class TestSceneEditorComposeRadioButtons : OsuTestScene
2018-04-13 17:19:50 +08:00
{
[Cached]
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Aquamarine);
public TestSceneEditorComposeRadioButtons()
2018-04-13 17:19:50 +08:00
{
EditorRadioButtonCollection collection;
Add(collection = new EditorRadioButtonCollection
2018-04-13 17:19:50 +08:00
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Width = 150,
Items = new[]
{
new RadioButton("Item 1", () => { }),
new RadioButton("Item 2", () => { }),
2020-09-09 17:35:25 +08:00
new RadioButton("Item 3", () => { }, () => new SpriteIcon { Icon = FontAwesome.Regular.Angry }),
2018-04-13 17:19:50 +08:00
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());
}
}
}
}