Don't play metronome click when tapping for timing

This commit is contained in:
Dean Herbert 2022-06-01 20:48:06 +09:00
parent d47a3bb8e4
commit 96ccd29bdc
3 changed files with 20 additions and 1 deletions

View File

@ -38,6 +38,8 @@ namespace osu.Game.Screens.Edit.Timing
[Resolved] [Resolved]
private OverlayColourProvider overlayColourProvider { get; set; } private OverlayColourProvider overlayColourProvider { get; set; }
public bool EnableClicking { get; set; } = true;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(AudioManager audio) private void load(AudioManager audio)
{ {
@ -281,6 +283,9 @@ namespace osu.Game.Screens.Edit.Timing
Schedule(() => Schedule(() =>
{ {
if (!EnableClicking)
return;
var channel = clunk?.GetChannel(); var channel = clunk?.GetChannel();
if (channel != null) if (channel != null)

View File

@ -30,6 +30,8 @@ namespace osu.Game.Screens.Edit.Timing
{ {
public const float SIZE = 100; public const float SIZE = 100;
public readonly BindableBool IsHandlingTapping = new BindableBool();
[Resolved] [Resolved]
private OverlayColourProvider colourProvider { get; set; } = null!; private OverlayColourProvider colourProvider { get; set; } = null!;
@ -213,6 +215,7 @@ namespace osu.Game.Screens.Edit.Timing
const double in_duration = 100; const double in_duration = 100;
grabbedMouseDown = true; grabbedMouseDown = true;
IsHandlingTapping.Value = true;
handleTap(); handleTap();
@ -269,6 +272,7 @@ namespace osu.Game.Screens.Edit.Timing
light.Hide(); light.Hide();
tapTimings.Clear(); tapTimings.Clear();
IsHandlingTapping.Value = false;
} }
private void handleTap() private void handleTap()

View File

@ -25,6 +25,10 @@ namespace osu.Game.Screens.Edit.Timing
[Resolved] [Resolved]
private Bindable<ControlPointGroup> selectedGroup { get; set; } private Bindable<ControlPointGroup> selectedGroup { get; set; }
private readonly BindableBool isHandlingTapping = new BindableBool();
private MetronomeDisplay metronome;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OverlayColourProvider colourProvider, OsuColour colours) private void load(OverlayColourProvider colourProvider, OsuColour colours)
{ {
@ -73,7 +77,7 @@ namespace osu.Game.Screens.Edit.Timing
{ {
new Drawable[] new Drawable[]
{ {
new MetronomeDisplay metronome = new MetronomeDisplay
{ {
Anchor = Anchor.CentreLeft, Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft, Origin = Anchor.CentreLeft,
@ -149,11 +153,17 @@ namespace osu.Game.Screens.Edit.Timing
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
IsHandlingTapping = { BindTarget = isHandlingTapping }
} }
} }
} }
}, },
}; };
isHandlingTapping.BindValueChanged(handling =>
{
metronome.EnableClicking = !handling.NewValue;
}, true);
} }
private void adjustOffset(double adjust) private void adjustOffset(double adjust)