From bf54ae86eac0d9598a25b54941064ddc9bc0590d Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Tue, 31 Jan 2017 08:07:05 -0400 Subject: [PATCH] Added flash when clicking a PauseButton --- osu.Game/Overlays/Pause/PauseButton.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/osu.Game/Overlays/Pause/PauseButton.cs b/osu.Game/Overlays/Pause/PauseButton.cs index 16f52f4b20..0696dba452 100644 --- a/osu.Game/Overlays/Pause/PauseButton.cs +++ b/osu.Game/Overlays/Pause/PauseButton.cs @@ -65,6 +65,7 @@ namespace osu.Game.Overlays.Pause { didClick = true; colourContainer.ResizeTo(new Vector2(1.5f, 1f), clickDuration, EasingTypes.In); + flash(); SampleClick?.Play(); Action?.Invoke(); @@ -101,6 +102,22 @@ namespace osu.Game.Overlays.Pause didClick = false; } + private void flash() + { + var flash = new Box + { + RelativeSizeAxes = Axes.Both + }; + + colourContainer.Add(flash); + + flash.Colour = ButtonColour; + flash.BlendingMode = BlendingMode.Additive; + flash.Alpha = 0.3f; + flash.FadeOutFromOne(clickDuration); + flash.Expire(); + } + private void reapplyGlow() { if (leftGlow == null || centerGlow == null || rightGlow == null) return;