diff --git a/osu.Game.Rulesets.Mania.Tests/TestSceneManiaTouchInput.cs b/osu.Game.Rulesets.Mania.Tests/TestSceneManiaTouchInput.cs index b33c74d4e9..fc495a5ab0 100644 --- a/osu.Game.Rulesets.Mania.Tests/TestSceneManiaTouchInput.cs +++ b/osu.Game.Rulesets.Mania.Tests/TestSceneManiaTouchInput.cs @@ -137,7 +137,7 @@ namespace osu.Game.Rulesets.Mania.Tests private void toggleTouchControls(bool enabled) { var maniaConfig = (ManiaRulesetConfigManager)RulesetConfigs.GetConfigFor(CreatePlayerRuleset())!; - maniaConfig.SetValue(ManiaRulesetSetting.MobilePlayStyle, enabled ? ManiaMobilePlayStyle.TouchControls : ManiaMobilePlayStyle.TouchableColumns); + maniaConfig.SetValue(ManiaRulesetSetting.MobileLayout, enabled ? ManiaMobileLayout.LandscapeWithOverlay : ManiaMobileLayout.Portrait); } private ManiaTouchInputArea? getTouchOverlay() => this.ChildrenOfType().SingleOrDefault(); diff --git a/osu.Game.Rulesets.Mania/Configuration/ManiaRulesetConfigManager.cs b/osu.Game.Rulesets.Mania/Configuration/ManiaRulesetConfigManager.cs index 10a3236178..5242b6685c 100644 --- a/osu.Game.Rulesets.Mania/Configuration/ManiaRulesetConfigManager.cs +++ b/osu.Game.Rulesets.Mania/Configuration/ManiaRulesetConfigManager.cs @@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.Mania.Configuration SetDefault(ManiaRulesetSetting.ScrollSpeed, 8.0, 1.0, 40.0, 0.1); SetDefault(ManiaRulesetSetting.ScrollDirection, ManiaScrollingDirection.Down); SetDefault(ManiaRulesetSetting.TimingBasedNoteColouring, false); - SetDefault(ManiaRulesetSetting.MobilePlayStyle, ManiaMobilePlayStyle.TouchableColumns); + SetDefault(ManiaRulesetSetting.MobileLayout, ManiaMobileLayout.Portrait); #pragma warning disable CS0618 // Although obsolete, this is still required to populate the bindable from the database in case migration is required. @@ -57,6 +57,6 @@ namespace osu.Game.Rulesets.Mania.Configuration ScrollSpeed, ScrollDirection, TimingBasedNoteColouring, - MobilePlayStyle, + MobileLayout, } } diff --git a/osu.Game.Rulesets.Mania/ManiaMobilePlayStyle.cs b/osu.Game.Rulesets.Mania/ManiaMobileLayout.cs similarity index 62% rename from osu.Game.Rulesets.Mania/ManiaMobilePlayStyle.cs rename to osu.Game.Rulesets.Mania/ManiaMobileLayout.cs index e6b1224fd3..7d70dba092 100644 --- a/osu.Game.Rulesets.Mania/ManiaMobilePlayStyle.cs +++ b/osu.Game.Rulesets.Mania/ManiaMobileLayout.cs @@ -6,15 +6,15 @@ using osu.Game.Localisation; namespace osu.Game.Rulesets.Mania { - public enum ManiaMobilePlayStyle + public enum ManiaMobileLayout { - [LocalisableDescription(typeof(RulesetSettingsStrings), nameof(RulesetSettingsStrings.TouchableColumns))] - TouchableColumns, + [LocalisableDescription(typeof(RulesetSettingsStrings), nameof(RulesetSettingsStrings.PortraitExpandedColumns))] + Portrait, - [LocalisableDescription(typeof(RulesetSettingsStrings), nameof(RulesetSettingsStrings.TouchControls))] - TouchControls, + [LocalisableDescription(typeof(RulesetSettingsStrings), nameof(RulesetSettingsStrings.LandscapeExpandedColumns))] + Landscape, - [LocalisableDescription(typeof(RulesetSettingsStrings), nameof(RulesetSettingsStrings.ExtendedColumns))] - ExtendedColumns, + [LocalisableDescription(typeof(RulesetSettingsStrings), nameof(RulesetSettingsStrings.LandscapeTouchOverlay))] + LandscapeWithOverlay, } } diff --git a/osu.Game.Rulesets.Mania/ManiaSettingsSubsection.cs b/osu.Game.Rulesets.Mania/ManiaSettingsSubsection.cs index f558d30ee0..5ae7ec9480 100644 --- a/osu.Game.Rulesets.Mania/ManiaSettingsSubsection.cs +++ b/osu.Game.Rulesets.Mania/ManiaSettingsSubsection.cs @@ -1,6 +1,7 @@ // 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; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Localisation; @@ -45,12 +46,16 @@ namespace osu.Game.Rulesets.Mania LabelText = RulesetSettingsStrings.TimingBasedColouring, Current = config.GetBindable(ManiaRulesetSetting.TimingBasedNoteColouring), }, - new SettingsEnumDropdown - { - LabelText = RulesetSettingsStrings.MobilePlayStyle, - Current = config.GetBindable(ManiaRulesetSetting.MobilePlayStyle), - }, }; + + if (RuntimeInfo.IsMobile) + { + Add(new SettingsEnumDropdown + { + LabelText = RulesetSettingsStrings.MobileLayout, + Current = config.GetBindable(ManiaRulesetSetting.MobileLayout), + }); + } } private partial class ManiaScrollSlider : RoundedSliderBar diff --git a/osu.Game.Rulesets.Mania/UI/Column.cs b/osu.Game.Rulesets.Mania/UI/Column.cs index ebd8efe124..cb825761d1 100644 --- a/osu.Game.Rulesets.Mania/UI/Column.cs +++ b/osu.Game.Rulesets.Mania/UI/Column.cs @@ -58,7 +58,7 @@ namespace osu.Game.Rulesets.Mania.UI public readonly Bindable AccentColour = new Bindable(Color4.Black); - private IBindable mobilePlayStyle = null!; + private IBindable mobilePlayStyle = null!; public Column(int index, bool isSpecial) { @@ -120,7 +120,7 @@ namespace osu.Game.Rulesets.Mania.UI RegisterPool(10, 50); if (rulesetConfig != null) - mobilePlayStyle = rulesetConfig.GetBindable(ManiaRulesetSetting.MobilePlayStyle); + mobilePlayStyle = rulesetConfig.GetBindable(ManiaRulesetSetting.MobileLayout); } private void onSourceChanged() @@ -199,8 +199,8 @@ namespace osu.Game.Rulesets.Mania.UI protected override bool OnTouchDown(TouchDownEvent e) { - // if touch controls are selected, disallow columns from handling touch directly. - if (mobilePlayStyle.Value == ManiaMobilePlayStyle.TouchControls) + // if touch overlay is visible, disallow columns from handling touch directly. + if (mobilePlayStyle.Value == ManiaMobileLayout.LandscapeWithOverlay) return false; maniaInputManager?.KeyBindingContainer.TriggerPressed(Action.Value); diff --git a/osu.Game.Rulesets.Mania/UI/ColumnFlow.cs b/osu.Game.Rulesets.Mania/UI/ColumnFlow.cs index 46a7a70f27..3b19e90b60 100644 --- a/osu.Game.Rulesets.Mania/UI/ColumnFlow.cs +++ b/osu.Game.Rulesets.Mania/UI/ColumnFlow.cs @@ -66,14 +66,14 @@ namespace osu.Game.Rulesets.Mania.UI [Resolved] private ISkinSource skin { get; set; } = null!; - private readonly Bindable mobilePlayStyle = new Bindable(); + private readonly Bindable mobileLayout = new Bindable(); [BackgroundDependencyLoader] private void load(ManiaRulesetConfigManager? rulesetConfig) { - rulesetConfig?.BindWith(ManiaRulesetSetting.MobilePlayStyle, mobilePlayStyle); + rulesetConfig?.BindWith(ManiaRulesetSetting.MobileLayout, mobileLayout); - mobilePlayStyle.BindValueChanged(_ => updateColumnSize()); + mobileLayout.BindValueChanged(_ => updateColumnSize()); skin.SourceChanged += updateColumnSize; } @@ -102,7 +102,7 @@ namespace osu.Game.Rulesets.Mania.UI { float mobileAdjust = 1f; - if (mobilePlayStyle.Value == ManiaMobilePlayStyle.ExtendedColumns) + if (RuntimeInfo.IsMobile && mobileLayout.Value == ManiaMobileLayout.Landscape) { // GridContainer+CellContainer containing this stage (gets split up for dual stages). Vector2? containingCell = this.FindClosestParent()?.Parent?.DrawSize; diff --git a/osu.Game.Rulesets.Mania/UI/DrawableManiaRuleset.cs b/osu.Game.Rulesets.Mania/UI/DrawableManiaRuleset.cs index 2dcbcacf93..bac62d2b66 100644 --- a/osu.Game.Rulesets.Mania/UI/DrawableManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/UI/DrawableManiaRuleset.cs @@ -50,7 +50,7 @@ namespace osu.Game.Rulesets.Mania.UI public IEnumerable BarLines; - private bool playsWithTouchableColumns => Config.Get(ManiaRulesetSetting.MobilePlayStyle) == ManiaMobilePlayStyle.TouchableColumns; + private bool playsWithTouchableColumns => Config.Get(ManiaRulesetSetting.MobileLayout) == ManiaMobileLayout.Portrait; public override bool RequiresPortraitOrientation => Beatmap.Stages.Count == 1 && playsWithTouchableColumns; diff --git a/osu.Game.Rulesets.Mania/UI/ManiaTouchInputArea.cs b/osu.Game.Rulesets.Mania/UI/ManiaTouchInputArea.cs index 7cb6b3b96f..e9489d4c06 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaTouchInputArea.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaTouchInputArea.cs @@ -97,14 +97,14 @@ namespace osu.Game.Rulesets.Mania.UI }; } - private IBindable mobilePlayStyle = null!; + private IBindable mobilePlayStyle = null!; protected override void LoadComplete() { base.LoadComplete(); - mobilePlayStyle = rulesetConfig.GetBindable(ManiaRulesetSetting.MobilePlayStyle); - mobilePlayStyle.BindValueChanged(p => touchControls.Value = p.NewValue == ManiaMobilePlayStyle.TouchControls, true); + mobilePlayStyle = rulesetConfig.GetBindable(ManiaRulesetSetting.MobileLayout); + mobilePlayStyle.BindValueChanged(p => touchControls.Value = p.NewValue == ManiaMobileLayout.LandscapeWithOverlay, true); Opacity.BindValueChanged(o => Alpha = o.NewValue, true); } diff --git a/osu.Game/Localisation/RulesetSettingsStrings.cs b/osu.Game/Localisation/RulesetSettingsStrings.cs index 527707b011..fc4fb58e26 100644 --- a/osu.Game/Localisation/RulesetSettingsStrings.cs +++ b/osu.Game/Localisation/RulesetSettingsStrings.cs @@ -90,24 +90,24 @@ namespace osu.Game.Localisation public static LocalisableString TouchControlScheme => new TranslatableString(getKey(@"touch_control_scheme"), @"Touch control scheme"); /// - /// "Mobile play style" + /// "Mobile layout" /// - public static LocalisableString MobilePlayStyle => new TranslatableString(getKey(@"mobile_play_style"), @"Mobile play style"); + public static LocalisableString MobileLayout => new TranslatableString(getKey(@"mobile_layout"), @"Mobile layout"); /// - /// "Touchable columns" + /// "Portrait (expanded columns)" /// - public static LocalisableString TouchableColumns => new TranslatableString(getKey(@"touchable_columns"), @"Touchable columns"); + public static LocalisableString PortraitExpandedColumns => new TranslatableString(getKey(@"portrait_expanded_columns"), @"Portrait (expanded columns)"); /// - /// "Touch controls" + /// "Landscape (expanded columns)" /// - public static LocalisableString TouchControls => new TranslatableString(getKey(@"touch_controls"), @"Touch controls"); + public static LocalisableString LandscapeExpandedColumns => new TranslatableString(getKey(@"landscape_expanded_columns"), @"Landscape (expanded columns)"); /// - /// "Extended columns" + /// "Landscape (touch overlay)" /// - public static LocalisableString ExtendedColumns => new TranslatableString(getKey(@"extended_columns"), @"Extended columns"); + public static LocalisableString LandscapeTouchOverlay => new TranslatableString(getKey(@"landscape_touch_overlay"), @"Landscape (touch overlay)"); private static string getKey(string key) => $@"{prefix}:{key}"; }