1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 03:42:57 +08:00

Fix sprite dropdown not showing resources from non-legacy skins during gameplay

This commit is contained in:
Dean Herbert 2022-09-22 18:43:41 +09:00
parent a7eb9d8b78
commit ea7c5458fe
4 changed files with 20 additions and 6 deletions

View File

@ -82,7 +82,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
var topProvider = source.FindProvider(s => s.GetTexture("spinner-top") != null);
if (topProvider is LegacySkinTransformer transformer && !(transformer.Skin is DefaultLegacySkin))
if (topProvider is ISkinTransformer transformer && !(transformer.Skin is DefaultLegacySkin))
{
AddInternal(ApproachCircle = new Sprite
{

View File

@ -0,0 +1,17 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
namespace osu.Game.Skinning
{
/// <summary>
/// A skin transformer takes in an <see cref="ISkin"/> and applies transformations to it.
/// The most common use case is allowing individual rulesets to add skinnable components without directly coupling to underlying skins.
/// </summary>
public interface ISkinTransformer : ISkin
{
/// <summary>
/// The original skin that is being transformed.
/// </summary>
ISkin Skin { get; }
}
}

View File

@ -18,11 +18,8 @@ namespace osu.Game.Skinning
/// <summary>
/// Transformer used to handle support of legacy features for individual rulesets.
/// </summary>
public abstract class LegacySkinTransformer : ISkin
public abstract class LegacySkinTransformer : ISkinTransformer
{
/// <summary>
/// The <see cref="ISkin"/> which is being transformed.
/// </summary>
[NotNull]
public ISkin Skin { get; }

View File

@ -100,7 +100,7 @@ namespace osu.Game.Skinning
{
foreach (var skin in skins)
{
if (skin is LegacySkinTransformer transformer && isUserSkin(transformer.Skin))
if (skin is ISkinTransformer transformer && isUserSkin(transformer.Skin))
return transformer.Skin;
if (isUserSkin(skin))