mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 18:42:56 +08:00
Merge branch 'master' into ban-char-lower-upper
This commit is contained in:
commit
2d00658bf1
@ -44,6 +44,8 @@ namespace osu.Game.Graphics.UserInterface
|
||||
|
||||
public virtual LocalisableString TooltipText { get; private set; }
|
||||
|
||||
public bool PlaySamplesOnAdjust { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Whether to format the tooltip as a percentage or the actual value.
|
||||
/// </summary>
|
||||
@ -187,6 +189,9 @@ namespace osu.Game.Graphics.UserInterface
|
||||
|
||||
private void playSample(T value)
|
||||
{
|
||||
if (!PlaySamplesOnAdjust)
|
||||
return;
|
||||
|
||||
if (Clock == null || Clock.CurrentTime - lastSampleTime <= 30)
|
||||
return;
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user