From ead88224c5abe0cb4d281feb86f61b2ff8b42a99 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 13 Oct 2017 19:14:43 +0900 Subject: [PATCH] Move ModIcon tooltip to base implementation --- .../Profile/Sections/Ranks/DrawableScore.cs | 13 +------------ osu.Game/Rulesets/UI/ModIcon.cs | 7 ++++++- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableScore.cs b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableScore.cs index a9eb562d2f..cac06348a7 100644 --- a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableScore.cs +++ b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableScore.cs @@ -16,8 +16,8 @@ using System.Diagnostics; using osu.Framework.Localisation; using System.Globalization; using osu.Game.Rulesets.Scoring; -using osu.Framework.Graphics.Cursor; using System; +using osu.Game.Rulesets.UI; namespace osu.Game.Overlays.Profile.Sections.Ranks { @@ -158,16 +158,5 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks yield return new Vector2(DrawWidth * i * (count == 1 ? 0 : 1f / (count - 1)), 0); } } - - private class ModIcon : Rulesets.UI.ModIcon, IHasTooltip - { - public ModIcon(Mod mod) - : base(mod) - { - TooltipText = mod.Name; - } - - public string TooltipText { get; } - } } } diff --git a/osu.Game/Rulesets/UI/ModIcon.cs b/osu.Game/Rulesets/UI/ModIcon.cs index 47a39d4644..7f7068d341 100644 --- a/osu.Game/Rulesets/UI/ModIcon.cs +++ b/osu.Game/Rulesets/UI/ModIcon.cs @@ -6,13 +6,14 @@ using OpenTK.Graphics; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Cursor; using osu.Game.Graphics; using osu.Game.Rulesets.Mods; using OpenTK; namespace osu.Game.Rulesets.UI { - public class ModIcon : Container + public class ModIcon : Container, IHasTooltip { private readonly SpriteIcon modIcon; private readonly SpriteIcon background; @@ -27,12 +28,16 @@ namespace osu.Game.Rulesets.UI private readonly ModType type; + public string TooltipText { get; } + public ModIcon(Mod mod) { if (mod == null) throw new ArgumentNullException(nameof(mod)); type = mod.Type; + TooltipText = mod.Name; + Children = new Drawable[] { background = new SpriteIcon