From d1d195cf18f872b8a57f696d58c12aae1ed31fcd Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 17 Aug 2024 02:30:59 +0900 Subject: [PATCH] Fix incorrect skin lookup shortcutting causing sprites to no longer work --- osu.Game/Skinning/ArgonSkin.cs | 8 ++++---- osu.Game/Skinning/LegacySkin.cs | 8 ++++---- osu.Game/Skinning/TrianglesSkin.cs | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/osu.Game/Skinning/ArgonSkin.cs b/osu.Game/Skinning/ArgonSkin.cs index 85abb1edcd4c..c66df82e0d28 100644 --- a/osu.Game/Skinning/ArgonSkin.cs +++ b/osu.Game/Skinning/ArgonSkin.cs @@ -94,13 +94,13 @@ public ArgonSkin(SkinInfo skin, IStorageResourceProvider resources) // Temporary until default skin has a valid hit lighting. if ((lookup as SkinnableSprite.SpriteComponentLookup)?.LookupName == @"lighting") return Drawable.Empty(); - if (base.GetDrawableComponent(lookup) is UserConfiguredLayoutContainer c) - return c; - switch (lookup) { case SkinComponentsContainerLookup containerLookup: + if (base.GetDrawableComponent(lookup) is UserConfiguredLayoutContainer c) + return c; + switch (containerLookup.Target) { case SkinComponentsContainerLookup.TargetArea.SongSelect: @@ -257,7 +257,7 @@ public ArgonSkin(SkinInfo skin, IStorageResourceProvider resources) return null; } - return null; + return base.GetDrawableComponent(lookup); } public override IBindable? GetConfig(TLookup lookup) diff --git a/osu.Game/Skinning/LegacySkin.cs b/osu.Game/Skinning/LegacySkin.cs index 8f6e634dd6c7..bbca0178d514 100644 --- a/osu.Game/Skinning/LegacySkin.cs +++ b/osu.Game/Skinning/LegacySkin.cs @@ -356,12 +356,12 @@ protected override void ParseConfigurationStream(Stream stream) public override Drawable? GetDrawableComponent(ISkinComponentLookup lookup) { - if (base.GetDrawableComponent(lookup) is UserConfiguredLayoutContainer c) - return c; - switch (lookup) { case SkinComponentsContainerLookup containerLookup: + if (base.GetDrawableComponent(lookup) is UserConfiguredLayoutContainer c) + return c; + switch (containerLookup.Target) { case SkinComponentsContainerLookup.TargetArea.MainHUDComponents: @@ -445,7 +445,7 @@ protected override void ParseConfigurationStream(Stream stream) return null; } - return null; + return base.GetDrawableComponent(lookup); } private Texture? getParticleTexture(HitResult result) diff --git a/osu.Game/Skinning/TrianglesSkin.cs b/osu.Game/Skinning/TrianglesSkin.cs index 29abb1949fcf..7971aee794b3 100644 --- a/osu.Game/Skinning/TrianglesSkin.cs +++ b/osu.Game/Skinning/TrianglesSkin.cs @@ -64,12 +64,12 @@ public TrianglesSkin(SkinInfo skin, IStorageResourceProvider resources) // Temporary until default skin has a valid hit lighting. if ((lookup as SkinnableSprite.SpriteComponentLookup)?.LookupName == @"lighting") return Drawable.Empty(); - if (base.GetDrawableComponent(lookup) is UserConfiguredLayoutContainer c) - return c; - switch (lookup) { case SkinComponentsContainerLookup containerLookup: + if (base.GetDrawableComponent(lookup) is UserConfiguredLayoutContainer c) + return c; + // Only handle global level defaults for now. if (containerLookup.Ruleset != null) return null; @@ -178,7 +178,7 @@ public TrianglesSkin(SkinInfo skin, IStorageResourceProvider resources) return null; } - return null; + return base.GetDrawableComponent(lookup); } public override IBindable? GetConfig(TLookup lookup)