1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-14 15:57:24 +08:00

Merge pull request #29212 from peppy/flash-customise-button

Flash customise button on mod overlay when it becomes available
This commit is contained in:
Bartłomiej Dach 2024-07-31 16:39:35 +02:00 committed by GitHub
commit c180e2e04b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,6 +4,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
@ -11,14 +12,16 @@ using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Containers; using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osuTK;
using osu.Game.Localisation; using osu.Game.Localisation;
using osuTK;
using osuTK.Graphics;
namespace osu.Game.Overlays.Mods namespace osu.Game.Overlays.Mods
{ {
public partial class ModCustomisationHeader : OsuHoverContainer public partial class ModCustomisationHeader : OsuHoverContainer
{ {
private Box background = null!; private Box background = null!;
private Box backgroundFlash = null!;
private SpriteIcon icon = null!; private SpriteIcon icon = null!;
[Resolved] [Resolved]
@ -46,6 +49,12 @@ namespace osu.Game.Overlays.Mods
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
}, },
backgroundFlash = new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.White.Opacity(0.4f),
Blending = BlendingParameters.Additive,
},
new OsuSpriteText new OsuSpriteText
{ {
Anchor = Anchor.CentreLeft, Anchor = Anchor.CentreLeft,
@ -84,6 +93,12 @@ namespace osu.Game.Overlays.Mods
TooltipText = e.NewValue TooltipText = e.NewValue
? string.Empty ? string.Empty
: ModSelectOverlayStrings.CustomisationPanelDisabledReason; : ModSelectOverlayStrings.CustomisationPanelDisabledReason;
if (e.NewValue)
{
backgroundFlash.FadeInFromZero(150, Easing.OutQuad).Then()
.FadeOutFromOne(350, Easing.OutQuad);
}
}, true); }, true);
Expanded.BindValueChanged(v => Expanded.BindValueChanged(v =>