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
|
|
|
|
|
2017-11-23 15:00:33 +08:00
|
|
|
|
using System.ComponentModel;
|
2017-09-18 21:32:49 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Game.Graphics.Sprites;
|
|
|
|
|
using osu.Game.Graphics.UserInterface;
|
|
|
|
|
using osu.Game.Screens.Select.Filter;
|
2018-11-20 15:51:59 +08:00
|
|
|
|
using osuTK;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2019-03-25 00:02:36 +08:00
|
|
|
|
namespace osu.Game.Tests.Visual.UserInterface
|
2017-09-18 21:32:49 +08:00
|
|
|
|
{
|
2017-11-23 15:00:33 +08:00
|
|
|
|
[Description("SongSelect filter control")]
|
2019-05-15 03:37:25 +08:00
|
|
|
|
public partial class TestSceneTabControl : OsuTestScene
|
2017-09-18 21:32:49 +08:00
|
|
|
|
{
|
2019-05-15 03:37:25 +08:00
|
|
|
|
public TestSceneTabControl()
|
2017-09-18 21:32:49 +08:00
|
|
|
|
{
|
|
|
|
|
OsuSpriteText text;
|
|
|
|
|
OsuTabControl<GroupMode> filter;
|
|
|
|
|
Add(filter = new OsuTabControl<GroupMode>
|
|
|
|
|
{
|
|
|
|
|
Margin = new MarginPadding(4),
|
|
|
|
|
Size = new Vector2(229, 24),
|
|
|
|
|
AutoSort = true
|
|
|
|
|
});
|
|
|
|
|
Add(text = new OsuSpriteText
|
|
|
|
|
{
|
|
|
|
|
Text = "None",
|
|
|
|
|
Margin = new MarginPadding(4),
|
|
|
|
|
Position = new Vector2(275, 5)
|
|
|
|
|
});
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-09-18 21:32:49 +08:00
|
|
|
|
filter.PinItem(GroupMode.All);
|
|
|
|
|
filter.PinItem(GroupMode.RecentlyPlayed);
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2019-02-22 16:51:39 +08:00
|
|
|
|
filter.Current.ValueChanged += grouping =>
|
2017-09-18 21:32:49 +08:00
|
|
|
|
{
|
2019-02-22 16:51:39 +08:00
|
|
|
|
text.Text = "Currently Selected: " + grouping.NewValue.ToString();
|
2017-09-18 21:32:49 +08:00
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|