Merge pull request #20012 from peppy/target-mod-toggle-metronome

Add setting to toggle metronome in "Target" mod
This commit is contained in:
Dan Balasescu 2022-08-29 18:47:43 +09:00 committed by GitHub
commit b25d1fbbae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -59,6 +59,9 @@ namespace osu.Game.Rulesets.Osu.Mods
Value = null
};
[SettingSource("Metronome ticks", "Whether a metronome beat should play in the background")]
public BindableBool Metronome { get; } = new BindableBool(true);
#region Constants
/// <summary>
@ -337,7 +340,8 @@ namespace osu.Game.Rulesets.Osu.Mods
public void ApplyToDrawableRuleset(DrawableRuleset<OsuHitObject> drawableRuleset)
{
drawableRuleset.Overlays.Add(new MetronomeBeat(drawableRuleset.Beatmap.HitObjects.First().StartTime));
if (Metronome.Value)
drawableRuleset.Overlays.Add(new MetronomeBeat(drawableRuleset.Beatmap.HitObjects.First().StartTime));
}
#endregion