Initial implementation of adjustable positional hitobject audio strength

This commit is contained in:
mk-56
2021-11-28 02:58:08 +01:00
parent a0cc7bbdc8
commit eaa464e548
4 changed files with 37 additions and 2 deletions

View File

@ -2,10 +2,13 @@
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Localisation;
using osu.Game.Configuration;
using osu.Game.Localisation;
using osu.Framework.Graphics.Containers;
namespace osu.Game.Overlays.Settings.Sections.Gameplay
{
@ -13,9 +16,15 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
{
protected override LocalisableString Header => GameplaySettingsStrings.AudioHeader;
private Bindable<float> positionalHitsoundsLevel;
private FillFlowContainer<SettingsSlider<float>> positionalHitsoundsSettings;
[BackgroundDependencyLoader]
private void load(OsuConfigManager config)
private void load(OsuConfigManager config,OsuConfigManager osuConfig)
{
positionalHitsoundsLevel = osuConfig.GetBindable<float>(OsuSetting.PositionalHitsoundsLevel);
Children = new Drawable[]
{
new SettingsCheckbox
@ -23,6 +32,23 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
LabelText = GameplaySettingsStrings.PositionalHitsounds,
Current = config.GetBindable<bool>(OsuSetting.PositionalHitSounds)
},
positionalHitsoundsSettings = new FillFlowContainer<SettingsSlider<float>>
{
Direction = FillDirection.Vertical,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Masking = true,
Children = new[]
{
new SettingsSlider<float>
{
LabelText = AudioSettingsStrings.PositionalLevel,
Current = positionalHitsoundsLevel,
KeyboardStep = 0.01f,
DisplayAsPercentage = true,
},
}
},
new SettingsCheckbox
{
LabelText = GameplaySettingsStrings.AlwaysPlayFirstComboBreak,