From f5bea077a09bcca057d6ad628a7e9977f75f7399 Mon Sep 17 00:00:00 2001 From: Ninjaprawn Date: Fri, 8 Dec 2017 11:26:34 +1100 Subject: [PATCH 1/7] Subclass ModIcon to remove the tooltip text --- osu.Game/Overlays/Mods/ModButton.cs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/osu.Game/Overlays/Mods/ModButton.cs b/osu.Game/Overlays/Mods/ModButton.cs index 77b7c3add2..22a39b470c 100644 --- a/osu.Game/Overlays/Mods/ModButton.cs +++ b/osu.Game/Overlays/Mods/ModButton.cs @@ -204,13 +204,13 @@ private void createIcons() { iconsContainer.AddRange(new[] { - backgroundIcon = new ModIcon(Mods[1]) + backgroundIcon = new DisplayableModIcon(Mods[1]) { Origin = Anchor.BottomRight, Anchor = Anchor.BottomRight, Position = new Vector2(1.5f), }, - foregroundIcon = new ModIcon(Mods[0]) + foregroundIcon = new DisplayableModIcon(Mods[0]) { Origin = Anchor.BottomRight, Anchor = Anchor.BottomRight, @@ -220,7 +220,7 @@ private void createIcons() } else { - iconsContainer.Add(foregroundIcon = new ModIcon(Mod) + iconsContainer.Add(foregroundIcon = new DisplayableModIcon(Mod) { Origin = Anchor.Centre, Anchor = Anchor.Centre, @@ -259,5 +259,15 @@ public ModButton(Mod mod) Mod = mod; } + + private class DisplayableModIcon : ModIcon { + + public string TooltipText => null; + + public DisplayableModIcon(Mod mod) : base(mod) { + + } + + } } } From 9b3e666a077ac83d3cf951a7c91d2f12dbf45ce3 Mon Sep 17 00:00:00 2001 From: Ninjaprawn Date: Fri, 8 Dec 2017 13:53:49 +1100 Subject: [PATCH 2/7] Added IgnoreTooltip to all classes required --- osu.Game.Tests/Visual/TestCaseTextAwesome.cs | 1 + osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs | 1 + osu.Game/Graphics/UserInterface/OsuSliderBar.cs | 1 + osu.Game/Overlays/BeatmapSet/AuthorInfo.cs | 1 + osu.Game/Overlays/BeatmapSet/BasicStats.cs | 1 + osu.Game/Overlays/Profile/ProfileHeader.cs | 1 + osu.Game/Overlays/Profile/Sections/Ranks/DrawableScore.cs | 1 + osu.Game/Overlays/Settings/SettingsItem.cs | 1 + osu.Game/Rulesets/UI/ModIcon.cs | 2 ++ osu.Game/Screens/Multiplayer/DrawableGameType.cs | 1 + osu.Game/Screens/Multiplayer/RoomInspector.cs | 1 + osu.Game/Tests/Visual/TestCasePerformancePoints.cs | 1 + 12 files changed, 13 insertions(+) diff --git a/osu.Game.Tests/Visual/TestCaseTextAwesome.cs b/osu.Game.Tests/Visual/TestCaseTextAwesome.cs index 37905a1883..1941aa76aa 100644 --- a/osu.Game.Tests/Visual/TestCaseTextAwesome.cs +++ b/osu.Game.Tests/Visual/TestCaseTextAwesome.cs @@ -36,6 +36,7 @@ public TestCaseTextAwesome() private class Icon : Container, IHasTooltip { public string TooltipText { get; } + public bool IgnoreTooltip => false; public Icon(FontAwesome fa) { diff --git a/osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs b/osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs index 7f193a0e1a..08c9ffadc2 100644 --- a/osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs +++ b/osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs @@ -103,6 +103,7 @@ protected override void LoadComplete() private class CapsWarning : SpriteIcon, IHasTooltip { public string TooltipText => @"Caps lock is active"; + public bool IgnoreTooltip => false; public CapsWarning() { diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index fd75269610..f2cc668c5e 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -46,6 +46,7 @@ public virtual string TooltipText return Current.Value.ToString(); } } + public bool IgnoreTooltip => false; private Color4 accentColour; public Color4 AccentColour diff --git a/osu.Game/Overlays/BeatmapSet/AuthorInfo.cs b/osu.Game/Overlays/BeatmapSet/AuthorInfo.cs index 46ee5a9cdb..4df4e48ab7 100644 --- a/osu.Game/Overlays/BeatmapSet/AuthorInfo.cs +++ b/osu.Game/Overlays/BeatmapSet/AuthorInfo.cs @@ -126,6 +126,7 @@ public Field(string first, string second, string secondFont) private class ClickableArea : OsuClickableContainer, IHasTooltip { public string TooltipText => @"View Profile"; + public bool IgnoreTooltip => false; } } } diff --git a/osu.Game/Overlays/BeatmapSet/BasicStats.cs b/osu.Game/Overlays/BeatmapSet/BasicStats.cs index 3ecff85bee..29e19f3370 100644 --- a/osu.Game/Overlays/BeatmapSet/BasicStats.cs +++ b/osu.Game/Overlays/BeatmapSet/BasicStats.cs @@ -68,6 +68,7 @@ private class Statistic : Container, IHasTooltip private readonly OsuSpriteText value; public string TooltipText => name; + public bool IgnoreTooltip => false; public string Value { get { return value.Text; } diff --git a/osu.Game/Overlays/Profile/ProfileHeader.cs b/osu.Game/Overlays/Profile/ProfileHeader.cs index c7bc5c1d93..e36385b7f4 100644 --- a/osu.Game/Overlays/Profile/ProfileHeader.cs +++ b/osu.Game/Overlays/Profile/ProfileHeader.cs @@ -531,6 +531,7 @@ public LinkText() public class ProfileLink : LinkText, IHasTooltip { public string TooltipText => "View Profile in Browser"; + public bool IgnoreTooltip => false; public ProfileLink(User user) { diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableScore.cs b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableScore.cs index 35f4778047..9aac6ec56c 100644 --- a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableScore.cs +++ b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableScore.cs @@ -185,6 +185,7 @@ protected override void OnHoverLost(InputState state) private class MetadataContainer : OsuHoverContainer, IHasTooltip { public string TooltipText { get; set; } + public bool IgnoreTooltip => false; public MetadataContainer(string title, string artist) { diff --git a/osu.Game/Overlays/Settings/SettingsItem.cs b/osu.Game/Overlays/Settings/SettingsItem.cs index d9aac58c54..3731d385f3 100644 --- a/osu.Game/Overlays/Settings/SettingsItem.cs +++ b/osu.Game/Overlays/Settings/SettingsItem.cs @@ -158,6 +158,7 @@ public RestoreDefaultValueButton() } public string TooltipText => "Revert to default"; + public bool IgnoreTooltip => false; public override bool HandleInput => true; diff --git a/osu.Game/Rulesets/UI/ModIcon.cs b/osu.Game/Rulesets/UI/ModIcon.cs index 5ca3d9521b..8cabd4f757 100644 --- a/osu.Game/Rulesets/UI/ModIcon.cs +++ b/osu.Game/Rulesets/UI/ModIcon.cs @@ -29,6 +29,7 @@ public FontAwesome Icon private readonly ModType type; public string TooltipText { get; } + public virtual bool IgnoreTooltip { get; } public ModIcon(Mod mod) { @@ -37,6 +38,7 @@ public ModIcon(Mod mod) type = mod.Type; TooltipText = mod.Name; + IgnoreTooltip = false; Size = new Vector2(size); diff --git a/osu.Game/Screens/Multiplayer/DrawableGameType.cs b/osu.Game/Screens/Multiplayer/DrawableGameType.cs index 5b85fcc4da..5966abf865 100644 --- a/osu.Game/Screens/Multiplayer/DrawableGameType.cs +++ b/osu.Game/Screens/Multiplayer/DrawableGameType.cs @@ -16,6 +16,7 @@ public class DrawableGameType : CircularContainer, IHasTooltip private readonly GameType type; public string TooltipText => type.Name; + public bool IgnoreTooltip => false; public DrawableGameType(GameType type) { diff --git a/osu.Game/Screens/Multiplayer/RoomInspector.cs b/osu.Game/Screens/Multiplayer/RoomInspector.cs index 8d7401500f..bafafeb1ec 100644 --- a/osu.Game/Screens/Multiplayer/RoomInspector.cs +++ b/osu.Game/Screens/Multiplayer/RoomInspector.cs @@ -384,6 +384,7 @@ private class UserTile : Container, IHasTooltip private readonly User user; public string TooltipText => user.Username; + public bool IgnoreTooltip => false; public UserTile(User user) { diff --git a/osu.Game/Tests/Visual/TestCasePerformancePoints.cs b/osu.Game/Tests/Visual/TestCasePerformancePoints.cs index 6da14e9b12..cf6a4946bc 100644 --- a/osu.Game/Tests/Visual/TestCasePerformancePoints.cs +++ b/osu.Game/Tests/Visual/TestCasePerformancePoints.cs @@ -144,6 +144,7 @@ private class BeatmapDisplay : CompositeDrawable, IHasTooltip private bool isSelected; public string TooltipText => text.Text; + public bool IgnoreTooltip => false; public BeatmapDisplay(BeatmapInfo beatmap) { From a491710fe42d61e2d77bbad23fe9ca55426ba24f Mon Sep 17 00:00:00 2001 From: Ninjaprawn Date: Fri, 8 Dec 2017 13:55:54 +1100 Subject: [PATCH 3/7] Override IgnoreTooltip in DisplayableModIcon --- osu.Game/Overlays/Mods/ModButton.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/Mods/ModButton.cs b/osu.Game/Overlays/Mods/ModButton.cs index 22a39b470c..e4a4413d09 100644 --- a/osu.Game/Overlays/Mods/ModButton.cs +++ b/osu.Game/Overlays/Mods/ModButton.cs @@ -35,6 +35,7 @@ public class ModButton : ModButtonEmpty, IHasTooltip public Action Action; // Passed the selected mod or null if none public string TooltipText => (SelectedMod?.Description ?? Mods.FirstOrDefault()?.Description) ?? string.Empty; + public bool IgnoreTooltip => false; private const Easing mod_switch_easing = Easing.InOutSine; private const double mod_switch_duration = 120; @@ -262,10 +263,10 @@ public ModButton(Mod mod) private class DisplayableModIcon : ModIcon { - public string TooltipText => null; + public override bool IgnoreTooltip { get; } public DisplayableModIcon(Mod mod) : base(mod) { - + IgnoreTooltip = true; } } From 71e59bc9e753777a86739446e3fb691b27bfb738 Mon Sep 17 00:00:00 2001 From: Ninjaprawn Date: Sat, 16 Dec 2017 20:16:40 +1100 Subject: [PATCH 4/7] Removed the IgnoreTooltip property --- osu.Game.Tests/Visual/TestCaseTextAwesome.cs | 1 - osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs | 1 - osu.Game/Graphics/UserInterface/OsuSliderBar.cs | 1 - osu.Game/Overlays/BeatmapSet/AuthorInfo.cs | 1 - osu.Game/Overlays/BeatmapSet/BasicStats.cs | 1 - osu.Game/Overlays/Profile/ProfileHeader.cs | 1 - osu.Game/Overlays/Profile/Sections/Ranks/DrawableScore.cs | 1 - osu.Game/Overlays/Settings/SettingsItem.cs | 1 - osu.Game/Rulesets/UI/ModIcon.cs | 4 +--- osu.Game/Screens/Multiplayer/DrawableGameType.cs | 1 - osu.Game/Screens/Multiplayer/RoomInspector.cs | 1 - osu.Game/Tests/Visual/TestCasePerformancePoints.cs | 1 - 12 files changed, 1 insertion(+), 14 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseTextAwesome.cs b/osu.Game.Tests/Visual/TestCaseTextAwesome.cs index 1941aa76aa..37905a1883 100644 --- a/osu.Game.Tests/Visual/TestCaseTextAwesome.cs +++ b/osu.Game.Tests/Visual/TestCaseTextAwesome.cs @@ -36,7 +36,6 @@ public TestCaseTextAwesome() private class Icon : Container, IHasTooltip { public string TooltipText { get; } - public bool IgnoreTooltip => false; public Icon(FontAwesome fa) { diff --git a/osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs b/osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs index 08c9ffadc2..7f193a0e1a 100644 --- a/osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs +++ b/osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs @@ -103,7 +103,6 @@ protected override void LoadComplete() private class CapsWarning : SpriteIcon, IHasTooltip { public string TooltipText => @"Caps lock is active"; - public bool IgnoreTooltip => false; public CapsWarning() { diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index f2cc668c5e..fd75269610 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -46,7 +46,6 @@ public virtual string TooltipText return Current.Value.ToString(); } } - public bool IgnoreTooltip => false; private Color4 accentColour; public Color4 AccentColour diff --git a/osu.Game/Overlays/BeatmapSet/AuthorInfo.cs b/osu.Game/Overlays/BeatmapSet/AuthorInfo.cs index 4df4e48ab7..46ee5a9cdb 100644 --- a/osu.Game/Overlays/BeatmapSet/AuthorInfo.cs +++ b/osu.Game/Overlays/BeatmapSet/AuthorInfo.cs @@ -126,7 +126,6 @@ public Field(string first, string second, string secondFont) private class ClickableArea : OsuClickableContainer, IHasTooltip { public string TooltipText => @"View Profile"; - public bool IgnoreTooltip => false; } } } diff --git a/osu.Game/Overlays/BeatmapSet/BasicStats.cs b/osu.Game/Overlays/BeatmapSet/BasicStats.cs index 29e19f3370..3ecff85bee 100644 --- a/osu.Game/Overlays/BeatmapSet/BasicStats.cs +++ b/osu.Game/Overlays/BeatmapSet/BasicStats.cs @@ -68,7 +68,6 @@ private class Statistic : Container, IHasTooltip private readonly OsuSpriteText value; public string TooltipText => name; - public bool IgnoreTooltip => false; public string Value { get { return value.Text; } diff --git a/osu.Game/Overlays/Profile/ProfileHeader.cs b/osu.Game/Overlays/Profile/ProfileHeader.cs index e36385b7f4..c7bc5c1d93 100644 --- a/osu.Game/Overlays/Profile/ProfileHeader.cs +++ b/osu.Game/Overlays/Profile/ProfileHeader.cs @@ -531,7 +531,6 @@ public LinkText() public class ProfileLink : LinkText, IHasTooltip { public string TooltipText => "View Profile in Browser"; - public bool IgnoreTooltip => false; public ProfileLink(User user) { diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableScore.cs b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableScore.cs index 9aac6ec56c..35f4778047 100644 --- a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableScore.cs +++ b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableScore.cs @@ -185,7 +185,6 @@ protected override void OnHoverLost(InputState state) private class MetadataContainer : OsuHoverContainer, IHasTooltip { public string TooltipText { get; set; } - public bool IgnoreTooltip => false; public MetadataContainer(string title, string artist) { diff --git a/osu.Game/Overlays/Settings/SettingsItem.cs b/osu.Game/Overlays/Settings/SettingsItem.cs index 3731d385f3..d9aac58c54 100644 --- a/osu.Game/Overlays/Settings/SettingsItem.cs +++ b/osu.Game/Overlays/Settings/SettingsItem.cs @@ -158,7 +158,6 @@ public RestoreDefaultValueButton() } public string TooltipText => "Revert to default"; - public bool IgnoreTooltip => false; public override bool HandleInput => true; diff --git a/osu.Game/Rulesets/UI/ModIcon.cs b/osu.Game/Rulesets/UI/ModIcon.cs index 8cabd4f757..90f63aeab6 100644 --- a/osu.Game/Rulesets/UI/ModIcon.cs +++ b/osu.Game/Rulesets/UI/ModIcon.cs @@ -28,8 +28,7 @@ public FontAwesome Icon private readonly ModType type; - public string TooltipText { get; } - public virtual bool IgnoreTooltip { get; } + public virtual string TooltipText { get; } public ModIcon(Mod mod) { @@ -38,7 +37,6 @@ public ModIcon(Mod mod) type = mod.Type; TooltipText = mod.Name; - IgnoreTooltip = false; Size = new Vector2(size); diff --git a/osu.Game/Screens/Multiplayer/DrawableGameType.cs b/osu.Game/Screens/Multiplayer/DrawableGameType.cs index 5966abf865..5b85fcc4da 100644 --- a/osu.Game/Screens/Multiplayer/DrawableGameType.cs +++ b/osu.Game/Screens/Multiplayer/DrawableGameType.cs @@ -16,7 +16,6 @@ public class DrawableGameType : CircularContainer, IHasTooltip private readonly GameType type; public string TooltipText => type.Name; - public bool IgnoreTooltip => false; public DrawableGameType(GameType type) { diff --git a/osu.Game/Screens/Multiplayer/RoomInspector.cs b/osu.Game/Screens/Multiplayer/RoomInspector.cs index bafafeb1ec..8d7401500f 100644 --- a/osu.Game/Screens/Multiplayer/RoomInspector.cs +++ b/osu.Game/Screens/Multiplayer/RoomInspector.cs @@ -384,7 +384,6 @@ private class UserTile : Container, IHasTooltip private readonly User user; public string TooltipText => user.Username; - public bool IgnoreTooltip => false; public UserTile(User user) { diff --git a/osu.Game/Tests/Visual/TestCasePerformancePoints.cs b/osu.Game/Tests/Visual/TestCasePerformancePoints.cs index cf6a4946bc..6da14e9b12 100644 --- a/osu.Game/Tests/Visual/TestCasePerformancePoints.cs +++ b/osu.Game/Tests/Visual/TestCasePerformancePoints.cs @@ -144,7 +144,6 @@ private class BeatmapDisplay : CompositeDrawable, IHasTooltip private bool isSelected; public string TooltipText => text.Text; - public bool IgnoreTooltip => false; public BeatmapDisplay(BeatmapInfo beatmap) { From 84ed91d5c94d9c9ebc001f4ae25d6387d7eb0f59 Mon Sep 17 00:00:00 2001 From: Ninjaprawn Date: Sat, 16 Dec 2017 20:17:20 +1100 Subject: [PATCH 5/7] Remove IgnoreTooltip; Override TooltipText to null --- osu.Game/Overlays/Mods/ModButton.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/osu.Game/Overlays/Mods/ModButton.cs b/osu.Game/Overlays/Mods/ModButton.cs index e4a4413d09..e81ff44f03 100644 --- a/osu.Game/Overlays/Mods/ModButton.cs +++ b/osu.Game/Overlays/Mods/ModButton.cs @@ -35,7 +35,6 @@ public class ModButton : ModButtonEmpty, IHasTooltip public Action Action; // Passed the selected mod or null if none public string TooltipText => (SelectedMod?.Description ?? Mods.FirstOrDefault()?.Description) ?? string.Empty; - public bool IgnoreTooltip => false; private const Easing mod_switch_easing = Easing.InOutSine; private const double mod_switch_duration = 120; @@ -263,10 +262,10 @@ public ModButton(Mod mod) private class DisplayableModIcon : ModIcon { - public override bool IgnoreTooltip { get; } - + public override string TooltipText { get; } + public DisplayableModIcon(Mod mod) : base(mod) { - IgnoreTooltip = true; + TooltipText = null; } } From 1ab2c0e21b5aec815d7b431f3a2944936b3a1fe1 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sat, 30 Dec 2017 16:45:59 +0900 Subject: [PATCH 6/7] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 797a351db2..0c48da1d49 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 797a351db2e852fef5296453641ffbf6b2f6dc11 +Subproject commit 0c48da1d49f470d56aeab9b15651ce0a4f5ac261 From 616ad5b723bfaaa4be5a58e944372bed4bed8971 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sat, 30 Dec 2017 16:55:01 +0900 Subject: [PATCH 7/7] Cleanups --- osu.Game/Overlays/Mods/ModButton.cs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/osu.Game/Overlays/Mods/ModButton.cs b/osu.Game/Overlays/Mods/ModButton.cs index e81ff44f03..35c2e9234d 100644 --- a/osu.Game/Overlays/Mods/ModButton.cs +++ b/osu.Game/Overlays/Mods/ModButton.cs @@ -204,13 +204,13 @@ private void createIcons() { iconsContainer.AddRange(new[] { - backgroundIcon = new DisplayableModIcon(Mods[1]) + backgroundIcon = new PassThroughTooltipModIcon(Mods[1]) { Origin = Anchor.BottomRight, Anchor = Anchor.BottomRight, Position = new Vector2(1.5f), }, - foregroundIcon = new DisplayableModIcon(Mods[0]) + foregroundIcon = new PassThroughTooltipModIcon(Mods[0]) { Origin = Anchor.BottomRight, Anchor = Anchor.BottomRight, @@ -220,7 +220,7 @@ private void createIcons() } else { - iconsContainer.Add(foregroundIcon = new DisplayableModIcon(Mod) + iconsContainer.Add(foregroundIcon = new PassThroughTooltipModIcon(Mod) { Origin = Anchor.Centre, Anchor = Anchor.Centre, @@ -260,14 +260,13 @@ public ModButton(Mod mod) Mod = mod; } - private class DisplayableModIcon : ModIcon { + private class PassThroughTooltipModIcon : ModIcon + { + public override string TooltipText => null; - public override string TooltipText { get; } - - public DisplayableModIcon(Mod mod) : base(mod) { - TooltipText = null; + public PassThroughTooltipModIcon(Mod mod) : base(mod) + { } - } } }