From 13df477fc0fc97ea20994777b8b494da14d74fdb Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 16 Jun 2025 19:39:37 +0900 Subject: [PATCH] Fix failing test --- .../UserInterface/TestSceneLoadingLayer.cs | 6 ++---- .../Graphics/UserInterface/LoadingLayer.cs | 19 ++----------------- 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneLoadingLayer.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneLoadingLayer.cs index dc40ecde43..66bf870f90 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneLoadingLayer.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneLoadingLayer.cs @@ -67,11 +67,11 @@ namespace osu.Game.Tests.Visual.UserInterface AddStep("show", () => overlay.Show()); - AddUntilStep("wait for content dim", () => overlay.BackgroundDimLayer.Alpha > 0); + AddUntilStep("wait for content dim", () => overlay.Alpha > 0); AddStep("hide", () => overlay.Hide()); - AddUntilStep("wait for content restore", () => Precision.AlmostEquals(overlay.BackgroundDimLayer.Alpha, 0)); + AddUntilStep("wait for content restore", () => Precision.AlmostEquals(overlay.Alpha, 0)); } [Test] @@ -90,8 +90,6 @@ namespace osu.Game.Tests.Visual.UserInterface private partial class TestLoadingLayer : LoadingLayer { - public new Box BackgroundDimLayer => base.BackgroundDimLayer; - public TestLoadingLayer(bool dimBackground = false, bool withBox = true) : base(dimBackground, withBox) { diff --git a/osu.Game/Graphics/UserInterface/LoadingLayer.cs b/osu.Game/Graphics/UserInterface/LoadingLayer.cs index fd0cc755a1..8d7852562a 100644 --- a/osu.Game/Graphics/UserInterface/LoadingLayer.cs +++ b/osu.Game/Graphics/UserInterface/LoadingLayer.cs @@ -22,9 +22,6 @@ namespace osu.Game.Graphics.UserInterface { private readonly bool blockInput; - [CanBeNull] - protected Box BackgroundDimLayer { get; } - /// /// Construct a new loading spinner. /// @@ -42,11 +39,11 @@ namespace osu.Game.Graphics.UserInterface if (dimBackground) { - AddInternal(BackgroundDimLayer = new Box + AddInternal(new Box { Depth = float.MaxValue, Colour = Color4.Black, - Alpha = 0, + Alpha = 0.5f, RelativeSizeAxes = Axes.Both, }); } @@ -74,18 +71,6 @@ namespace osu.Game.Graphics.UserInterface return true; } - protected override void PopIn() - { - BackgroundDimLayer?.FadeTo(0.5f, TRANSITION_DURATION * 2, Easing.OutQuint); - base.PopIn(); - } - - protected override void PopOut() - { - BackgroundDimLayer?.FadeOut(TRANSITION_DURATION, Easing.OutQuint); - base.PopOut(); - } - protected override void Update() { base.Update();