2019-01-24 16:43:03 +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.
|
2018-04-13 17:19:50 +08:00
|
|
|
|
2018-03-02 14:34:31 +08:00
|
|
|
using NUnit.Framework;
|
2017-11-30 14:43:19 +08:00
|
|
|
using osu.Framework.Graphics;
|
2020-09-09 17:35:25 +08:00
|
|
|
using osu.Framework.Graphics.Sprites;
|
2018-11-06 17:14:46 +08:00
|
|
|
using osu.Game.Screens.Edit.Components.RadioButtons;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
2020-04-23 16:07:55 +08:00
|
|
|
namespace osu.Game.Tests.Visual.Editing
|
2017-11-30 14:43:19 +08:00
|
|
|
{
|
2018-03-02 14:34:31 +08:00
|
|
|
[TestFixture]
|
2019-05-15 03:37:25 +08:00
|
|
|
public class TestSceneEditorComposeRadioButtons : OsuTestScene
|
2017-11-30 14:43:19 +08:00
|
|
|
{
|
2019-05-15 03:37:25 +08:00
|
|
|
public TestSceneEditorComposeRadioButtons()
|
2017-11-30 14:43:19 +08:00
|
|
|
{
|
2021-07-19 15:57:12 +08:00
|
|
|
EditorRadioButtonCollection collection;
|
|
|
|
Add(collection = new EditorRadioButtonCollection
|
2017-11-30 14:43:19 +08:00
|
|
|
{
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
Width = 150,
|
|
|
|
Items = new[]
|
|
|
|
{
|
2017-11-30 15:57:30 +08:00
|
|
|
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 }),
|
2017-11-30 15:57:30 +08:00
|
|
|
new RadioButton("Item 4", () => { }),
|
|
|
|
new RadioButton("Item 5", () => { })
|
2017-11-30 14:43:19 +08:00
|
|
|
}
|
|
|
|
});
|
2018-04-13 17:19:50 +08:00
|
|
|
|
2017-11-30 18:49:55 +08:00
|
|
|
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());
|
|
|
|
}
|
2017-11-30 14:43:19 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|