1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 15:27:24 +08:00

Add support for indexless mascot texture lookups

This commit is contained in:
Bartłomiej Dach 2020-07-25 12:03:54 +02:00
parent 897ab4a9bb
commit ea3ef37f9a
2 changed files with 9 additions and 5 deletions

View File

@ -91,10 +91,7 @@ namespace osu.Game.Rulesets.Taiko.Skinning
return null;
case TaikoSkinComponents.Mascot:
if (GetTexture("pippidonclear0") != null)
return new DrawableTaikoMascot();
return null;
return new DrawableTaikoMascot();
}
return Source.GetDrawableComponent(component);

View File

@ -128,6 +128,13 @@ namespace osu.Game.Rulesets.Taiko.UI
}
private static Texture getAnimationFrame(ISkin skin, TaikoMascotAnimationState state, int frameIndex)
=> skin.GetTexture($"pippidon{state.ToString().ToLower()}{frameIndex}");
{
var texture = skin.GetTexture($"pippidon{state.ToString().ToLower()}{frameIndex}");
if (frameIndex == 0 && texture == null)
texture = skin.GetTexture($"pippidon{state.ToString().ToLower()}");
return texture;
}
}
}