mirror of https://github.com/ppy/osu
Add support for indexless mascot texture lookups
This commit is contained in:
parent
897ab4a9bb
commit
ea3ef37f9a
|
@ -91,10 +91,7 @@ public override Drawable GetDrawableComponent(ISkinComponent component)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
case TaikoSkinComponents.Mascot:
|
case TaikoSkinComponents.Mascot:
|
||||||
if (GetTexture("pippidonclear0") != null)
|
return new DrawableTaikoMascot();
|
||||||
return new DrawableTaikoMascot();
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Source.GetDrawableComponent(component);
|
return Source.GetDrawableComponent(component);
|
||||||
|
|
|
@ -128,6 +128,13 @@ private void load(ISkinSource skin)
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Texture getAnimationFrame(ISkin skin, TaikoMascotAnimationState state, int frameIndex)
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue