2021-10-12 13:26:57 +08:00
|
|
|
// 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.Allocation;
|
2021-11-28 09:58:08 +08:00
|
|
|
using osu.Framework.Bindables;
|
2021-10-12 13:26:57 +08:00
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Localisation;
|
|
|
|
using osu.Game.Configuration;
|
|
|
|
using osu.Game.Localisation;
|
2021-11-28 09:58:08 +08:00
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
2021-10-12 13:26:57 +08:00
|
|
|
namespace osu.Game.Overlays.Settings.Sections.Gameplay
|
|
|
|
{
|
|
|
|
public class AudioSettings : SettingsSubsection
|
|
|
|
{
|
|
|
|
protected override LocalisableString Header => GameplaySettingsStrings.AudioHeader;
|
|
|
|
|
2021-11-28 09:58:08 +08:00
|
|
|
private Bindable<float> positionalHitsoundsLevel;
|
|
|
|
|
|
|
|
private FillFlowContainer<SettingsSlider<float>> positionalHitsoundsSettings;
|
|
|
|
|
2021-10-12 13:26:57 +08:00
|
|
|
[BackgroundDependencyLoader]
|
2021-11-28 09:58:08 +08:00
|
|
|
private void load(OsuConfigManager config,OsuConfigManager osuConfig)
|
2021-10-12 13:26:57 +08:00
|
|
|
{
|
2021-11-28 09:58:08 +08:00
|
|
|
positionalHitsoundsLevel = osuConfig.GetBindable<float>(OsuSetting.PositionalHitsoundsLevel);
|
2021-10-12 13:26:57 +08:00
|
|
|
Children = new Drawable[]
|
|
|
|
{
|
|
|
|
new SettingsCheckbox
|
|
|
|
{
|
|
|
|
LabelText = GameplaySettingsStrings.PositionalHitsounds,
|
|
|
|
Current = config.GetBindable<bool>(OsuSetting.PositionalHitSounds)
|
|
|
|
},
|
2021-11-28 09:58:08 +08:00
|
|
|
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,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
},
|
2021-10-12 13:26:57 +08:00
|
|
|
new SettingsCheckbox
|
|
|
|
{
|
|
|
|
LabelText = GameplaySettingsStrings.AlwaysPlayFirstComboBreak,
|
|
|
|
Current = config.GetBindable<bool>(OsuSetting.AlwaysPlayFirstComboBreak)
|
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|