From 21e5ae5ba975aa072e0246196971ebd347aa05a8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 7 Feb 2024 16:43:53 +0800 Subject: [PATCH] Minor adjustments --- .../Rankings/RankingsOverlayHeader.cs | 29 ++++++++++++++----- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/osu.Game/Overlays/Rankings/RankingsOverlayHeader.cs b/osu.Game/Overlays/Rankings/RankingsOverlayHeader.cs index 1c743ff152..cf132ed4da 100644 --- a/osu.Game/Overlays/Rankings/RankingsOverlayHeader.cs +++ b/osu.Game/Overlays/Rankings/RankingsOverlayHeader.cs @@ -1,13 +1,11 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -#nullable disable - using osu.Framework.Bindables; -using osu.Game.Localisation; -using osu.Game.Resources.Localisation.Web; using osu.Framework.Graphics; using osu.Game.Graphics; +using osu.Game.Localisation; +using osu.Game.Resources.Localisation.Web; using osu.Game.Rulesets; using osu.Game.Users; @@ -19,8 +17,8 @@ public partial class RankingsOverlayHeader : TabControlOverlayHeader Country => countryFilter.Current; - private OverlayRulesetSelector rulesetSelector; - private CountryFilter countryFilter; + private OverlayRulesetSelector rulesetSelector = null!; + private CountryFilter countryFilter = null!; protected override OverlayTitle CreateTitle() => new RankingsTitle(); @@ -46,8 +44,23 @@ protected override void LoadComplete() Current.BindValueChanged(scope => { - rulesetSelector.FadeTo(scope.NewValue <= RankingsScope.Country ? 1 : 0, 200, Easing.OutQuint); - }); + rulesetSelector.FadeTo(showRulesetSelector(scope.NewValue) ? 1 : 0, 200, Easing.OutQuint); + }, true); + + bool showRulesetSelector(RankingsScope scope) + { + switch (scope) + { + case RankingsScope.Performance: + case RankingsScope.Spotlights: + case RankingsScope.Score: + case RankingsScope.Country: + return true; + + default: + return false; + } + } } } }