Fix legacy skin transformers potentially ignoring source implementations

This commit is contained in:
Salman Ahmed 2021-05-27 05:15:29 +03:00
parent 53cbf369d7
commit fbc316ea1d
4 changed files with 25 additions and 17 deletions

View File

@ -28,12 +28,15 @@ namespace osu.Game.Rulesets.Catch.Skinning.Legacy
{
case HUDSkinComponents.ComboCounter:
// catch may provide its own combo counter; hide the default.
return providesComboCounter ? Drawable.Empty() : null;
if (providesComboCounter)
return Drawable.Empty();
break;
}
}
if (!(component is CatchSkinComponent catchSkinComponent))
return null;
return Source.GetDrawableComponent(component);
switch (catchSkinComponent.Component)
{
@ -41,19 +44,19 @@ namespace osu.Game.Rulesets.Catch.Skinning.Legacy
if (GetTexture("fruit-pear") != null)
return new LegacyFruitPiece();
break;
return null;
case CatchSkinComponents.Banana:
if (GetTexture("fruit-bananas") != null)
return new LegacyBananaPiece();
break;
return null;
case CatchSkinComponents.Droplet:
if (GetTexture("fruit-drop") != null)
return new LegacyDropletPiece();
break;
return null;
case CatchSkinComponents.CatcherIdle:
return this.GetAnimation("fruit-catcher-idle", true, true, true) ??
@ -71,10 +74,11 @@ namespace osu.Game.Rulesets.Catch.Skinning.Legacy
if (providesComboCounter)
return new LegacyCatchComboCounter(Source);
break;
}
return null;
default:
return Source.GetDrawableComponent(component);
}
}
public override IBindable<TValue> GetConfig<TLookup, TValue>(TLookup lookup)

View File

@ -120,12 +120,14 @@ namespace osu.Game.Rulesets.Mania.Skinning.Legacy
case ManiaSkinComponents.StageForeground:
return new LegacyStageForeground();
default:
return Source.GetDrawableComponent(component);
}
break;
default:
return Source.GetDrawableComponent(component);
}
return null;
}
private Drawable getResult(HitResult result)

View File

@ -35,7 +35,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
public override Drawable GetDrawableComponent(ISkinComponent component)
{
if (!(component is OsuSkinComponent osuComponent))
return null;
return Source.GetDrawableComponent(component);
switch (osuComponent.Component)
{
@ -115,9 +115,10 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
return new LegacyOldStyleSpinner();
return null;
}
return null;
default:
return Source.GetDrawableComponent(component);
}
}
public override IBindable<TValue> GetConfig<TLookup, TValue>(TLookup lookup)

View File

@ -39,7 +39,7 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Legacy
}
if (!(component is TaikoSkinComponent taikoComponent))
return null;
return Source.GetDrawableComponent(component);
switch (taikoComponent.Component)
{
@ -130,10 +130,11 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Legacy
case TaikoSkinComponents.Mascot:
return new DrawableTaikoMascot();
}
default:
return Source.GetDrawableComponent(component);
}
}
private string getHitName(TaikoSkinComponents component)
{