1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 10:22:56 +08:00

Drank some coffee and figured out the fix

This commit is contained in:
Terochi 2023-03-15 10:49:59 +01:00
parent b0f1a69523
commit edc6314634
5 changed files with 13 additions and 22 deletions

View File

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

View File

@ -316,11 +316,6 @@ 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

@ -132,6 +132,8 @@ namespace osu.Game.Skinning
if (Sample == null)
return;
FlushPendingSkinChanges();
activeChannel = Sample.GetChannel();
activeChannel.Looping = Looping;
activeChannel.Play();

View File

@ -27,6 +27,15 @@ namespace osu.Game.Skinning
/// </summary>
protected ISkinSource CurrentSkin { get; private set; } = null!;
protected void FlushPendingSkinChanges()
{
if (pendingSkinChange == null)
return;
pendingSkinChange.RunTask();
pendingSkinChange = null;
}
[BackgroundDependencyLoader]
private void load(ISkinSource source)
{
@ -42,15 +51,6 @@ namespace osu.Game.Skinning
pendingSkinChange = Scheduler.Add(skinChanged);
}
public virtual void FlushPendingSkinChanges()
{
if (pendingSkinChange == null)
return;
pendingSkinChange.RunTask();
pendingSkinChange = null;
}
protected override void LoadAsyncComplete()
{
base.LoadAsyncComplete();
@ -61,6 +61,8 @@ namespace osu.Game.Skinning
{
SkinChanged(CurrentSkin);
OnSkinChanged?.Invoke();
pendingSkinChange = null;
}
/// <summary>

View File

@ -110,13 +110,6 @@ namespace osu.Game.Skinning
}
}
public override void FlushPendingSkinChanges()
{
base.FlushPendingSkinChanges();
samplesContainer.ForEach(c => c.FlushPendingSkinChanges());
}
/// <summary>
/// Plays the samples.
/// </summary>