mirror of
https://github.com/ppy/osu.git
synced 2025-02-02 03:22:55 +08:00
Merge pull request #27070 from Joehuu/hide-ruleset-selector-kudosu
Hide ruleset selector when on kudosu ranking
This commit is contained in:
commit
7460d077f7
@ -1,13 +1,11 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Game.Localisation;
|
|
||||||
using osu.Game.Resources.Localisation.Web;
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
using osu.Game.Localisation;
|
||||||
|
using osu.Game.Resources.Localisation.Web;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Users;
|
using osu.Game.Users;
|
||||||
|
|
||||||
@ -19,8 +17,8 @@ namespace osu.Game.Overlays.Rankings
|
|||||||
|
|
||||||
public Bindable<CountryCode> Country => countryFilter.Current;
|
public Bindable<CountryCode> Country => countryFilter.Current;
|
||||||
|
|
||||||
private OverlayRulesetSelector rulesetSelector;
|
private OverlayRulesetSelector rulesetSelector = null!;
|
||||||
private CountryFilter countryFilter;
|
private CountryFilter countryFilter = null!;
|
||||||
|
|
||||||
protected override OverlayTitle CreateTitle() => new RankingsTitle();
|
protected override OverlayTitle CreateTitle() => new RankingsTitle();
|
||||||
|
|
||||||
@ -39,5 +37,30 @@ namespace osu.Game.Overlays.Rankings
|
|||||||
Icon = OsuIcon.Ranking;
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user