From 4067b6129b8e8b557e478a8a20f280f63299e1c8 Mon Sep 17 00:00:00 2001
From: Dean Herbert <pe@ppy.sh>
Date: Sun, 26 Nov 2017 04:16:36 +0900
Subject: [PATCH 1/2] Add visual highlighting on song select panel hover

Prerequisite for adding hover sound effects. Didn't feel right without this change.
---
 osu.Game/Beatmaps/Drawables/Panel.cs | 52 ++++++++++++++++++++++++----
 1 file changed, 46 insertions(+), 6 deletions(-)

diff --git a/osu.Game/Beatmaps/Drawables/Panel.cs b/osu.Game/Beatmaps/Drawables/Panel.cs
index d6ed306b39..5fbc858b00 100644
--- a/osu.Game/Beatmaps/Drawables/Panel.cs
+++ b/osu.Game/Beatmaps/Drawables/Panel.cs
@@ -3,12 +3,15 @@
 
 using System;
 using osu.Framework;
+using osu.Framework.Allocation;
 using osu.Framework.Graphics;
 using osu.Framework.Graphics.Containers;
 using osu.Framework.Input;
 using OpenTK;
 using OpenTK.Graphics;
 using osu.Framework.Extensions.Color4Extensions;
+using osu.Framework.Graphics.Shapes;
+using osu.Game.Graphics;
 
 namespace osu.Game.Beatmaps.Drawables
 {
@@ -22,6 +25,10 @@ namespace osu.Game.Beatmaps.Drawables
 
         private readonly Container nestedContainer;
 
+        private readonly Container borderContainer;
+
+        private readonly Box hoverLayer;
+
         protected override Container<Drawable> Content => nestedContainer;
 
         protected Panel()
@@ -29,20 +36,53 @@ namespace osu.Game.Beatmaps.Drawables
             Height = MAX_HEIGHT;
             RelativeSizeAxes = Axes.X;
 
-            AddInternal(nestedContainer = new Container
+            AddInternal(borderContainer = new Container
             {
                 RelativeSizeAxes = Axes.Both,
                 Masking = true,
                 CornerRadius = 10,
                 BorderColour = new Color4(221, 255, 255, 255),
+                Children = new Drawable[]
+                {
+                    nestedContainer = new Container
+                    {
+                        RelativeSizeAxes = Axes.Both,
+                    },
+                    hoverLayer = new Box
+                    {
+                        RelativeSizeAxes = Axes.Both,
+                        Alpha = 0,
+                        Blending = new BlendingParameters { Mode = BlendingMode.Additive },
+                    },
+                }
             });
 
             Alpha = 0;
         }
 
+
+        protected override bool OnHover(InputState state)
+        {
+            hoverLayer.FadeIn(100, Easing.OutQuint);
+
+            return base.OnHover(state);
+        }
+
+        protected override void OnHoverLost(InputState state)
+        {
+            hoverLayer.FadeOut(1000, Easing.OutQuint);
+            base.OnHoverLost(state);
+        }
+
+        [BackgroundDependencyLoader]
+        private void load(OsuColour colours)
+        {
+            hoverLayer.Colour = colours.Blue.Opacity(0.1f);
+        }
+
         public void SetMultiplicativeAlpha(float alpha)
         {
-            nestedContainer.Alpha = alpha;
+            borderContainer.Alpha = alpha;
         }
 
         protected override void LoadComplete()
@@ -94,8 +134,8 @@ namespace osu.Game.Beatmaps.Drawables
 
         protected virtual void Selected()
         {
-            nestedContainer.BorderThickness = 2.5f;
-            nestedContainer.EdgeEffect = new EdgeEffectParameters
+            borderContainer.BorderThickness = 2.5f;
+            borderContainer.EdgeEffect = new EdgeEffectParameters
             {
                 Type = EdgeEffectType.Glow,
                 Colour = new Color4(130, 204, 255, 150),
@@ -106,8 +146,8 @@ namespace osu.Game.Beatmaps.Drawables
 
         protected virtual void Deselected()
         {
-            nestedContainer.BorderThickness = 0;
-            nestedContainer.EdgeEffect = new EdgeEffectParameters
+            borderContainer.BorderThickness = 0;
+            borderContainer.EdgeEffect = new EdgeEffectParameters
             {
                 Type = EdgeEffectType.Shadow,
                 Offset = new Vector2(1),

From f189de437a38450c4a1d568a51c3e013d54ced8b Mon Sep 17 00:00:00 2001
From: Dean Herbert <pe@ppy.sh>
Date: Mon, 27 Nov 2017 10:01:44 +0900
Subject: [PATCH 2/2] Simplify blending assignment

---
 osu.Game/Beatmaps/Drawables/Panel.cs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/osu.Game/Beatmaps/Drawables/Panel.cs b/osu.Game/Beatmaps/Drawables/Panel.cs
index 5fbc858b00..e4b7e55012 100644
--- a/osu.Game/Beatmaps/Drawables/Panel.cs
+++ b/osu.Game/Beatmaps/Drawables/Panel.cs
@@ -52,7 +52,7 @@ namespace osu.Game.Beatmaps.Drawables
                     {
                         RelativeSizeAxes = Axes.Both,
                         Alpha = 0,
-                        Blending = new BlendingParameters { Mode = BlendingMode.Additive },
+                        Blending = BlendingMode.Additive,
                     },
                 }
             });