diff --git a/osu.Game.Tests/Skins/TestSceneSkinProvidingContainer.cs b/osu.Game.Tests/Skins/TestSceneSkinProvidingContainer.cs index 2247f685e2..ffb3d41d18 100644 --- a/osu.Game.Tests/Skins/TestSceneSkinProvidingContainer.cs +++ b/osu.Game.Tests/Skins/TestSceneSkinProvidingContainer.cs @@ -64,7 +64,7 @@ public TestSkinProvidingContainer(IEnumerable sources) public new void TriggerSourceChanged() => base.TriggerSourceChanged(); - protected override void OnSourceChanged() + protected override void RefreshSources() { SetSources(sources); } diff --git a/osu.Game/Skinning/RulesetSkinProvidingContainer.cs b/osu.Game/Skinning/RulesetSkinProvidingContainer.cs index e63af0dfbd..b884794739 100644 --- a/osu.Game/Skinning/RulesetSkinProvidingContainer.cs +++ b/osu.Game/Skinning/RulesetSkinProvidingContainer.cs @@ -58,7 +58,7 @@ protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnl return base.CreateChildDependencies(parent); } - protected override void OnSourceChanged() + protected override void RefreshSources() { // Populate a local list first so we can adjust the returned order as we go. var sources = new List(); diff --git a/osu.Game/Skinning/SkinProvidingContainer.cs b/osu.Game/Skinning/SkinProvidingContainer.cs index fd80992000..c8e4c2c7b6 100644 --- a/osu.Game/Skinning/SkinProvidingContainer.cs +++ b/osu.Game/Skinning/SkinProvidingContainer.cs @@ -173,6 +173,9 @@ public IBindable GetConfig(TLookup lookup) /// /// Replace the sources used for lookups in this container. /// + /// + /// This does not implicitly fire a event. Consider calling if required. + /// /// The new sources. protected void SetSources(IEnumerable sources) { @@ -195,15 +198,15 @@ protected void SetSources(IEnumerable sources) } /// - /// Invoked when any source has changed (either or sources replaced via ). + /// Invoked after any consumed source change, before the external event is fired. /// This is also invoked once initially during to ensure sources are ready for children consumption. /// - protected virtual void OnSourceChanged() { } + protected virtual void RefreshSources() { } protected void TriggerSourceChanged() { // Expose to implementations, giving them a chance to react before notifying external consumers. - OnSourceChanged(); + RefreshSources(); SourceChanged?.Invoke(); }