mirror of
https://github.com/ppy/osu.git
synced 2026-05-27 02:50:00 +08:00
Apply suggested renames
This commit is contained in:
@@ -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<ManiaTouchInputArea>().SingleOrDefault();
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
+7
-7
@@ -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,
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
// 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.
|
||||
|
||||
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<bool>(ManiaRulesetSetting.TimingBasedNoteColouring),
|
||||
},
|
||||
new SettingsEnumDropdown<ManiaMobilePlayStyle>
|
||||
{
|
||||
LabelText = RulesetSettingsStrings.MobilePlayStyle,
|
||||
Current = config.GetBindable<ManiaMobilePlayStyle>(ManiaRulesetSetting.MobilePlayStyle),
|
||||
},
|
||||
};
|
||||
|
||||
if (RuntimeInfo.IsMobile)
|
||||
{
|
||||
Add(new SettingsEnumDropdown<ManiaMobileLayout>
|
||||
{
|
||||
LabelText = RulesetSettingsStrings.MobileLayout,
|
||||
Current = config.GetBindable<ManiaMobileLayout>(ManiaRulesetSetting.MobileLayout),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private partial class ManiaScrollSlider : RoundedSliderBar<double>
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace osu.Game.Rulesets.Mania.UI
|
||||
|
||||
public readonly Bindable<Color4> AccentColour = new Bindable<Color4>(Color4.Black);
|
||||
|
||||
private IBindable<ManiaMobilePlayStyle> mobilePlayStyle = null!;
|
||||
private IBindable<ManiaMobileLayout> mobilePlayStyle = null!;
|
||||
|
||||
public Column(int index, bool isSpecial)
|
||||
{
|
||||
@@ -120,7 +120,7 @@ namespace osu.Game.Rulesets.Mania.UI
|
||||
RegisterPool<HoldNoteBody, DrawableHoldNoteBody>(10, 50);
|
||||
|
||||
if (rulesetConfig != null)
|
||||
mobilePlayStyle = rulesetConfig.GetBindable<ManiaMobilePlayStyle>(ManiaRulesetSetting.MobilePlayStyle);
|
||||
mobilePlayStyle = rulesetConfig.GetBindable<ManiaMobileLayout>(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);
|
||||
|
||||
@@ -66,14 +66,14 @@ namespace osu.Game.Rulesets.Mania.UI
|
||||
[Resolved]
|
||||
private ISkinSource skin { get; set; } = null!;
|
||||
|
||||
private readonly Bindable<ManiaMobilePlayStyle> mobilePlayStyle = new Bindable<ManiaMobilePlayStyle>();
|
||||
private readonly Bindable<ManiaMobileLayout> mobileLayout = new Bindable<ManiaMobileLayout>();
|
||||
|
||||
[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<Stage>()?.Parent?.DrawSize;
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace osu.Game.Rulesets.Mania.UI
|
||||
|
||||
public IEnumerable<BarLine> BarLines;
|
||||
|
||||
private bool playsWithTouchableColumns => Config.Get<ManiaMobilePlayStyle>(ManiaRulesetSetting.MobilePlayStyle) == ManiaMobilePlayStyle.TouchableColumns;
|
||||
private bool playsWithTouchableColumns => Config.Get<ManiaMobileLayout>(ManiaRulesetSetting.MobileLayout) == ManiaMobileLayout.Portrait;
|
||||
|
||||
public override bool RequiresPortraitOrientation => Beatmap.Stages.Count == 1 && playsWithTouchableColumns;
|
||||
|
||||
|
||||
@@ -97,14 +97,14 @@ namespace osu.Game.Rulesets.Mania.UI
|
||||
};
|
||||
}
|
||||
|
||||
private IBindable<ManiaMobilePlayStyle> mobilePlayStyle = null!;
|
||||
private IBindable<ManiaMobileLayout> mobilePlayStyle = null!;
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
mobilePlayStyle = rulesetConfig.GetBindable<ManiaMobilePlayStyle>(ManiaRulesetSetting.MobilePlayStyle);
|
||||
mobilePlayStyle.BindValueChanged(p => touchControls.Value = p.NewValue == ManiaMobilePlayStyle.TouchControls, true);
|
||||
mobilePlayStyle = rulesetConfig.GetBindable<ManiaMobileLayout>(ManiaRulesetSetting.MobileLayout);
|
||||
mobilePlayStyle.BindValueChanged(p => touchControls.Value = p.NewValue == ManiaMobileLayout.LandscapeWithOverlay, true);
|
||||
|
||||
Opacity.BindValueChanged(o => Alpha = o.NewValue, true);
|
||||
}
|
||||
|
||||
@@ -90,24 +90,24 @@ namespace osu.Game.Localisation
|
||||
public static LocalisableString TouchControlScheme => new TranslatableString(getKey(@"touch_control_scheme"), @"Touch control scheme");
|
||||
|
||||
/// <summary>
|
||||
/// "Mobile play style"
|
||||
/// "Mobile layout"
|
||||
/// </summary>
|
||||
public static LocalisableString MobilePlayStyle => new TranslatableString(getKey(@"mobile_play_style"), @"Mobile play style");
|
||||
public static LocalisableString MobileLayout => new TranslatableString(getKey(@"mobile_layout"), @"Mobile layout");
|
||||
|
||||
/// <summary>
|
||||
/// "Touchable columns"
|
||||
/// "Portrait (expanded columns)"
|
||||
/// </summary>
|
||||
public static LocalisableString TouchableColumns => new TranslatableString(getKey(@"touchable_columns"), @"Touchable columns");
|
||||
public static LocalisableString PortraitExpandedColumns => new TranslatableString(getKey(@"portrait_expanded_columns"), @"Portrait (expanded columns)");
|
||||
|
||||
/// <summary>
|
||||
/// "Touch controls"
|
||||
/// "Landscape (expanded columns)"
|
||||
/// </summary>
|
||||
public static LocalisableString TouchControls => new TranslatableString(getKey(@"touch_controls"), @"Touch controls");
|
||||
public static LocalisableString LandscapeExpandedColumns => new TranslatableString(getKey(@"landscape_expanded_columns"), @"Landscape (expanded columns)");
|
||||
|
||||
/// <summary>
|
||||
/// "Extended columns"
|
||||
/// "Landscape (touch overlay)"
|
||||
/// </summary>
|
||||
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}";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user