1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 11:20:04 +08:00

Make OverlayRulesetSelector display only legacy rulesets

This commit is contained in:
Andrei Zavatski 2023-01-12 22:44:41 +03:00
parent b3d4da8fc9
commit a9915d6a64
2 changed files with 13 additions and 0 deletions

View File

@ -14,6 +14,7 @@ namespace osu.Game.Overlays
public partial class OverlayRulesetSelector : RulesetSelector
{
public OverlayRulesetSelector()
: base(true)
{
AutoSizeAxes = Axes.Both;
}

View File

@ -16,11 +16,23 @@ namespace osu.Game.Rulesets
protected override Dropdown<RulesetInfo> CreateDropdown() => null;
private readonly bool legacyOnly;
public RulesetSelector(bool legacyOnly = false)
{
this.legacyOnly = legacyOnly;
}
[BackgroundDependencyLoader]
private void load()
{
foreach (var ruleset in Rulesets.AvailableRulesets)
{
int id = ruleset.OnlineID;
if ((id < 0 || id > 3) && legacyOnly)
continue;
try
{
AddItem(ruleset);