From c62cbb0821cb1e53b83884cdfd3c6cb01ad612ca Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 30 Sep 2024 17:54:56 +0900 Subject: [PATCH] Change `SkinProvidingContainer` to also return parent sources in `AllSources` --- osu.Game.Rulesets.Osu.Tests/TestSceneSkinFallbacks.cs | 2 +- osu.Game/Skinning/SkinProvidingContainer.cs | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneSkinFallbacks.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneSkinFallbacks.cs index 9d79cb0db4de..dee52bdd7e69 100644 --- a/osu.Game.Rulesets.Osu.Tests/TestSceneSkinFallbacks.cs +++ b/osu.Game.Rulesets.Osu.Tests/TestSceneSkinFallbacks.cs @@ -172,7 +172,7 @@ public Drawable GetDrawableComponent(ISkinComponentLookup lookup) public ISkin FindProvider(Func lookupFunction) => lookupFunction(this) ? this : null; - public IEnumerable AllSources => new[] { this }; + public IEnumerable AllSources => Array.Empty(); [CanBeNull] public event Action SourceChanged; diff --git a/osu.Game/Skinning/SkinProvidingContainer.cs b/osu.Game/Skinning/SkinProvidingContainer.cs index 9b21d229ce02..96d70621dc6d 100644 --- a/osu.Game/Skinning/SkinProvidingContainer.cs +++ b/osu.Game/Skinning/SkinProvidingContainer.cs @@ -99,10 +99,7 @@ public IEnumerable AllSources yield return i.skin; if (ParentSource != null) - { - foreach (var skin in ParentSource.AllSources) - yield return skin; - } + yield return ParentSource; } }