From d75d67577a1668749ffcb08600ce1440fc503256 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 6 Jul 2021 17:37:34 +0900 Subject: [PATCH] Fix regressed tests --- .../Visual/Gameplay/TestSceneSkinnableDrawable.cs | 2 +- osu.Game/Skinning/BeatmapSkinProvidingContainer.cs | 6 +++--- osu.Game/Skinning/SkinProvidingContainer.cs | 14 +++++++------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/osu.Game.Tests/Visual/Gameplay/TestSceneSkinnableDrawable.cs b/osu.Game.Tests/Visual/Gameplay/TestSceneSkinnableDrawable.cs index 02b1959dab..3e8ba69e01 100644 --- a/osu.Game.Tests/Visual/Gameplay/TestSceneSkinnableDrawable.cs +++ b/osu.Game.Tests/Visual/Gameplay/TestSceneSkinnableDrawable.cs @@ -168,7 +168,7 @@ namespace osu.Game.Tests.Visual.Gameplay public void Disable() { allow = false; - OnSourceChanged(); + TriggerSourceChanged(); } public SwitchableSkinProvidingContainer(ISkin skin) diff --git a/osu.Game/Skinning/BeatmapSkinProvidingContainer.cs b/osu.Game/Skinning/BeatmapSkinProvidingContainer.cs index f12f44e347..57c08a903f 100644 --- a/osu.Game/Skinning/BeatmapSkinProvidingContainer.cs +++ b/osu.Game/Skinning/BeatmapSkinProvidingContainer.cs @@ -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()); } } } diff --git a/osu.Game/Skinning/SkinProvidingContainer.cs b/osu.Game/Skinning/SkinProvidingContainer.cs index 6033776979..d2f38b58a4 100644 --- a/osu.Game/Skinning/SkinProvidingContainer.cs +++ b/osu.Game/Skinning/SkinProvidingContainer.cs @@ -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; } /// @@ -86,7 +86,7 @@ namespace osu.Game.Skinning return; if (skin is ISkinSource source) - source.SourceChanged -= anySourceChanged; + source.SourceChanged -= TriggerSourceChanged; } /// @@ -199,16 +199,16 @@ namespace osu.Game.Skinning ParentSource = dependencies.Get(); if (ParentSource != null) - ParentSource.SourceChanged += anySourceChanged; + ParentSource.SourceChanged += TriggerSourceChanged; dependencies.CacheAs(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()) - source.SourceChanged -= anySourceChanged; + source.SourceChanged -= TriggerSourceChanged; } private class DisableableSkinSource : ISkin