mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 12:42:54 +08:00
43 lines
1.3 KiB
C#
43 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.
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
using osu.Game.Overlays.Toolbar;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using osu.Framework.Graphics;
|
|
using System.Linq;
|
|
using osu.Framework.MathUtils;
|
|
|
|
namespace osu.Game.Tests.Visual.UserInterface
|
|
{
|
|
public class TestSceneToolbarRulesetSelector : OsuTestScene
|
|
{
|
|
public override IReadOnlyList<Type> RequiredTypes => new[]
|
|
{
|
|
typeof(ToolbarRulesetSelector),
|
|
typeof(ToolbarRulesetTabButton),
|
|
};
|
|
|
|
public TestSceneToolbarRulesetSelector()
|
|
{
|
|
ToolbarRulesetSelector selector;
|
|
|
|
Add(new Container
|
|
{
|
|
Anchor = Anchor.Centre,
|
|
Origin = Anchor.Centre,
|
|
AutoSizeAxes = Axes.X,
|
|
Height = Toolbar.HEIGHT,
|
|
Child = selector = new ToolbarRulesetSelector()
|
|
});
|
|
|
|
AddStep("Select random", () =>
|
|
{
|
|
selector.Current.Value = selector.Items.ElementAt(RNG.Next(selector.Items.Count()));
|
|
});
|
|
AddStep("Toggle disabled state", () => selector.Current.Disabled = !selector.Current.Disabled);
|
|
}
|
|
}
|
|
}
|