mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 13:42:56 +08:00
Drank some coffee and figured out the fix
This commit is contained in:
parent
b0f1a69523
commit
edc6314634
@ -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]
|
||||
|
@ -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;
|
||||
|
@ -132,6 +132,8 @@ namespace osu.Game.Skinning
|
||||
if (Sample == null)
|
||||
return;
|
||||
|
||||
FlushPendingSkinChanges();
|
||||
|
||||
activeChannel = Sample.GetChannel();
|
||||
activeChannel.Looping = Looping;
|
||||
activeChannel.Play();
|
||||
|
@ -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>
|
||||
|
@ -110,13 +110,6 @@ namespace osu.Game.Skinning
|
||||
}
|
||||
}
|
||||
|
||||
public override void FlushPendingSkinChanges()
|
||||
{
|
||||
base.FlushPendingSkinChanges();
|
||||
|
||||
samplesContainer.ForEach(c => c.FlushPendingSkinChanges());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Plays the samples.
|
||||
/// </summary>
|
||||
|
Loading…
Reference in New Issue
Block a user