1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 10:52:53 +08:00

Revert initial ruleset value logic

This commit is contained in:
Salman Ahmed 2021-08-23 13:23:57 +03:00
parent f4b69ceb8a
commit d3958eb3fb
3 changed files with 0 additions and 33 deletions

View File

@ -11,8 +11,6 @@ namespace osu.Game.Overlays.BeatmapSet
{
public class BeatmapRulesetSelector : OverlayRulesetSelector
{
protected override bool SelectInitialRuleset => false;
private readonly Bindable<BeatmapSetInfo> beatmapSet = new Bindable<BeatmapSetInfo>();
public BeatmapSetInfo BeatmapSet

View File

@ -1,11 +1,9 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. 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<RulesetInfo> CreateTabItem(RulesetInfo value) => new OverlayRulesetTabItem(value);
protected override TabFillFlowContainer CreateTabFlow() => new TabFillFlowContainer

View File

@ -1,7 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. 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<RulesetInfo> 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();
}
}
}
}