1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 00:02:56 +08:00

Simplify hit result lookups

This commit is contained in:
Dean Herbert 2019-08-30 15:12:03 +09:00
parent a15828ab25
commit a7c94c3883

View File

@ -9,6 +9,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Textures; using osu.Framework.Graphics.Textures;
using osu.Framework.IO.Stores; using osu.Framework.IO.Stores;
using osu.Game.Audio; using osu.Game.Audio;
using osu.Game.Rulesets.Scoring;
using osuTK.Graphics; using osuTK.Graphics;
namespace osu.Game.Skinning namespace osu.Game.Skinning
@ -49,21 +50,27 @@ namespace osu.Game.Skinning
public override Drawable GetDrawableComponent(ISkinComponent component) public override Drawable GetDrawableComponent(ISkinComponent component)
{ {
switch (component.LookupName) switch (component)
{ {
case "Play/Miss": case PlaySkinComponent<HitResult> resultComponent:
switch (resultComponent.Component)
{
case HitResult.Miss:
return this.GetAnimation("hit0", true, false); return this.GetAnimation("hit0", true, false);
case "Play/Meh": case HitResult.Meh:
return this.GetAnimation("hit50", true, false); return this.GetAnimation("hit50", true, false);
case "Play/Good": case HitResult.Good:
return this.GetAnimation("hit100", true, false); return this.GetAnimation("hit100", true, false);
case "Play/Great": case HitResult.Great:
return this.GetAnimation("hit300", true, false); return this.GetAnimation("hit300", true, false);
} }
break;
}
return this.GetAnimation(component.LookupName, false, false); return this.GetAnimation(component.LookupName, false, false);
} }