1
0
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:
SailorSnoW 2024-12-20 01:28:51 +01:00
parent 80ba0a05b4
commit 2c256475e0
2 changed files with 11 additions and 10 deletions

View File

@ -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();
}
}
}

View File

@ -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);
}