From 81aa7feeb5299d18d6cb02e47cce53c0b6c7e45d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 17 Jan 2023 18:35:30 +0900 Subject: [PATCH] Fix using `FadeTo` on a visibility container --- .../JudgementCounterDisplay.cs | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterDisplay.cs b/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterDisplay.cs index a9a3ca2cf6..1d82fa5397 100644 --- a/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterDisplay.cs +++ b/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterDisplay.cs @@ -78,25 +78,27 @@ namespace osu.Game.Screens.Play.HUD.JudgementCounter { foreach (var counter in CounterFlow.Children) { - if (counter.Result.Type.IsBasic()) - { + if (shouldShow(counter)) counter.Show(); - continue; - } + else + counter.Hide(); + } + + bool shouldShow(JudgementCounter counter) + { + if (counter.Result.Type.IsBasic()) + return true; switch (Mode.Value) { case DisplayMode.Simple: - counter.Hide(); - break; + return false; case DisplayMode.Normal: - counter.FadeTo(counter.Result.Type.IsBonus() ? 0 : 1); - break; + return !counter.Result.Type.IsBonus(); case DisplayMode.All: - counter.Show(); - break; + return true; default: throw new ArgumentOutOfRangeException();