Fix legacy beatmap skins not falling back properly on HUD components

This commit is contained in:
Salman Ahmed 2021-05-19 23:01:27 +03:00
parent 71da960000
commit 9f3ea150f5

View File

@ -3,6 +3,7 @@
using osu.Framework.Audio.Sample;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.IO.Stores;
using osu.Game.Audio;
using osu.Game.Beatmaps;
@ -23,6 +24,25 @@ namespace osu.Game.Skinning
Configuration.AllowDefaultComboColoursFallback = false;
}
public override Drawable GetDrawableComponent(ISkinComponent component)
{
if (component is SkinnableTargetComponent targetComponent)
{
switch (targetComponent.Target)
{
case SkinnableTarget.MainHUDComponents:
// this should exist in LegacySkin instead, but there isn't a fallback skin for LegacySkins yet.
// therefore keep the check here until fallback default legacy skin is supported.
if (!this.HasFont(LegacyFont.Score))
return null;
break;
}
}
return base.GetDrawableComponent(component);
}
public override IBindable<TValue> GetConfig<TLookup, TValue>(TLookup lookup)
{
switch (lookup)