From 29328bdf7f49a35f15e4bf87e9a2fd6151dd2567 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 31 Jul 2021 15:03:26 +0900 Subject: [PATCH] Use metronome's audio adjustments directly --- osu.Game/Rulesets/Mods/ModMuted.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/osu.Game/Rulesets/Mods/ModMuted.cs b/osu.Game/Rulesets/Mods/ModMuted.cs index 5454483571..9eb218fd9b 100644 --- a/osu.Game/Rulesets/Mods/ModMuted.cs +++ b/osu.Game/Rulesets/Mods/ModMuted.cs @@ -35,8 +35,6 @@ namespace osu.Game.Rulesets.Mods private BindableNumber currentCombo; - private AudioContainer metronomeContainer; - [SettingSource("Enable metronome", "Add a metronome beat to help you keep track of the rhythm.")] public BindableBool EnableMetronome { get; } = new BindableBool { @@ -76,12 +74,11 @@ namespace osu.Game.Rulesets.Mods { if (EnableMetronome.Value) { - drawableRuleset.Overlays.Add(metronomeContainer = new AudioContainer - { - Child = new Metronome(drawableRuleset.Beatmap.HitObjects.First().StartTime) - }); + Metronome metronome; - metronomeContainer.AddAdjustment(AdjustableProperty.Volume, metronomeVolumeAdjust); + drawableRuleset.Overlays.Add(metronome = new Metronome(drawableRuleset.Beatmap.HitObjects.First().StartTime)); + + metronome.AddAdjustment(AdjustableProperty.Volume, metronomeVolumeAdjust); } if (AffectsHitSounds.Value)