mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09:00
Fix adjusting volume via settings playing tick samples twice
This commit is contained in:
@ -8,6 +8,7 @@ using osu.Framework.Audio;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Localisation;
|
||||
|
||||
namespace osu.Game.Overlays.Settings.Sections.Audio
|
||||
@ -21,7 +22,7 @@ namespace osu.Game.Overlays.Settings.Sections.Audio
|
||||
{
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new SettingsSlider<double>
|
||||
new VolumeAdjustSlider
|
||||
{
|
||||
LabelText = AudioSettingsStrings.MasterVolume,
|
||||
Current = audio.Volume,
|
||||
@ -35,14 +36,15 @@ namespace osu.Game.Overlays.Settings.Sections.Audio
|
||||
KeyboardStep = 0.01f,
|
||||
DisplayAsPercentage = true
|
||||
},
|
||||
new SettingsSlider<double>
|
||||
new VolumeAdjustSlider
|
||||
{
|
||||
LabelText = AudioSettingsStrings.EffectVolume,
|
||||
Current = audio.VolumeSample,
|
||||
KeyboardStep = 0.01f,
|
||||
DisplayAsPercentage = true
|
||||
},
|
||||
new SettingsSlider<double>
|
||||
|
||||
new VolumeAdjustSlider
|
||||
{
|
||||
LabelText = AudioSettingsStrings.MusicVolume,
|
||||
Current = audio.VolumeTrack,
|
||||
@ -51,5 +53,15 @@ namespace osu.Game.Overlays.Settings.Sections.Audio
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
private class VolumeAdjustSlider : SettingsSlider<double>
|
||||
{
|
||||
protected override Drawable CreateControl()
|
||||
{
|
||||
var sliderBar = (OsuSliderBar<double>)base.CreateControl();
|
||||
sliderBar.PlaySamplesOnAdjust = false;
|
||||
return sliderBar;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user