1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 03:42:57 +08:00

Use property instead of ctor parameter

This commit is contained in:
Andrei Zavatski 2023-01-12 23:26:29 +03:00
parent a7ac31fa34
commit d74a5ef9e6
2 changed files with 5 additions and 8 deletions

View File

@ -13,8 +13,10 @@ namespace osu.Game.Overlays
{
public partial class OverlayRulesetSelector : RulesetSelector
{
// Since this component is used in online overlays and currently web-side doesn't support non-legacy rulesets - let's disable them for now.
protected override bool LegacyOnly => true;
public OverlayRulesetSelector()
: base(true)
{
AutoSizeAxes = Axes.Both;
}

View File

@ -17,19 +17,14 @@ namespace osu.Game.Rulesets
protected override Dropdown<RulesetInfo> CreateDropdown() => null;
private readonly bool legacyOnly;
public RulesetSelector(bool legacyOnly = false)
{
this.legacyOnly = legacyOnly;
}
protected virtual bool LegacyOnly => false;
[BackgroundDependencyLoader]
private void load()
{
foreach (var ruleset in Rulesets.AvailableRulesets)
{
if (!ruleset.IsLegacyRuleset() && legacyOnly)
if (!ruleset.IsLegacyRuleset() && LegacyOnly)
continue;
try