mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 11:22:54 +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();
|
base.LoadComplete();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onScopeChanged(ValueChangedEvent<RankingsScope> scope)
|
private void onScopeChanged(ValueChangedEvent<RankingsScope> scope) => scopeText.Text = scope.NewValue.ToString();
|
||||||
{
|
|
||||||
scopeText.Text = scope.NewValue.ToString();
|
|
||||||
|
|
||||||
if (scope.NewValue != RankingsScope.Performance)
|
|
||||||
Country.Value = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onCountryChanged(ValueChangedEvent<Country> country)
|
private void onCountryChanged(ValueChangedEvent<Country> country)
|
||||||
{
|
{
|
||||||
@ -90,8 +84,6 @@ namespace osu.Game.Overlays.Rankings
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Scope.Value = RankingsScope.Performance;
|
|
||||||
|
|
||||||
flag.Country = country.NewValue;
|
flag.Country = country.NewValue;
|
||||||
flag.Show();
|
flag.Show();
|
||||||
}
|
}
|
||||||
|
@ -98,9 +98,25 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
country.BindValueChanged(_ => redraw(), true);
|
country.BindValueChanged(_ =>
|
||||||
scope.BindValueChanged(_ => redraw(), true);
|
{
|
||||||
ruleset.BindValueChanged(_ => redraw(), true);
|
// 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();
|
base.LoadComplete();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,7 +130,7 @@ namespace osu.Game.Overlays
|
|||||||
country.Value = requested;
|
country.Value = requested;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void redraw()
|
private void loadNewContent()
|
||||||
{
|
{
|
||||||
scrollFlow.ScrollToStart();
|
scrollFlow.ScrollToStart();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user