1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 12:57:36 +08:00

Disallow beatmap skin to fall back to default HUD components

This should become a more generalized `AllowDefaultSkinFallback` when default legacy skin fallback is supported.
This commit is contained in:
Salman Ahmed 2021-05-15 14:32:15 +03:00
parent 94b7e89ac0
commit 4c25fe750f
2 changed files with 8 additions and 0 deletions

View File

@ -14,6 +14,7 @@ namespace osu.Game.Skinning
public class LegacyBeatmapSkin : LegacySkin
{
protected override bool AllowManiaSkin => false;
protected override bool AllowDefaultHUDComponentsFallback => false;
protected override bool UseCustomSampleBanks => true;
public LegacyBeatmapSkin(BeatmapInfo beatmap, IResourceStore<byte[]> storage, IStorageResourceProvider resources)

View File

@ -38,6 +38,11 @@ namespace osu.Game.Skinning
protected virtual bool AllowManiaSkin => hasKeyTexture.Value;
/// <summary>
/// Whether this skin will fall back to default HUD components if it has no fonts for use.
/// </summary>
protected virtual bool AllowDefaultHUDComponentsFallback => true;
/// <summary>
/// Whether this skin can use samples with a custom bank (custom sample set in stable terminology).
/// Added in order to match sample lookup logic from stable (in stable, only the beatmap skin could use samples with a custom sample bank).
@ -331,6 +336,8 @@ namespace osu.Game.Skinning
switch (target.Target)
{
case SkinnableTarget.MainHUDComponents:
if (!this.HasFont(LegacyFont.Score) && !AllowDefaultHUDComponentsFallback)
return null;
var skinnableTargetWrapper = new SkinnableTargetComponentsContainer(container =>
{