mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Implement RankingsScopeSelector
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user