Fix osu!mania legacy skin configurations not working when notes are not skinned

This commit is contained in:
Dean Herbert 2023-09-06 18:00:49 +09:00
parent 14936677fc
commit 88b9d3237a
2 changed files with 3 additions and 13 deletions

View File

@ -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;
/// <summary>

View File

@ -29,13 +29,7 @@ namespace osu.Game.Skinning
{
public class LegacySkin : Skin
{
/// <summary>
/// Whether texture for the keys exists.
/// Used to determine if the mania ruleset is skinned.
/// </summary>
private readonly Lazy<bool> hasKeyTexture;
protected virtual bool AllowManiaSkin => hasKeyTexture.Value;
protected virtual bool AllowManiaConfigLookups => true;
/// <summary>
/// Whether this skin can use samples with a custom bank (custom sample set in stable terminology).
@ -61,10 +55,6 @@ public LegacySkin(SkinInfo skin, IStorageResourceProvider resources)
protected LegacySkin(SkinInfo skin, IStorageResourceProvider? resources, IResourceStore<byte[]>? 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<bool>(() => this.GetAnimation(
lookupForMania<string>(new LegacyManiaSkinConfigurationLookup(4, LegacyManiaSkinConfigurationLookups.KeyImage, 0))?.Value ?? "mania-key1", true,
true) != null);
}
protected override void ParseConfigurationStream(Stream stream)
@ -114,7 +104,7 @@ protected override void ParseConfigurationStream(Stream stream)
return SkinUtils.As<TValue>(getCustomColour(Configuration, customColour.Lookup.ToString() ?? string.Empty));
case LegacyManiaSkinConfigurationLookup maniaLookup:
if (!AllowManiaSkin)
if (!AllowManiaConfigLookups)
break;
var result = lookupForMania<TValue>(maniaLookup);