mirror of
https://github.com/ppy/osu
synced 2024-12-15 11:25:29 +00:00
Replace AllowDefaultHUDComponentsFallback
with a temporary override at LegacyBeatmapSkin
This commit is contained in:
parent
df248ea41b
commit
f667ea3fd0
@ -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;
|
||||
@ -14,7 +15,6 @@ 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)
|
||||
@ -24,6 +24,19 @@ namespace osu.Game.Skinning
|
||||
Configuration.AllowDefaultComboColoursFallback = false;
|
||||
}
|
||||
|
||||
public override Drawable GetDrawableComponent(ISkinComponent component)
|
||||
{
|
||||
if (component is SkinnableTargetComponent targetComponent && targetComponent.Target == SkinnableTarget.MainHUDComponents)
|
||||
{
|
||||
// for now, if the beatmap skin doesn't skin the score font, fall back to current skin
|
||||
// instead of potentially returning default lazer skin HUD components from here.
|
||||
if (!this.HasFont(LegacyFont.Score))
|
||||
return null;
|
||||
}
|
||||
|
||||
return base.GetDrawableComponent(component);
|
||||
}
|
||||
|
||||
public override IBindable<TValue> GetConfig<TLookup, TValue>(TLookup lookup)
|
||||
{
|
||||
switch (lookup)
|
||||
|
@ -38,11 +38,6 @@ 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).
|
||||
@ -336,9 +331,6 @@ namespace osu.Game.Skinning
|
||||
switch (target.Target)
|
||||
{
|
||||
case SkinnableTarget.MainHUDComponents:
|
||||
if (!this.HasFont(LegacyFont.Score) && !AllowDefaultHUDComponentsFallback)
|
||||
return null;
|
||||
|
||||
var skinnableTargetWrapper = new SkinnableTargetComponentsContainer(container =>
|
||||
{
|
||||
var score = container.OfType<LegacyScoreCounter>().FirstOrDefault();
|
||||
|
Loading…
Reference in New Issue
Block a user