From 88b9d3237aeac4809500788387da75c8db09c0f8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 6 Sep 2023 18:00:49 +0900 Subject: [PATCH] Fix osu!mania legacy skin configurations not working when notes are not skinned --- osu.Game/Skinning/LegacyBeatmapSkin.cs | 2 +- osu.Game/Skinning/LegacySkin.cs | 14 ++------------ 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/osu.Game/Skinning/LegacyBeatmapSkin.cs b/osu.Game/Skinning/LegacyBeatmapSkin.cs index 83dcc3895d..90eb5fa013 100644 --- a/osu.Game/Skinning/LegacyBeatmapSkin.cs +++ b/osu.Game/Skinning/LegacyBeatmapSkin.cs @@ -19,7 +19,7 @@ namespace osu.Game.Skinning { public class LegacyBeatmapSkin : LegacySkin { - protected override bool AllowManiaSkin => false; + protected override bool AllowManiaConfigLookups => false; protected override bool UseCustomSampleBanks => true; /// diff --git a/osu.Game/Skinning/LegacySkin.cs b/osu.Game/Skinning/LegacySkin.cs index f286dfb776..1f485cbdf6 100644 --- a/osu.Game/Skinning/LegacySkin.cs +++ b/osu.Game/Skinning/LegacySkin.cs @@ -29,13 +29,7 @@ namespace osu.Game.Skinning { public class LegacySkin : Skin { - /// - /// Whether texture for the keys exists. - /// Used to determine if the mania ruleset is skinned. - /// - private readonly Lazy hasKeyTexture; - - protected virtual bool AllowManiaSkin => hasKeyTexture.Value; + protected virtual bool AllowManiaConfigLookups => true; /// /// Whether this skin can use samples with a custom bank (custom sample set in stable terminology). @@ -61,10 +55,6 @@ namespace osu.Game.Skinning protected LegacySkin(SkinInfo skin, IStorageResourceProvider? resources, IResourceStore? storage, string configurationFilename = @"skin.ini") : base(skin, resources, storage, configurationFilename) { - // todo: this shouldn't really be duplicated here (from ManiaLegacySkinTransformer). we need to come up with a better solution. - hasKeyTexture = new Lazy(() => this.GetAnimation( - lookupForMania(new LegacyManiaSkinConfigurationLookup(4, LegacyManiaSkinConfigurationLookups.KeyImage, 0))?.Value ?? "mania-key1", true, - true) != null); } protected override void ParseConfigurationStream(Stream stream) @@ -114,7 +104,7 @@ namespace osu.Game.Skinning return SkinUtils.As(getCustomColour(Configuration, customColour.Lookup.ToString() ?? string.Empty)); case LegacyManiaSkinConfigurationLookup maniaLookup: - if (!AllowManiaSkin) + if (!AllowManiaConfigLookups) break; var result = lookupForMania(maniaLookup);