mirror of
https://github.com/ppy/osu.git
synced 2025-01-27 11:12:59 +08: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.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,19 +50,25 @@ 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:
|
||||||
return this.GetAnimation("hit0", true, false);
|
switch (resultComponent.Component)
|
||||||
|
{
|
||||||
|
case HitResult.Miss:
|
||||||
|
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);
|
||||||
|
Loading…
Reference in New Issue
Block a user