From bfedd42ca442d5a855e2bc300922b6464ef032de Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Fri, 19 May 2017 23:56:48 -0300 Subject: [PATCH 1/2] Add mod tooltips --- osu.Game/Overlays/Mods/ModButton.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Mods/ModButton.cs b/osu.Game/Overlays/Mods/ModButton.cs index fe1b3b0192..9bbd793934 100644 --- a/osu.Game/Overlays/Mods/ModButton.cs +++ b/osu.Game/Overlays/Mods/ModButton.cs @@ -16,6 +16,7 @@ using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.UI; using System; using System.Linq; +using osu.Game.Graphics; namespace osu.Game.Overlays.Mods { @@ -23,7 +24,7 @@ namespace osu.Game.Overlays.Mods /// /// Represents a clickable button which can cycle through one of more mods. /// - public class ModButton : ModButtonEmpty + public class ModButton : ModButtonEmpty, IHasTooltip { private ModIcon foregroundIcon; private readonly SpriteText text; @@ -32,6 +33,8 @@ namespace osu.Game.Overlays.Mods public Action Action; // Passed the selected mod or null if none + public string TooltipText => (SelectedMod?.Description ?? Mods.FirstOrDefault()?.Description) ?? @""; + private int _selectedIndex = -1; private int selectedIndex { From 995a573b9c8d0828170738736283b7323866afe1 Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Sat, 20 May 2017 03:22:37 -0300 Subject: [PATCH 2/2] @"" -> string.Empty --- osu.Game/Overlays/Mods/ModButton.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Mods/ModButton.cs b/osu.Game/Overlays/Mods/ModButton.cs index 9bbd793934..831b9082bd 100644 --- a/osu.Game/Overlays/Mods/ModButton.cs +++ b/osu.Game/Overlays/Mods/ModButton.cs @@ -33,7 +33,7 @@ namespace osu.Game.Overlays.Mods public Action Action; // Passed the selected mod or null if none - public string TooltipText => (SelectedMod?.Description ?? Mods.FirstOrDefault()?.Description) ?? @""; + public string TooltipText => (SelectedMod?.Description ?? Mods.FirstOrDefault()?.Description) ?? string.Empty; private int _selectedIndex = -1; private int selectedIndex