mirror of
https://github.com/ppy/osu.git
synced 2025-02-19 13:12:54 +08:00
commit
808f5c3ae3
@ -16,6 +16,7 @@ using osu.Game.Rulesets.Mods;
|
|||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using osu.Game.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Mods
|
namespace osu.Game.Overlays.Mods
|
||||||
{
|
{
|
||||||
@ -23,7 +24,7 @@ namespace osu.Game.Overlays.Mods
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a clickable button which can cycle through one of more mods.
|
/// Represents a clickable button which can cycle through one of more mods.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ModButton : ModButtonEmpty
|
public class ModButton : ModButtonEmpty, IHasTooltip
|
||||||
{
|
{
|
||||||
private ModIcon foregroundIcon;
|
private ModIcon foregroundIcon;
|
||||||
private readonly SpriteText text;
|
private readonly SpriteText text;
|
||||||
@ -32,6 +33,8 @@ namespace osu.Game.Overlays.Mods
|
|||||||
|
|
||||||
public Action<Mod> Action; // Passed the selected mod or null if none
|
public Action<Mod> Action; // Passed the selected mod or null if none
|
||||||
|
|
||||||
|
public string TooltipText => (SelectedMod?.Description ?? Mods.FirstOrDefault()?.Description) ?? string.Empty;
|
||||||
|
|
||||||
private int _selectedIndex = -1;
|
private int _selectedIndex = -1;
|
||||||
private int selectedIndex
|
private int selectedIndex
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user