mirror of
https://github.com/ppy/osu
synced 2025-01-19 20:40:52 +00:00
Simplify hit result lookups
This commit is contained in:
parent
a15828ab25
commit
a7c94c3883
@ -9,6 +9,7 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
using osu.Framework.IO.Stores;
|
||||
using osu.Game.Audio;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Skinning
|
||||
@ -49,21 +50,27 @@ namespace osu.Game.Skinning
|
||||
|
||||
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);
|
||||
|
||||
case "Play/Meh":
|
||||
case HitResult.Meh:
|
||||
return this.GetAnimation("hit50", true, false);
|
||||
|
||||
case "Play/Good":
|
||||
case HitResult.Good:
|
||||
return this.GetAnimation("hit100", true, false);
|
||||
|
||||
case "Play/Great":
|
||||
case HitResult.Great:
|
||||
return this.GetAnimation("hit300", true, false);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return this.GetAnimation(component.LookupName, false, false);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user