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:
parent
b3d4da8fc9
commit
a9915d6a64
@ -14,6 +14,7 @@ namespace osu.Game.Overlays
|
||||
public partial class OverlayRulesetSelector : RulesetSelector
|
||||
{
|
||||
public OverlayRulesetSelector()
|
||||
: base(true)
|
||||
{
|
||||
AutoSizeAxes = Axes.Both;
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user