From c70be29edacbdebb10dd874d15cd6dda145ef5ca Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 12 Mar 2018 11:30:13 +0900 Subject: [PATCH] Move legacy conversion to LegacySkin --- .../Rulesets/Judgements/DrawableJudgement.cs | 19 +------------------ osu.Game/Skinning/LegacySkin.cs | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs index 4664517312..8639812aff 100644 --- a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs +++ b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs @@ -40,24 +40,7 @@ public DrawableJudgement(Judgement judgement) [BackgroundDependencyLoader] private void load(OsuColour colours) { - string legacyName = string.Empty; - switch (Judgement.Result) - { - case HitResult.Miss: - legacyName = "hit0"; - break; - case HitResult.Meh: - legacyName = "hit50"; - break; - case HitResult.Good: - legacyName = "hit100"; - break; - case HitResult.Great: - legacyName = "hit300"; - break; - } - - Child = new SkinnableDrawable($"Play/osu/{legacyName}", _ => JudgementText = new OsuSpriteText + Child = new SkinnableDrawable($"Play/{Judgement.Result}", _ => JudgementText = new OsuSpriteText { Text = Judgement.Result.GetDescription().ToUpper(), Font = @"Venera", diff --git a/osu.Game/Skinning/LegacySkin.cs b/osu.Game/Skinning/LegacySkin.cs index f03d1ce632..2caeed8480 100644 --- a/osu.Game/Skinning/LegacySkin.cs +++ b/osu.Game/Skinning/LegacySkin.cs @@ -29,6 +29,22 @@ public LegacySkin(SkinInfo skin, IResourceStore storage, AudioManager au public override Drawable GetDrawableComponent(string componentName) { + switch (componentName) + { + case "Play/Miss": + componentName = "hit0"; + break; + case "Play/Meh": + componentName = "hit50"; + break; + case "Play/Good": + componentName = "hit100"; + break; + case "Play/Great": + componentName = "hit300"; + break; + } + var texture = textures.Get(componentName); if (texture == null) return null;