Implement RankingsScopeSelector

This commit is contained in:
Andrei Zavatski
2019-09-10 04:20:32 +03:00
parent 65869c7ebb
commit 03bd7ca8e7
4 changed files with 107 additions and 26 deletions

View File

@ -6,6 +6,9 @@ using osu.Game.Graphics.UserInterface;
using osu.Game.Graphics;
using osu.Framework.Allocation;
using osuTK.Graphics;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input.Events;
using osu.Framework.Graphics;
namespace osu.Game.Overlays.BeatmapSet
{
@ -13,6 +16,8 @@ namespace osu.Game.Overlays.BeatmapSet
{
protected override bool AddEnumEntriesAutomatically => false;
protected override TabItem<BeatmapLeaderboardScope> CreateTabItem(BeatmapLeaderboardScope value) => new ScopeSelectorTabItem(value);
public LeaderboardScopeSelector()
{
AddItem(BeatmapLeaderboardScope.Global);
@ -26,5 +31,28 @@ namespace osu.Game.Overlays.BeatmapSet
AccentColour = colours.Blue;
LineColour = Color4.Gray;
}
private class ScopeSelectorTabItem : PageTabItem
{
public ScopeSelectorTabItem(BeatmapLeaderboardScope value)
: base(value)
{
Text.Font = OsuFont.GetFont(size: 16);
}
protected override bool OnHover(HoverEvent e)
{
Text.FadeColour(AccentColour);
return base.OnHover(e);
}
protected override void OnHoverLost(HoverLostEvent e)
{
base.OnHoverLost(e);
Text.FadeColour(Color4.White);
}
}
}
}