-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27070 from Joehuu/hide-ruleset-selector-kudosu
Hide ruleset selector when on kudosu ranking
- Loading branch information
Showing
1 changed file
with
29 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. 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<RankingsSco | |
|
||
public Bindable<CountryCode> Country => countryFilter.Current; | ||
|
||
private OverlayRulesetSelector rulesetSelector; | ||
private CountryFilter countryFilter; | ||
private OverlayRulesetSelector rulesetSelector = null!; | ||
private CountryFilter countryFilter = null!; | ||
|
||
protected override OverlayTitle CreateTitle() => new RankingsTitle(); | ||
|
||
|
@@ -39,5 +37,30 @@ public RankingsTitle() | |
Icon = OsuIcon.Ranking; | ||
} | ||
} | ||
|
||
protected override void LoadComplete() | ||
{ | ||
base.LoadComplete(); | ||
|
||
Current.BindValueChanged(scope => | ||
{ | ||
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; | ||
} | ||
} | ||
} | ||
} | ||
} |