mirror of
https://github.com/ppy/osu.git
synced 2025-01-30 01:32:55 +08:00
change show/hide page selector logic for small code quality improvement
This commit is contained in:
parent
80ba0a05b4
commit
2c256475e0
@ -32,8 +32,12 @@ namespace osu.Game.Overlays
|
||||
});
|
||||
}
|
||||
|
||||
public void ShowPageSelector() => pageSelector.Show();
|
||||
|
||||
public void HidePageSelector() => pageSelector.Hide();
|
||||
public void ShowPageSelector(bool visible)
|
||||
{
|
||||
if (visible)
|
||||
pageSelector.Show();
|
||||
else
|
||||
pageSelector.Hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -50,9 +50,10 @@ namespace osu.Game.Overlays
|
||||
if (!Country.IsDefault)
|
||||
{
|
||||
Header.Current.Value = RankingsScope.Performance;
|
||||
Header.HidePageSelector();
|
||||
}
|
||||
else Header.ShowPageSelector();
|
||||
|
||||
// Hide page selection with country filter
|
||||
Header.ShowPageSelector(Country.IsDefault);
|
||||
|
||||
Scheduler.AddOnce(triggerTabChanged);
|
||||
});
|
||||
@ -86,11 +87,7 @@ namespace osu.Game.Overlays
|
||||
Country.SetDefault();
|
||||
|
||||
// Hide page selection for spotlights scope
|
||||
if (tab == RankingsScope.Spotlights)
|
||||
{
|
||||
Header.HidePageSelector();
|
||||
}
|
||||
else Header.ShowPageSelector();
|
||||
Header.ShowPageSelector(tab != RankingsScope.Spotlights);
|
||||
|
||||
Scheduler.AddOnce(triggerTabChanged);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user