mirror of
https://github.com/ppy/osu.git
synced 2024-11-13 17:27:48 +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 partial class OverlayRulesetSelector : RulesetSelector
|
||||||
{
|
{
|
||||||
public OverlayRulesetSelector()
|
public OverlayRulesetSelector()
|
||||||
|
: base(true)
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Both;
|
AutoSizeAxes = Axes.Both;
|
||||||
}
|
}
|
||||||
|
@ -16,11 +16,23 @@ namespace osu.Game.Rulesets
|
|||||||
|
|
||||||
protected override Dropdown<RulesetInfo> CreateDropdown() => null;
|
protected override Dropdown<RulesetInfo> CreateDropdown() => null;
|
||||||
|
|
||||||
|
private readonly bool legacyOnly;
|
||||||
|
|
||||||
|
public RulesetSelector(bool legacyOnly = false)
|
||||||
|
{
|
||||||
|
this.legacyOnly = legacyOnly;
|
||||||
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
foreach (var ruleset in Rulesets.AvailableRulesets)
|
foreach (var ruleset in Rulesets.AvailableRulesets)
|
||||||
{
|
{
|
||||||
|
int id = ruleset.OnlineID;
|
||||||
|
|
||||||
|
if ((id < 0 || id > 3) && legacyOnly)
|
||||||
|
continue;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
AddItem(ruleset);
|
AddItem(ruleset);
|
||||||
|
Loading…
Reference in New Issue
Block a user