mirror of
https://github.com/ppy/osu
synced 2025-01-21 13:23:13 +00:00
fixed bug preventing the pause loop from playing during the first pause after changing a skin
This commit is contained in:
parent
7d2d6a52c9
commit
a4bb238c45
@ -3,13 +3,8 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Humanizer;
|
|
||||||
using NUnit.Framework.Internal;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Audio;
|
|
||||||
using osu.Framework.Audio.Sample;
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Audio;
|
|
||||||
using osu.Game.Audio;
|
using osu.Game.Audio;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Skinning;
|
using osu.Game.Skinning;
|
||||||
@ -39,7 +34,9 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
Looping = true,
|
Looping = true,
|
||||||
});
|
});
|
||||||
|
// PopIn is called before updating the skin, and when a sample is updated, its "playing" value is reset
|
||||||
|
// the sample must be played again(and if it plays when it shouldn't, the volume will be at 0)
|
||||||
|
pauseLoop.OnSkinChanged += () => pauseLoop.Play();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void PopIn()
|
protected override void PopIn()
|
||||||
@ -55,9 +52,9 @@ namespace osu.Game.Screens.Play
|
|||||||
protected override void PopOut()
|
protected override void PopOut()
|
||||||
{
|
{
|
||||||
base.PopOut();
|
base.PopOut();
|
||||||
pauseLoop?.Stop();
|
|
||||||
|
pauseLoop?.Stop();
|
||||||
pauseLoop?.TransformBindableTo(pauseLoop.Volume, 0.0f);
|
pauseLoop?.TransformBindableTo(pauseLoop.Volume, 0.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user