From 2f2f0ed9a306085b77c043813e60746926955281 Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Mon, 30 Jan 2017 09:26:24 -0400 Subject: [PATCH] Fixed an issue with PauseButton's glow not fading in --- osu.Game/Overlays/Pause/PauseButton.cs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/osu.Game/Overlays/Pause/PauseButton.cs b/osu.Game/Overlays/Pause/PauseButton.cs index 1826162697..342697026a 100644 --- a/osu.Game/Overlays/Pause/PauseButton.cs +++ b/osu.Game/Overlays/Pause/PauseButton.cs @@ -30,9 +30,9 @@ namespace osu.Game.Overlays.Pause set { buttonColour = value; + reapplyGlow(); if (colourContainer == null) return; colourContainer.Colour = ButtonColour; - reapplyGlow(); } } @@ -84,7 +84,7 @@ namespace osu.Game.Overlays.Pause { colourContainer.ResizeTo(new Vector2(hoverWidth, 1f), hoverDuration, EasingTypes.OutElastic); spriteText.TransformSpacingTo(new Vector2(3f, 0f), hoverDuration, EasingTypes.OutElastic); - glowContainer.FadeOut(glowFadeDuration, EasingTypes.Out); + glowContainer.FadeIn(glowFadeDuration, EasingTypes.Out); SampleHover?.Play(); return true; } @@ -111,7 +111,7 @@ namespace osu.Game.Overlays.Pause public PauseButton() { - Add(new Drawable[] + Children = new Drawable[] { backgroundContainer = new Container { @@ -138,24 +138,21 @@ namespace osu.Game.Overlays.Pause RelativeSizeAxes = Axes.Both, Origin = Anchor.TopLeft, Anchor = Anchor.TopLeft, - Width = 0.125f, - ColourInfo = ColourInfo.GradientHorizontal(new Color4(ButtonColour.R, ButtonColour.G, ButtonColour.B, 0f), ButtonColour) + Width = 0.125f }, centerGlow = new Box { RelativeSizeAxes = Axes.Both, Origin = Anchor.Centre, Anchor = Anchor.Centre, - Width = 0.75f, - Colour = ButtonColour + Width = 0.75f }, rightGlow = new Box { RelativeSizeAxes = Axes.Both, Origin = Anchor.TopRight, Anchor = Anchor.TopRight, - Width = 0.125f, - ColourInfo = ColourInfo.GradientHorizontal(ButtonColour, new Color4(ButtonColour.R, ButtonColour.G, ButtonColour.B, 0f)) + Width = 0.125f } } }, @@ -212,7 +209,7 @@ namespace osu.Game.Overlays.Pause ShadowColour = new Color4(0, 0, 0, 0.1f), Colour = Color4.White } - }); + }; reapplyGlow(); }