1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 16:07:25 +08:00

Merge pull request #1407 from swoolcock/config-slider-keyboardstep

Add KeyboardStep values for configuration options
This commit is contained in:
Dan Balasescu 2017-10-24 10:31:35 +09:00 committed by GitHub
commit 74d83cba5a
8 changed files with 32 additions and 12 deletions

View File

@ -20,7 +20,8 @@ namespace osu.Game.Overlays.Settings.Sections.Audio
new SettingsSlider<double, OffsetSlider>
{
LabelText = "Audio Offset",
Bindable = config.GetBindable<double>(OsuSetting.AudioOffset)
Bindable = config.GetBindable<double>(OsuSetting.AudioOffset),
KeyboardStep = 100f
},
new OsuButton
{

View File

@ -16,9 +16,9 @@ namespace osu.Game.Overlays.Settings.Sections.Audio
{
Children = new Drawable[]
{
new SettingsSlider<double> { LabelText = "Master", Bindable = audio.Volume },
new SettingsSlider<double> { LabelText = "Effect", Bindable = audio.VolumeSample },
new SettingsSlider<double> { LabelText = "Music", Bindable = audio.VolumeTrack },
new SettingsSlider<double> { LabelText = "Master", Bindable = audio.Volume, KeyboardStep = 0.1f },
new SettingsSlider<double> { LabelText = "Effect", Bindable = audio.VolumeSample, KeyboardStep = 0.1f },
new SettingsSlider<double> { LabelText = "Music", Bindable = audio.VolumeTrack, KeyboardStep = 0.1f },
};
}
}

View File

@ -19,7 +19,8 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
new SettingsSlider<double>
{
LabelText = "Background dim",
Bindable = config.GetBindable<double>(OsuSetting.DimLevel)
Bindable = config.GetBindable<double>(OsuSetting.DimLevel),
KeyboardStep = 0.1f
},
new SettingsCheckbox
{

View File

@ -20,12 +20,14 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
new SettingsSlider<double, StarSlider>
{
LabelText = "Display beatmaps from",
Bindable = config.GetBindable<double>(OsuSetting.DisplayStarsMinimum)
Bindable = config.GetBindable<double>(OsuSetting.DisplayStarsMinimum),
KeyboardStep = 1f
},
new SettingsSlider<double, StarSlider>
{
LabelText = "up to",
Bindable = config.GetBindable<double>(OsuSetting.DisplayStarsMaximum)
Bindable = config.GetBindable<double>(OsuSetting.DisplayStarsMaximum),
KeyboardStep = 1f
},
new SettingsEnumDropdown<SelectionRandomType>
{

View File

@ -49,12 +49,14 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
new SettingsSlider<double>
{
LabelText = "Horizontal position",
Bindable = config.GetBindable<double>(FrameworkSetting.LetterboxPositionX)
Bindable = config.GetBindable<double>(FrameworkSetting.LetterboxPositionX),
KeyboardStep = 0.1f
},
new SettingsSlider<double>
{
LabelText = "Vertical position",
Bindable = config.GetBindable<double>(FrameworkSetting.LetterboxPositionY)
Bindable = config.GetBindable<double>(FrameworkSetting.LetterboxPositionY),
KeyboardStep = 0.1f
},
}
},

View File

@ -24,12 +24,14 @@ namespace osu.Game.Overlays.Settings.Sections
new SettingsSlider<double, SizeSlider>
{
LabelText = "Menu cursor size",
Bindable = config.GetBindable<double>(OsuSetting.MenuCursorSize)
Bindable = config.GetBindable<double>(OsuSetting.MenuCursorSize),
KeyboardStep = 0.1f
},
new SettingsSlider<double, SizeSlider>
{
LabelText = "Gameplay cursor size",
Bindable = config.GetBindable<double>(OsuSetting.GameplayCursorSize)
Bindable = config.GetBindable<double>(OsuSetting.GameplayCursorSize),
KeyboardStep = 0.1f
},
new SettingsCheckbox
{

View File

@ -2,6 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Graphics.UserInterface;
@ -22,5 +23,15 @@ namespace osu.Game.Overlays.Settings
Margin = new MarginPadding { Top = 5, Bottom = 5 },
RelativeSizeAxes = Axes.X
};
public float KeyboardStep;
[BackgroundDependencyLoader]
private void load()
{
var slider = Control as U;
if (slider != null)
slider.KeyboardStep = KeyboardStep;
}
}
}

View File

@ -19,7 +19,8 @@ namespace osu.Game.Screens.Play.ReplaySettings
new ReplaySliderBar<double>
{
LabelText = "Playback speed",
Bindable = config.GetBindable<double>(OsuSetting.PlaybackSpeed)
Bindable = config.GetBindable<double>(OsuSetting.PlaybackSpeed),
KeyboardStep = 0.5f
}
};
}