From e43b2d0a70c9ea94ef3a89f02acd2f4f92c736ed Mon Sep 17 00:00:00 2001 From: andy840119 Date: Sat, 29 Apr 2023 16:31:32 +0800 Subject: [PATCH] Remove the logic in the legacy skin transformers. --- .../Legacy/KaraokeLegacySkinTransformer.cs | 34 ------------------- 1 file changed, 34 deletions(-) diff --git a/osu.Game.Rulesets.Karaoke/Skinning/Legacy/KaraokeLegacySkinTransformer.cs b/osu.Game.Rulesets.Karaoke/Skinning/Legacy/KaraokeLegacySkinTransformer.cs index 465ccad75..2b3108f55 100644 --- a/osu.Game.Rulesets.Karaoke/Skinning/Legacy/KaraokeLegacySkinTransformer.cs +++ b/osu.Game.Rulesets.Karaoke/Skinning/Legacy/KaraokeLegacySkinTransformer.cs @@ -6,10 +6,8 @@ using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Game.Beatmaps; -using osu.Game.Rulesets.Karaoke.UI.HUD; using osu.Game.Rulesets.Scoring; using osu.Game.Skinning; -using Container = osu.Framework.Graphics.Containers.Container; namespace osu.Game.Rulesets.Karaoke.Skinning.Legacy { @@ -31,22 +29,6 @@ public KaraokeLegacySkinTransformer(ISkin source, IBeatmap beatmap) { switch (lookup) { - case SkinComponentsContainerLookup targetComponent: - switch (targetComponent.Target) - { - case SkinComponentsContainerLookup.TargetArea.MainHUDComponents: - var components = base.GetDrawableComponent(lookup) as Container ?? getTargetComponentsContainerFromOtherPlace(); - components?.Add(new SettingButtonsDisplay - { - Anchor = Anchor.CentreRight, - Origin = Anchor.CentreRight, - }); - return components; - - default: - return base.GetDrawableComponent(lookup); - } - case GameplaySkinComponentLookup resultComponent: return getResult(resultComponent.Component); @@ -67,13 +49,6 @@ public KaraokeLegacySkinTransformer(ISkin source, IBeatmap beatmap) default: return base.GetDrawableComponent(lookup); } - - Container? getTargetComponentsContainerFromOtherPlace() => - Skin switch - { - LegacySkin legacySkin => new TempLegacySkin(legacySkin.SkinInfo.Value).GetDrawableComponent(lookup) as Container, - _ => throw new InvalidCastException() - }; } private Drawable? getResult(HitResult result) @@ -84,14 +59,5 @@ public KaraokeLegacySkinTransformer(ISkin source, IBeatmap beatmap) public override IBindable? GetConfig(TLookup lookup) => karaokeSkin.GetConfig(lookup); - - // it's a temp class for just getting SkinnableTarget.MainHUDComponents - private class TempLegacySkin : LegacySkin - { - public TempLegacySkin(SkinInfo skin) - : base(skin, null, null) - { - } - } } }