1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 02:07:34 +08:00

Merge pull request #24727 from peppy/fix-mania-skin-lookups-no-sprites

Fix osu!mania legacy skin configurations not working when notes are not skinned
This commit is contained in:
Bartłomiej Dach 2023-09-11 08:11:58 +02:00 committed by GitHub
commit e3a0a914e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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

@ -30,13 +30,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).
@ -62,10 +56,6 @@ namespace osu.Game.Skinning
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)
@ -115,7 +105,7 @@ namespace osu.Game.Skinning
return SkinUtils.As<TValue>(getCustomColour(Configuration, customColour.Lookup.ToString() ?? string.Empty));
case LegacyManiaSkinConfigurationLookup maniaLookup:
if (!AllowManiaSkin)
if (!AllowManiaConfigLookups)
break;
var result = lookupForMania<TValue>(maniaLookup);