mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 21:03:08 +08:00
Fixed glow on PauseButton not updating
This commit is contained in:
parent
9ab49247b2
commit
dbb9078e30
@ -32,6 +32,7 @@ namespace osu.Game.Overlays.Pause
|
|||||||
buttonColour = value;
|
buttonColour = value;
|
||||||
if (colourContainer == null) return;
|
if (colourContainer == null) return;
|
||||||
colourContainer.Colour = ButtonColour;
|
colourContainer.Colour = ButtonColour;
|
||||||
|
reapplyGlow();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,6 +54,7 @@ namespace osu.Game.Overlays.Pause
|
|||||||
public AudioSample SampleClick, SampleHover;
|
public AudioSample SampleClick, SampleHover;
|
||||||
|
|
||||||
private Container backgroundContainer, colourContainer, glowContainer;
|
private Container backgroundContainer, colourContainer, glowContainer;
|
||||||
|
private Box leftGlow, centerGlow, rightGlow;
|
||||||
private SpriteText spriteText;
|
private SpriteText spriteText;
|
||||||
|
|
||||||
private bool didClick; // Used for making sure that the OnMouseDown animation can call instead of OnHoverLost's
|
private bool didClick; // Used for making sure that the OnMouseDown animation can call instead of OnHoverLost's
|
||||||
@ -99,6 +101,14 @@ namespace osu.Game.Overlays.Pause
|
|||||||
didClick = false;
|
didClick = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void reapplyGlow()
|
||||||
|
{
|
||||||
|
if (leftGlow == null || centerGlow == null || rightGlow == null) return;
|
||||||
|
leftGlow.ColourInfo = ColourInfo.GradientHorizontal(new Color4(ButtonColour.R, ButtonColour.G, ButtonColour.B, 0f), ButtonColour);
|
||||||
|
centerGlow.Colour = ButtonColour;
|
||||||
|
rightGlow.ColourInfo = ColourInfo.GradientHorizontal(ButtonColour, new Color4(ButtonColour.R, ButtonColour.G, ButtonColour.B, 0f));
|
||||||
|
}
|
||||||
|
|
||||||
public PauseButton()
|
public PauseButton()
|
||||||
{
|
{
|
||||||
Add(new Drawable[]
|
Add(new Drawable[]
|
||||||
@ -123,7 +133,7 @@ namespace osu.Game.Overlays.Pause
|
|||||||
Alpha = 0f,
|
Alpha = 0f,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new Box
|
leftGlow = new Box
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Origin = Anchor.TopLeft,
|
Origin = Anchor.TopLeft,
|
||||||
@ -131,7 +141,7 @@ namespace osu.Game.Overlays.Pause
|
|||||||
Width = 0.125f,
|
Width = 0.125f,
|
||||||
ColourInfo = ColourInfo.GradientHorizontal(new Color4(ButtonColour.R, ButtonColour.G, ButtonColour.B, 0f), ButtonColour)
|
ColourInfo = ColourInfo.GradientHorizontal(new Color4(ButtonColour.R, ButtonColour.G, ButtonColour.B, 0f), ButtonColour)
|
||||||
},
|
},
|
||||||
new Box
|
centerGlow = new Box
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
@ -139,7 +149,7 @@ namespace osu.Game.Overlays.Pause
|
|||||||
Width = 0.75f,
|
Width = 0.75f,
|
||||||
Colour = ButtonColour
|
Colour = ButtonColour
|
||||||
},
|
},
|
||||||
new Box
|
rightGlow = new Box
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Origin = Anchor.TopRight,
|
Origin = Anchor.TopRight,
|
||||||
@ -203,6 +213,8 @@ namespace osu.Game.Overlays.Pause
|
|||||||
Colour = Color4.White,
|
Colour = Color4.White,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
reapplyGlow();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user