2019-06-10 08:35:00 +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.
|
|
|
|
|
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
using osu.Game.Overlays.Toolbar;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using osu.Framework.Graphics;
|
2019-06-10 08:54:15 +08:00
|
|
|
|
using System.Linq;
|
|
|
|
|
using osu.Framework.MathUtils;
|
2019-06-10 08:35:00 +08:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual.UserInterface
|
|
|
|
|
{
|
|
|
|
|
public class TestSceneToolbarRulesetSelector : OsuTestScene
|
|
|
|
|
{
|
|
|
|
|
public override IReadOnlyList<Type> RequiredTypes => new[]
|
|
|
|
|
{
|
|
|
|
|
typeof(ToolbarRulesetSelector),
|
2019-06-13 01:51:21 +08:00
|
|
|
|
typeof(ToolbarRulesetTabButton),
|
2019-06-10 08:35:00 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
public TestSceneToolbarRulesetSelector()
|
|
|
|
|
{
|
|
|
|
|
ToolbarRulesetSelector selector;
|
|
|
|
|
|
|
|
|
|
Add(new Container
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
AutoSizeAxes = Axes.X,
|
|
|
|
|
Height = Toolbar.HEIGHT,
|
|
|
|
|
Child = selector = new ToolbarRulesetSelector()
|
2019-06-10 08:54:15 +08:00
|
|
|
|
});
|
2019-06-10 08:35:00 +08:00
|
|
|
|
|
2019-06-10 08:54:15 +08:00
|
|
|
|
AddStep("Select random", () =>
|
|
|
|
|
{
|
|
|
|
|
selector.Current.Value = selector.Items.ElementAt(RNG.Next(selector.Items.Count()));
|
2019-06-10 08:35:00 +08:00
|
|
|
|
});
|
2019-06-25 19:27:29 +08:00
|
|
|
|
AddStep("Toggle disabled state", () => selector.Current.Disabled = !selector.Current.Disabled);
|
2019-06-10 08:35:00 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|