// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using System.Linq; using osu.Framework; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Localisation; using osu.Game.Graphics.UserInterfaceV2; using osu.Game.Localisation; using osu.Game.Overlays.Settings; using osu.Game.Rulesets.Mania.Configuration; using osu.Game.Rulesets.Mania.UI; namespace osu.Game.Rulesets.Mania { public partial class ManiaSettingsSubsection : RulesetSettingsSubsection { protected override LocalisableString Header => "osu!mania"; public ManiaSettingsSubsection(ManiaRuleset ruleset) : base(ruleset) { } [BackgroundDependencyLoader] private void load() { var config = (ManiaRulesetConfigManager)Config; Children = new Drawable[] { new SettingsItemV2(new FormEnumDropdown { Caption = RulesetSettingsStrings.ScrollingDirection, Current = config.GetBindable(ManiaRulesetSetting.ScrollDirection) }), new SettingsItemV2(new FormSliderBar { Caption = RulesetSettingsStrings.ScrollSpeed, Current = config.GetBindable(ManiaRulesetSetting.ScrollSpeed), KeyboardStep = 1, LabelFormat = v => RulesetSettingsStrings.ScrollSpeedTooltip((int)DrawableManiaRuleset.ComputeScrollTime(v), v), }), new SettingsItemV2(new FormCheckBox { Caption = RulesetSettingsStrings.TimingBasedColouring, Current = config.GetBindable(ManiaRulesetSetting.TimingBasedNoteColouring), }) { Keywords = new[] { "color" }, }, }; Add(new SettingsItemV2(new FormCheckBox { Caption = RulesetSettingsStrings.TouchOverlay, Current = config.GetBindable(ManiaRulesetSetting.TouchOverlay) })); if (RuntimeInfo.IsMobile) { Add(new SettingsItemV2(new FormEnumDropdown { Caption = RulesetSettingsStrings.MobileLayout, Current = config.GetBindable(ManiaRulesetSetting.MobileLayout), #pragma warning disable CS0618 // Type or member is obsolete Items = Enum.GetValues().Where(l => l != ManiaMobileLayout.LandscapeWithOverlay), #pragma warning restore CS0618 // Type or member is obsolete })); } } } }