From 13bc50ad56251c5cece3c7da8c6bea3c37ca9d02 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Mon, 11 Dec 2017 10:42:36 +0100 Subject: [PATCH] Removed ICanDisableHoverSounds interface --- osu.Game/Graphics/UserInterface/HoverSounds.cs | 12 +----------- osu.Game/Online/Chat/ChatLink.cs | 9 ++++----- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/HoverSounds.cs b/osu.Game/Graphics/UserInterface/HoverSounds.cs index 43adea49dd..24dbe37567 100644 --- a/osu.Game/Graphics/UserInterface/HoverSounds.cs +++ b/osu.Game/Graphics/UserInterface/HoverSounds.cs @@ -30,8 +30,7 @@ namespace osu.Game.Graphics.UserInterface protected override bool OnHover(InputState state) { - // If Parent does not implement the interface, still play the sample - if ((Parent as ICanDisableHoverSounds)?.ShouldPlayHoverSound != false) sampleHover?.Play(); + sampleHover?.Play(); return base.OnHover(state); } @@ -51,13 +50,4 @@ namespace osu.Game.Graphics.UserInterface [Description("-softer")] Soft } - - /// - /// Classes implementing this interface can choose whether or not the HoverSounds should be played. - /// If this is not implemented, the sounds will always be played when OnHover is triggered. - /// - public interface ICanDisableHoverSounds - { - bool ShouldPlayHoverSound { get; } - } } diff --git a/osu.Game/Online/Chat/ChatLink.cs b/osu.Game/Online/Chat/ChatLink.cs index 42f5ea3e16..83b1429993 100644 --- a/osu.Game/Online/Chat/ChatLink.cs +++ b/osu.Game/Online/Chat/ChatLink.cs @@ -4,6 +4,7 @@ using OpenTK.Graphics; using osu.Framework.Allocation; using osu.Framework.Graphics; +using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; using osu.Framework.Input; @@ -180,15 +181,13 @@ namespace osu.Game.Online.Chat protected override bool OnHover(InputState state) { - var hoverResult = base.OnHover(state); - if (!SameLinkSprites.Any(sprite => sprite.IsHovered)) foreach (ChatLink sprite in SameLinkSprites) sprite.TriggerOnHover(state); Content.FadeColour(hoverColour, 500, Easing.OutQuint); - return hoverResult; + return true; } protected override void OnHoverLost(InputState state) @@ -221,9 +220,9 @@ namespace osu.Game.Online.Chat Content.Colour = urlColour; } - private class ChatHoverContainer : OsuHoverContainer, ICanDisableHoverSounds + private class ChatHoverContainer : OsuHoverContainer { - public bool ShouldPlayHoverSound => ((ChatLink)Parent).SameLinkSprites.All(sprite => !sprite.IsHovered); + } } }