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:
parent
a9c349fa6d
commit
b0f1a69523
@ -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]
|
||||
|
@ -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;
|
||||
|
@ -42,7 +42,7 @@ namespace osu.Game.Skinning
|
||||
pendingSkinChange = Scheduler.Add(skinChanged);
|
||||
}
|
||||
|
||||
public void FlushPendingSkinChanges()
|
||||
public virtual void FlushPendingSkinChanges()
|
||||
{
|
||||
if (pendingSkinChange == null)
|
||||
return;
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user