// 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; namespace osu.Game.Overlays { public class OverlayRulesetSelector : RulesetSelector { public OverlayRulesetSelector() { 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 { AutoSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, Spacing = new Vector2(20, 0), }; } }