1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-15 05:17:25 +08:00
osu-lazer/osu.Game/Overlays/BeatmapSet/LeaderboardScopeSelector.cs

57 lines
1.7 KiB
C#
Raw Normal View History

2019-08-07 13:33:55 +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.Game.Screens.Select.Leaderboards;
using osu.Game.Graphics.UserInterface;
using osu.Framework.Allocation;
using osuTK.Graphics;
2019-09-10 09:20:32 +08:00
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input.Events;
using osu.Framework.Graphics;
2019-08-07 13:33:55 +08:00
namespace osu.Game.Overlays.BeatmapSet
{
public class LeaderboardScopeSelector : GradientLineTabControl<BeatmapLeaderboardScope>
2019-08-07 13:33:55 +08:00
{
2019-08-12 23:14:37 +08:00
protected override bool AddEnumEntriesAutomatically => false;
2019-08-12 18:16:57 +08:00
2019-09-10 09:20:32 +08:00
protected override TabItem<BeatmapLeaderboardScope> CreateTabItem(BeatmapLeaderboardScope value) => new ScopeSelectorTabItem(value);
2019-08-07 13:33:55 +08:00
public LeaderboardScopeSelector()
{
AddItem(BeatmapLeaderboardScope.Global);
AddItem(BeatmapLeaderboardScope.Country);
AddItem(BeatmapLeaderboardScope.Friend);
}
[BackgroundDependencyLoader]
2020-02-05 00:11:28 +08:00
private void load(OverlayColourProvider colourProvider)
{
2020-02-05 00:11:28 +08:00
AccentColour = colourProvider.Highlight1;
LineColour = colourProvider.Background1;
2019-08-07 13:33:55 +08:00
}
2019-09-10 09:20:32 +08:00
private class ScopeSelectorTabItem : PageTabItem
{
public ScopeSelectorTabItem(BeatmapLeaderboardScope value)
: base(value)
{
}
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);
}
}
2019-08-07 13:33:55 +08:00
}
}