mirror of
https://github.com/ppy/osu.git
synced 2025-02-06 03:43:21 +08:00
Remove unnecessary UnbindAdjustments
call
It is not necessary given that `CurrentTrack` already removes all adjustments first.
This commit is contained in:
parent
36a7644164
commit
9446be2511
@ -393,21 +393,11 @@ namespace osu.Game.Overlays
|
|||||||
CurrentTrack.RemoveAllAdjustments(AdjustableProperty.Tempo);
|
CurrentTrack.RemoveAllAdjustments(AdjustableProperty.Tempo);
|
||||||
CurrentTrack.RemoveAllAdjustments(AdjustableProperty.Volume);
|
CurrentTrack.RemoveAllAdjustments(AdjustableProperty.Volume);
|
||||||
|
|
||||||
var applicableToTrack = mods.Value.OfType<IApplicableToTrack>();
|
if (allowTrackAdjustments)
|
||||||
|
|
||||||
if (!allowTrackAdjustments || !applicableToTrack.Any())
|
|
||||||
{
|
|
||||||
if (modTrackAdjustments != null)
|
|
||||||
{
|
|
||||||
CurrentTrack.UnbindAdjustments(modTrackAdjustments);
|
|
||||||
modTrackAdjustments = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
CurrentTrack.BindAdjustments(modTrackAdjustments = new AudioAdjustments());
|
CurrentTrack.BindAdjustments(modTrackAdjustments = new AudioAdjustments());
|
||||||
|
|
||||||
foreach (var mod in applicableToTrack)
|
foreach (var mod in mods.Value.OfType<IApplicableToTrack>())
|
||||||
mod.ApplyToTrack(modTrackAdjustments);
|
mod.ApplyToTrack(modTrackAdjustments);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user