mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 02:33:20 +08:00
Move scope/country restrictions into RankingsOverlay
This commit is contained in:
parent
753715f7db
commit
5f9b9631ef
@ -74,13 +74,7 @@ namespace osu.Game.Overlays.Rankings
|
||||
base.LoadComplete();
|
||||
}
|
||||
|
||||
private void onScopeChanged(ValueChangedEvent<RankingsScope> scope)
|
||||
{
|
||||
scopeText.Text = scope.NewValue.ToString();
|
||||
|
||||
if (scope.NewValue != RankingsScope.Performance)
|
||||
Country.Value = null;
|
||||
}
|
||||
private void onScopeChanged(ValueChangedEvent<RankingsScope> scope) => scopeText.Text = scope.NewValue.ToString();
|
||||
|
||||
private void onCountryChanged(ValueChangedEvent<Country> country)
|
||||
{
|
||||
@ -90,8 +84,6 @@ namespace osu.Game.Overlays.Rankings
|
||||
return;
|
||||
}
|
||||
|
||||
Scope.Value = RankingsScope.Performance;
|
||||
|
||||
flag.Country = country.NewValue;
|
||||
flag.Show();
|
||||
}
|
||||
|
@ -98,9 +98,25 @@ namespace osu.Game.Overlays
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
country.BindValueChanged(_ => redraw(), true);
|
||||
scope.BindValueChanged(_ => redraw(), true);
|
||||
ruleset.BindValueChanged(_ => redraw(), true);
|
||||
country.BindValueChanged(_ =>
|
||||
{
|
||||
// if a country is requested, force performance scope.
|
||||
if (country.Value != null)
|
||||
scope.Value = RankingsScope.Performance;
|
||||
|
||||
Scheduler.AddOnce(loadNewContent);
|
||||
}, true);
|
||||
scope.BindValueChanged(_ =>
|
||||
{
|
||||
// country filtering is only valid for performance scope.
|
||||
if (scope.Value != RankingsScope.Performance)
|
||||
country.Value = null;
|
||||
|
||||
Scheduler.AddOnce(loadNewContent);
|
||||
}, true);
|
||||
|
||||
ruleset.BindValueChanged(_ => Scheduler.AddOnce(loadNewContent), true);
|
||||
|
||||
base.LoadComplete();
|
||||
}
|
||||
|
||||
@ -114,7 +130,7 @@ namespace osu.Game.Overlays
|
||||
country.Value = requested;
|
||||
}
|
||||
|
||||
private void redraw()
|
||||
private void loadNewContent()
|
||||
{
|
||||
scrollFlow.ScrollToStart();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user