From f00aa303708f6c49ee69d431a14cf08e35d1075b Mon Sep 17 00:00:00 2001 From: andy840119 Date: Mon, 10 Oct 2022 10:48:09 +0800 Subject: [PATCH] Here's no need to read the skin from default skin. --- .../Skinning/Legacy/KaraokeLegacySkinTransformer.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/osu.Game.Rulesets.Karaoke/Skinning/Legacy/KaraokeLegacySkinTransformer.cs b/osu.Game.Rulesets.Karaoke/Skinning/Legacy/KaraokeLegacySkinTransformer.cs index 803419ea6..95dcd8f95 100644 --- a/osu.Game.Rulesets.Karaoke/Skinning/Legacy/KaraokeLegacySkinTransformer.cs +++ b/osu.Game.Rulesets.Karaoke/Skinning/Legacy/KaraokeLegacySkinTransformer.cs @@ -15,14 +15,14 @@ namespace osu.Game.Rulesets.Karaoke.Skinning.Legacy public class KaraokeLegacySkinTransformer : LegacySkinTransformer { private readonly Lazy isLegacySkin; - private readonly KaraokeBeatmapSkin defaultKaraokeSkin; + private readonly KaraokeBeatmapSkin karaokeSkin; public KaraokeLegacySkinTransformer(ISkin source, IBeatmap beatmap) : base(source) { // we should get config by default karaoke skin. // if has resource or texture, then try to get from legacy skin. - defaultKaraokeSkin = new KaraokeBeatmapSkin(new SkinInfo(), new InternalSkinStorageResourceProvider("Default")); + karaokeSkin = new KaraokeBeatmapSkin(new SkinInfo(), new InternalSkinStorageResourceProvider("Default")); isLegacySkin = new Lazy(() => GetConfig(SkinConfiguration.LegacySetting.Version) != null); } @@ -82,10 +82,7 @@ public KaraokeLegacySkinTransformer(ISkin source, IBeatmap beatmap) } public override IBindable? GetConfig(TLookup lookup) - { - var config = defaultKaraokeSkin.GetConfig(lookup); - return config ?? base.GetConfig(lookup); - } + => karaokeSkin.GetConfig(lookup); // it's a temp class for just getting SkinnableTarget.MainHUDComponents private class TempLegacySkin : LegacySkin