diff --git a/osu.Game/Overlays/BeatmapSet/BeatmapRulesetSelector.cs b/osu.Game/Overlays/BeatmapSet/BeatmapRulesetSelector.cs index 005d21726b..c46a3966ee 100644 --- a/osu.Game/Overlays/BeatmapSet/BeatmapRulesetSelector.cs +++ b/osu.Game/Overlays/BeatmapSet/BeatmapRulesetSelector.cs @@ -6,11 +6,14 @@ using osu.Framework.Graphics.UserInterface; using osu.Game.Beatmaps; using osu.Game.Rulesets; using System.Linq; +using osu.Framework.Allocation; namespace osu.Game.Overlays.BeatmapSet { public class BeatmapRulesetSelector : OverlayRulesetSelector { + protected override bool SelectInitialRuleset => false; + private readonly Bindable beatmapSet = new Bindable(); public BeatmapSetInfo BeatmapSet diff --git a/osu.Game/Overlays/OverlayRulesetSelector.cs b/osu.Game/Overlays/OverlayRulesetSelector.cs index 74b8d0d3be..60b16abd48 100644 --- a/osu.Game/Overlays/OverlayRulesetSelector.cs +++ b/osu.Game/Overlays/OverlayRulesetSelector.cs @@ -21,10 +21,13 @@ namespace osu.Game.Overlays [BackgroundDependencyLoader] private void load(RulesetStore store, IAPIProvider api) { - var preferredRuleset = store.GetRuleset(api.LocalUser.Value.PlayMode); + if (SelectInitialRuleset) + { + var preferredRuleset = store.GetRuleset(api.LocalUser.Value.PlayMode); - if (preferredRuleset != null) - Current.Value = preferredRuleset; + if (preferredRuleset != null) + Current.Value = preferredRuleset; + } } protected override TabItem CreateTabItem(RulesetInfo value) => new OverlayRulesetTabItem(value); diff --git a/osu.Game/Rulesets/RulesetSelector.cs b/osu.Game/Rulesets/RulesetSelector.cs index e4d8f89a22..e5d39fa144 100644 --- a/osu.Game/Rulesets/RulesetSelector.cs +++ b/osu.Game/Rulesets/RulesetSelector.cs @@ -14,17 +14,27 @@ namespace osu.Game.Rulesets protected override Dropdown CreateDropdown() => null; + protected virtual bool SelectInitialRuleset => true; + + protected RulesetSelector() + { + SelectFirstTabByDefault = false; + } + [BackgroundDependencyLoader] private void load() { foreach (var r in Rulesets.AvailableRulesets) AddItem(r); - // This is supposed to be an implicit process in the base class, but the problem is that it happens in LoadComplete. - // That can become an issue with overlays that require access to the initial ruleset value - // before the ruleset selectors reached a LoadComplete state. - // (e.g. displaying RankingsOverlay for the first time). - Current.Value = Items.First(); + if (SelectInitialRuleset) + { + // This is supposed to be an implicit process in the base class, but the problem is that it happens in LoadComplete. + // That can become an issue with overlays that require access to the initial ruleset value + // before the ruleset selectors reached a LoadComplete state. + // (e.g. displaying RankingsOverlay for the first time). + Current.Value = Items.First(); + } } } }