mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 13:22:55 +08:00
Revert initial ruleset value logic
This commit is contained in:
parent
f4b69ceb8a
commit
d3958eb3fb
@ -11,8 +11,6 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
{
|
{
|
||||||
public class BeatmapRulesetSelector : OverlayRulesetSelector
|
public class BeatmapRulesetSelector : OverlayRulesetSelector
|
||||||
{
|
{
|
||||||
protected override bool SelectInitialRuleset => false;
|
|
||||||
|
|
||||||
private readonly Bindable<BeatmapSetInfo> beatmapSet = new Bindable<BeatmapSetInfo>();
|
private readonly Bindable<BeatmapSetInfo> beatmapSet = new Bindable<BeatmapSetInfo>();
|
||||||
|
|
||||||
public BeatmapSetInfo BeatmapSet
|
public BeatmapSetInfo BeatmapSet
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.UserInterface;
|
using osu.Framework.Graphics.UserInterface;
|
||||||
using osu.Game.Online.API;
|
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
@ -18,18 +16,6 @@ namespace osu.Game.Overlays
|
|||||||
AutoSizeAxes = Axes.Both;
|
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 TabItem<RulesetInfo> CreateTabItem(RulesetInfo value) => new OverlayRulesetTabItem(value);
|
||||||
|
|
||||||
protected override TabFillFlowContainer CreateTabFlow() => new TabFillFlowContainer
|
protected override TabFillFlowContainer CreateTabFlow() => new TabFillFlowContainer
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System.Linq;
|
|
||||||
using osu.Framework.Graphics.UserInterface;
|
using osu.Framework.Graphics.UserInterface;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
|
||||||
@ -14,27 +13,11 @@ namespace osu.Game.Rulesets
|
|||||||
|
|
||||||
protected override Dropdown<RulesetInfo> CreateDropdown() => null;
|
protected override Dropdown<RulesetInfo> CreateDropdown() => null;
|
||||||
|
|
||||||
protected virtual bool SelectInitialRuleset => true;
|
|
||||||
|
|
||||||
protected RulesetSelector()
|
|
||||||
{
|
|
||||||
SelectFirstTabByDefault = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
foreach (var r in Rulesets.AvailableRulesets)
|
foreach (var r in Rulesets.AvailableRulesets)
|
||||||
AddItem(r);
|
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();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user