From d3958eb3fbc518f7fc2e273e19da90924b22e897 Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Mon, 23 Aug 2021 13:23:57 +0300 Subject: [PATCH] Revert initial ruleset value logic --- .../BeatmapSet/BeatmapRulesetSelector.cs | 2 -- osu.Game/Overlays/OverlayRulesetSelector.cs | 14 -------------- osu.Game/Rulesets/RulesetSelector.cs | 17 ----------------- 3 files changed, 33 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/BeatmapRulesetSelector.cs b/osu.Game/Overlays/BeatmapSet/BeatmapRulesetSelector.cs index 3e707fc091..005d21726b 100644 --- a/osu.Game/Overlays/BeatmapSet/BeatmapRulesetSelector.cs +++ b/osu.Game/Overlays/BeatmapSet/BeatmapRulesetSelector.cs @@ -11,8 +11,6 @@ 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 60b16abd48..8c44157f78 100644 --- a/osu.Game/Overlays/OverlayRulesetSelector.cs +++ b/osu.Game/Overlays/OverlayRulesetSelector.cs @@ -1,11 +1,9 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.UserInterface; -using osu.Game.Online.API; using osu.Game.Rulesets; using osuTK; @@ -18,18 +16,6 @@ namespace osu.Game.Overlays AutoSizeAxes = Axes.Both; } - [BackgroundDependencyLoader] - private void load(RulesetStore store, IAPIProvider api) - { - if (SelectInitialRuleset) - { - var preferredRuleset = store.GetRuleset(api.LocalUser.Value.PlayMode); - - if (preferredRuleset != null) - Current.Value = preferredRuleset; - } - } - protected override TabItem CreateTabItem(RulesetInfo value) => new OverlayRulesetTabItem(value); protected override TabFillFlowContainer CreateTabFlow() => new TabFillFlowContainer diff --git a/osu.Game/Rulesets/RulesetSelector.cs b/osu.Game/Rulesets/RulesetSelector.cs index e5d39fa144..8e6ec556d2 100644 --- a/osu.Game/Rulesets/RulesetSelector.cs +++ b/osu.Game/Rulesets/RulesetSelector.cs @@ -1,7 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using System.Linq; using osu.Framework.Graphics.UserInterface; using osu.Framework.Allocation; @@ -14,27 +13,11 @@ 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); - - 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(); - } } } }