Improve adjusting mods settings values with keyboard (#36090)

- closes https://github.com/ppy/osu/issues/36016

Co-authored-by: Dean Herbert <pe@ppy.sh>
This commit is contained in:
Denis Titovets
2026-02-09 05:35:01 +03:00
committed by GitHub
parent 01982030ec
commit 60d98f0afd
5 changed files with 32 additions and 5 deletions

View File

@@ -39,7 +39,7 @@ namespace osu.Game.Rulesets.Osu.Mods
[SettingSource(
"Max size at combo",
"The combo count at which the cursor reaches its maximum size",
SettingControlType = typeof(SettingsSlider<int, RoundedSliderBar<int>>)
SettingControlType = typeof(SettingsSlider<int, MaxSizeComboSlider>)
)]
public BindableInt MaxSizeComboCount { get; } = new BindableInt(50)
{
@@ -85,4 +85,12 @@ namespace osu.Game.Rulesets.Osu.Mods
cursor.ModScaleAdjust.Value = (float)Interpolation.Lerp(cursor.ModScaleAdjust.Value, currentSize, Math.Clamp(cursor.Time.Elapsed / TRANSITION_DURATION, 0, 1));
}
}
public partial class MaxSizeComboSlider : RoundedSliderBar<int>
{
public MaxSizeComboSlider()
{
KeyboardStep = 1;
}
}
}

View File

@@ -140,7 +140,7 @@ namespace osu.Game.Configuration
LabelText = attr.Label,
TooltipText = attr.Description,
Current = bNumber,
KeyboardStep = 0.1f,
KeyboardStep = bNumber.Precision,
};
break;
@@ -151,7 +151,7 @@ namespace osu.Game.Configuration
LabelText = attr.Label,
TooltipText = attr.Description,
Current = bNumber,
KeyboardStep = 0.1f,
KeyboardStep = (float)bNumber.Precision,
};
break;
@@ -161,7 +161,8 @@ namespace osu.Game.Configuration
{
LabelText = attr.Label,
TooltipText = attr.Description,
Current = bNumber
Current = bNumber,
KeyboardStep = bNumber.Precision,
};
break;

View File

@@ -53,7 +53,7 @@ namespace osu.Game.Rulesets.Mods
}
}
[SettingSource("Minimum accuracy", "Trigger a failure if your accuracy goes below this value.", SettingControlType = typeof(SettingsPercentageSlider<double>))]
[SettingSource("Minimum accuracy", "Trigger a failure if your accuracy goes below this value.", SettingControlType = typeof(MinimumAccuracySlider))]
public BindableNumber<double> MinimumAccuracy { get; } = new BindableDouble
{
MinValue = 0.60,
@@ -103,4 +103,12 @@ namespace osu.Game.Rulesets.Mods
Standard,
}
}
public partial class MinimumAccuracySlider : SettingsPercentageSlider<double>
{
public MinimumAccuracySlider()
{
KeyboardStep = 0.01f;
}
}
}

View File

@@ -108,6 +108,11 @@ namespace osu.Game.Rulesets.Mods
public partial class MuteComboSlider : RoundedSliderBar<int>
{
public MuteComboSlider()
{
KeyboardStep = 1;
}
public override LocalisableString TooltipText => FormatMuteComboValue(Current.Value);
public static LocalisableString FormatMuteComboValue(int value)

View File

@@ -74,6 +74,11 @@ namespace osu.Game.Rulesets.Mods
public partial class HiddenComboSlider : RoundedSliderBar<int>
{
public HiddenComboSlider()
{
KeyboardStep = 1;
}
public override LocalisableString TooltipText => FormatHiddenComboValue(Current.Value);
public static LocalisableString FormatHiddenComboValue(int value)