1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 14:17:26 +08:00

Use double instead of float for UIHoldActivationDelay configuration value

All times use double, so let's also use double here.
This commit is contained in:
Dean Herbert 2022-03-04 12:21:05 +09:00
parent abba49fd8f
commit 7854a0a913
5 changed files with 11 additions and 11 deletions

View File

@ -140,7 +140,7 @@ namespace osu.Game.Configuration
SetDefault(OsuSetting.UIScale, 1f, 0.8f, 1.6f, 0.01f); SetDefault(OsuSetting.UIScale, 1f, 0.8f, 1.6f, 0.01f);
SetDefault(OsuSetting.UIHoldActivationDelay, 200f, 0f, 500f, 50f); SetDefault(OsuSetting.UIHoldActivationDelay, 200.0, 0.0, 500.0, 50.0);
SetDefault(OsuSetting.IntroSequence, IntroSequence.Triangles); SetDefault(OsuSetting.IntroSequence, IntroSequence.Triangles);

View File

@ -30,12 +30,12 @@ namespace osu.Game.Graphics.Containers
public Bindable<double> Progress = new BindableDouble(); public Bindable<double> Progress = new BindableDouble();
private Bindable<float> holdActivationDelay; private Bindable<double> holdActivationDelay;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuConfigManager config) private void load(OsuConfigManager config)
{ {
holdActivationDelay = config.GetBindable<float>(OsuSetting.UIHoldActivationDelay); holdActivationDelay = config.GetBindable<double>(OsuSetting.UIHoldActivationDelay);
} }
protected void BeginConfirm() protected void BeginConfirm()

View File

@ -35,18 +35,18 @@ namespace osu.Game.Overlays.Settings.Sections.UserInterface
LabelText = UserInterfaceStrings.Parallax, LabelText = UserInterfaceStrings.Parallax,
Current = config.GetBindable<bool>(OsuSetting.MenuParallax) Current = config.GetBindable<bool>(OsuSetting.MenuParallax)
}, },
new SettingsSlider<float, TimeSlider> new SettingsSlider<double, TimeSlider>
{ {
LabelText = UserInterfaceStrings.HoldToConfirmActivationTime, LabelText = UserInterfaceStrings.HoldToConfirmActivationTime,
Current = config.GetBindable<float>(OsuSetting.UIHoldActivationDelay), Current = config.GetBindable<double>(OsuSetting.UIHoldActivationDelay),
KeyboardStep = 50 KeyboardStep = 50
}, },
}; };
} }
private class TimeSlider : OsuSliderBar<float> private class TimeSlider : OsuSliderBar<double>
{ {
protected override LocalisableString GetTooltipText(float value) => $"{value:N0} ms"; protected override LocalisableString GetTooltipText(double value) => $"{value:N0} ms";
} }
} }
} }

View File

@ -66,7 +66,7 @@ namespace osu.Game.Screens.Menu
protected override BackgroundScreen CreateBackground() => background; protected override BackgroundScreen CreateBackground() => background;
private Bindable<float> holdDelay; private Bindable<double> holdDelay;
private Bindable<bool> loginDisplayed; private Bindable<bool> loginDisplayed;
private ExitConfirmOverlay exitConfirmOverlay; private ExitConfirmOverlay exitConfirmOverlay;
@ -77,7 +77,7 @@ namespace osu.Game.Screens.Menu
[BackgroundDependencyLoader(true)] [BackgroundDependencyLoader(true)]
private void load(BeatmapListingOverlay beatmapListing, SettingsOverlay settings, OsuConfigManager config, SessionStatics statics) private void load(BeatmapListingOverlay beatmapListing, SettingsOverlay settings, OsuConfigManager config, SessionStatics statics)
{ {
holdDelay = config.GetBindable<float>(OsuSetting.UIHoldActivationDelay); holdDelay = config.GetBindable<double>(OsuSetting.UIHoldActivationDelay);
loginDisplayed = statics.GetBindable<bool>(Static.LoginOverlayDisplayed); loginDisplayed = statics.GetBindable<bool>(Static.LoginOverlayDisplayed);
if (host.CanExit) if (host.CanExit)

View File

@ -63,11 +63,11 @@ namespace osu.Game.Screens.Play.HUD
[Resolved] [Resolved]
private OsuConfigManager config { get; set; } private OsuConfigManager config { get; set; }
private Bindable<float> activationDelay; private Bindable<double> activationDelay;
protected override void LoadComplete() protected override void LoadComplete()
{ {
activationDelay = config.GetBindable<float>(OsuSetting.UIHoldActivationDelay); activationDelay = config.GetBindable<double>(OsuSetting.UIHoldActivationDelay);
activationDelay.BindValueChanged(v => activationDelay.BindValueChanged(v =>
{ {
text.Text = v.NewValue > 0 text.Text = v.NewValue > 0