diff --git a/osu.Game/Screens/Play/Break/BlurredIcon.cs b/osu.Game/Screens/Play/Break/BlurredIcon.cs index 2bf59ea63b..9cd617d3e3 100644 --- a/osu.Game/Screens/Play/Break/BlurredIcon.cs +++ b/osu.Game/Screens/Play/Break/BlurredIcon.cs @@ -1,52 +1,16 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using osu.Framework.Allocation; using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Sprites; -using osu.Game.Graphics; -using osuTK; namespace osu.Game.Screens.Play.Break { - public partial class BlurredIcon : BufferedContainer + public partial class BlurredIcon : GlowIcon { - private readonly SpriteIcon icon; - - public IconUsage Icon - { - set => icon.Icon = value; - get => icon.Icon; - } - - public override Vector2 Size - { - set - { - icon.Size = value; - base.Size = value + BlurSigma * 5; - ForceRedraw(); - } - get => base.Size; - } - public BlurredIcon() - : base(cachedFrameBuffer: true) { - RelativePositionAxes = Axes.X; - Child = icon = new SpriteIcon - { - Origin = Anchor.Centre, - Anchor = Anchor.Centre, - Shadow = false, - }; - } - - [BackgroundDependencyLoader] - private void load(OsuColour colours) - { - Colour = colours.BlueLighter; + EffectBlending = BlendingParameters.Additive; + DrawOriginal = false; } } } diff --git a/osu.Game/Screens/Play/Break/GlowIcon.cs b/osu.Game/Screens/Play/Break/GlowIcon.cs index 8e2b9da0ad..a68cfdac42 100644 --- a/osu.Game/Screens/Play/Break/GlowIcon.cs +++ b/osu.Game/Screens/Play/Break/GlowIcon.cs @@ -3,64 +3,45 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Game.Graphics; +using osu.Game.Graphics.Sprites; using osuTK; namespace osu.Game.Screens.Play.Break { - public partial class GlowIcon : Container + public partial class GlowIcon : GlowingDrawable { - private readonly SpriteIcon spriteIcon; - private readonly BlurredIcon blurredIcon; - - public override Vector2 Size - { - get => base.Size; - set - { - blurredIcon.Size = spriteIcon.Size = value; - blurredIcon.ForceRedraw(); - } - } - - public Vector2 BlurSigma - { - get => blurredIcon.BlurSigma; - set => blurredIcon.BlurSigma = value; - } + private SpriteIcon icon = null!; public IconUsage Icon { - get => spriteIcon.Icon; - set => spriteIcon.Icon = blurredIcon.Icon = value; + set => icon.Icon = value; + get => icon.Icon; + } + + public new Vector2 Size + { + set => icon.Size = value; + get => icon.Size; } public GlowIcon() { RelativePositionAxes = Axes.X; - AutoSizeAxes = Axes.Both; - Children = new Drawable[] - { - blurredIcon = new BlurredIcon - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - }, - spriteIcon = new SpriteIcon - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - Shadow = false, - } - }; } [BackgroundDependencyLoader] private void load(OsuColour colours) { - blurredIcon.Colour = colours.Blue; + GlowColour = colours.BlueLighter; } + + protected override Drawable CreateDrawable() => icon = new SpriteIcon + { + Origin = Anchor.Centre, + Anchor = Anchor.Centre, + Shadow = false, + }; } }