mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 11:37:28 +08:00
Fix regressed tests
This commit is contained in:
parent
cd4885e450
commit
d75d67577a
@ -168,7 +168,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
public void Disable()
|
||||
{
|
||||
allow = false;
|
||||
OnSourceChanged();
|
||||
TriggerSourceChanged();
|
||||
}
|
||||
|
||||
public SwitchableSkinProvidingContainer(ISkin skin)
|
||||
|
@ -83,9 +83,9 @@ namespace osu.Game.Skinning
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
beatmapSkins.BindValueChanged(_ => OnSourceChanged());
|
||||
beatmapColours.BindValueChanged(_ => OnSourceChanged());
|
||||
beatmapHitsounds.BindValueChanged(_ => OnSourceChanged());
|
||||
beatmapSkins.BindValueChanged(_ => TriggerSourceChanged());
|
||||
beatmapColours.BindValueChanged(_ => TriggerSourceChanged());
|
||||
beatmapHitsounds.BindValueChanged(_ => TriggerSourceChanged());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ namespace osu.Game.Skinning
|
||||
skinSources.Add(skin, new DisableableSkinSource(skin, this));
|
||||
|
||||
if (skin is ISkinSource source)
|
||||
source.SourceChanged += anySourceChanged;
|
||||
source.SourceChanged += TriggerSourceChanged;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -86,7 +86,7 @@ namespace osu.Game.Skinning
|
||||
return;
|
||||
|
||||
if (skin is ISkinSource source)
|
||||
source.SourceChanged -= anySourceChanged;
|
||||
source.SourceChanged -= TriggerSourceChanged;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -199,16 +199,16 @@ namespace osu.Game.Skinning
|
||||
|
||||
ParentSource = dependencies.Get<ISkinSource>();
|
||||
if (ParentSource != null)
|
||||
ParentSource.SourceChanged += anySourceChanged;
|
||||
ParentSource.SourceChanged += TriggerSourceChanged;
|
||||
|
||||
dependencies.CacheAs<ISkinSource>(this);
|
||||
|
||||
anySourceChanged();
|
||||
TriggerSourceChanged();
|
||||
|
||||
return dependencies;
|
||||
}
|
||||
|
||||
private void anySourceChanged()
|
||||
protected void TriggerSourceChanged()
|
||||
{
|
||||
// Expose to implementations, giving them a chance to react before notifying external consumers.
|
||||
OnSourceChanged();
|
||||
@ -224,10 +224,10 @@ namespace osu.Game.Skinning
|
||||
base.Dispose(isDisposing);
|
||||
|
||||
if (ParentSource != null)
|
||||
ParentSource.SourceChanged -= anySourceChanged;
|
||||
ParentSource.SourceChanged -= TriggerSourceChanged;
|
||||
|
||||
foreach (var source in skinSources.Keys.OfType<ISkinSource>())
|
||||
source.SourceChanged -= anySourceChanged;
|
||||
source.SourceChanged -= TriggerSourceChanged;
|
||||
}
|
||||
|
||||
private class DisableableSkinSource : ISkin
|
||||
|
Loading…
Reference in New Issue
Block a user