From 42e4c933d374bc3ebc863ec38bc7951dd0498054 Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Thu, 18 Jan 2024 04:06:02 +0300 Subject: [PATCH] Fix ConstrainedIconContainer always using masking --- osu.Game/Beatmaps/Drawables/DifficultyIcon.cs | 1 - .../Containers/ConstrainedIconContainer.cs | 18 ------------------ .../Toolbar/ToolbarRulesetTabButton.cs | 11 +---------- 3 files changed, 1 insertion(+), 29 deletions(-) diff --git a/osu.Game/Beatmaps/Drawables/DifficultyIcon.cs b/osu.Game/Beatmaps/Drawables/DifficultyIcon.cs index 1665ec52fa..eecf79aa34 100644 --- a/osu.Game/Beatmaps/Drawables/DifficultyIcon.cs +++ b/osu.Game/Beatmaps/Drawables/DifficultyIcon.cs @@ -92,7 +92,6 @@ namespace osu.Game.Beatmaps.Drawables EdgeEffect = new EdgeEffectParameters { Colour = Color4.Black.Opacity(0.06f), - Type = EdgeEffectType.Shadow, Radius = 3, }, diff --git a/osu.Game/Graphics/Containers/ConstrainedIconContainer.cs b/osu.Game/Graphics/Containers/ConstrainedIconContainer.cs index 7722374c69..63ac84fcf7 100644 --- a/osu.Game/Graphics/Containers/ConstrainedIconContainer.cs +++ b/osu.Game/Graphics/Containers/ConstrainedIconContainer.cs @@ -4,7 +4,6 @@ using System; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Effects; using osuTK; namespace osu.Game.Graphics.Containers @@ -17,21 +16,9 @@ namespace osu.Game.Graphics.Containers public Drawable Icon { get => InternalChild; - set => InternalChild = value; } - /// - /// Determines an edge effect of this . - /// Edge effects are e.g. glow or a shadow. - /// Only has an effect when is true. - /// - public new EdgeEffectParameters EdgeEffect - { - get => base.EdgeEffect; - set => base.EdgeEffect = value; - } - protected override void Update() { base.Update(); @@ -49,10 +36,5 @@ namespace osu.Game.Graphics.Containers InternalChild.Origin = Anchor.Centre; } } - - public ConstrainedIconContainer() - { - Masking = true; - } } } diff --git a/osu.Game/Overlays/Toolbar/ToolbarRulesetTabButton.cs b/osu.Game/Overlays/Toolbar/ToolbarRulesetTabButton.cs index c224f0f9c9..3287ac6eaa 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarRulesetTabButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarRulesetTabButton.cs @@ -4,7 +4,6 @@ using osu.Framework.Allocation; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; -using osu.Framework.Graphics.Effects; using osu.Framework.Graphics.UserInterface; using osu.Framework.Input.Events; using osu.Game.Graphics; @@ -58,15 +57,7 @@ namespace osu.Game.Overlays.Toolbar { set => Scheduler.AddOnce(() => { - if (value) - { - IconContainer.Colour = Color4Extensions.FromHex("#00FFAA"); - } - else - { - IconContainer.Colour = colours.GrayF; - IconContainer.EdgeEffect = new EdgeEffectParameters(); - } + IconContainer.Colour = value ? Color4Extensions.FromHex("#00FFAA") : colours.GrayF; }); }