1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 14:32:55 +08:00

Merge pull request #9645 from peppy/fix-skinnable-sound-contianuance

Fix SkinnableSounds not continuing playback on skin change
This commit is contained in:
Dan Balasescu 2020-07-22 21:38:21 +09:00 committed by GitHub
commit 860f10ceee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -98,6 +98,8 @@ namespace osu.Game.Skinning
protected override void SkinChanged(ISkinSource skin, bool allowFallback) protected override void SkinChanged(ISkinSource skin, bool allowFallback)
{ {
bool wasPlaying = samplesContainer.Any(s => s.Playing);
var channels = hitSamples.Select(s => var channels = hitSamples.Select(s =>
{ {
var ch = skin.GetSample(s); var ch = skin.GetSample(s);
@ -121,6 +123,9 @@ namespace osu.Game.Skinning
}).Where(c => c != null); }).Where(c => c != null);
samplesContainer.ChildrenEnumerable = channels.Select(c => new DrawableSample(c)); samplesContainer.ChildrenEnumerable = channels.Select(c => new DrawableSample(c));
if (wasPlaying)
Play();
} }
} }
} }