1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-07 20:07:24 +08:00

Update the pauseLoop sample instantly on skin change

This commit is contained in:
Terochi 2023-03-15 09:05:34 +01:00
parent a9c349fa6d
commit b0f1a69523
4 changed files with 14 additions and 3 deletions

View File

@ -28,6 +28,7 @@ namespace osu.Game.Screens.Play
private SkinnableSound pauseLoop;
public void FlushPendingSkinChanges() => pauseLoop.FlushPendingSkinChanges();
protected override Action BackAction => () => InternalButtons.First().TriggerClick();
[BackgroundDependencyLoader]

View File

@ -316,6 +316,11 @@ namespace osu.Game.Screens.Play
// we may want to limit this in the future to disallow rulesets from outright replacing elements the user expects to be there.
failAnimationLayer.Add(createOverlayComponents(Beatmap.Value));
rulesetSkinProvider.SourceChanged += () =>
{
PauseOverlay.FlushPendingSkinChanges();
};
if (!DrawableRuleset.AllowGameplayOverlays)
{
HUDOverlay.ShowHud.Value = false;

View File

@ -42,7 +42,7 @@ namespace osu.Game.Skinning
pendingSkinChange = Scheduler.Add(skinChanged);
}
public void FlushPendingSkinChanges()
public virtual void FlushPendingSkinChanges()
{
if (pendingSkinChange == null)
return;

View File

@ -110,6 +110,13 @@ namespace osu.Game.Skinning
}
}
public override void FlushPendingSkinChanges()
{
base.FlushPendingSkinChanges();
samplesContainer.ForEach(c => c.FlushPendingSkinChanges());
}
/// <summary>
/// Plays the samples.
/// </summary>
@ -119,8 +126,6 @@ namespace osu.Game.Skinning
samplesContainer.ForEach(c =>
{
c.FlushPendingSkinChanges();
if (PlayWhenZeroVolume || c.AggregateVolume.Value > 0)
{
c.Stop();