mirror of
https://github.com/ppy/osu.git
synced 2025-03-28 09:37:23 +08:00
Select user preferred ruleset on overlay ruleset selectors initially
This commit is contained in:
parent
2ad5914fec
commit
2ba88923b6
@ -1,9 +1,11 @@
|
|||||||
// 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;
|
||||||
|
|
||||||
@ -16,6 +18,15 @@ namespace osu.Game.Overlays
|
|||||||
AutoSizeAxes = Axes.Both;
|
AutoSizeAxes = Axes.Both;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(RulesetStore store, IAPIProvider api)
|
||||||
|
{
|
||||||
|
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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user