Fix custom sample set 0 not falling back to default samples

This commit is contained in:
smoogipoo
2020-04-13 20:00:06 +09:00
parent ef5e88dd82
commit cee4b005e6
3 changed files with 15 additions and 2 deletions

View File

@ -2,8 +2,10 @@
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Audio;
using osu.Framework.Audio.Sample;
using osu.Framework.Bindables;
using osu.Framework.IO.Stores;
using osu.Game.Audio;
using osu.Game.Beatmaps;
namespace osu.Game.Skinning
@ -33,6 +35,17 @@ namespace osu.Game.Skinning
return base.GetConfig<TLookup, TValue>(lookup);
}
public override SampleChannel GetSample(ISampleInfo sampleInfo)
{
if (sampleInfo is HitSampleInfo hsi && string.IsNullOrEmpty(hsi.Suffix))
{
// When no custom sample set is provided, always fall-back to the default samples.
return null;
}
return base.GetSample(sampleInfo);
}
private static SkinInfo createSkinInfo(BeatmapInfo beatmap) =>
new SkinInfo { Name = beatmap.ToString(), Creator = beatmap.Metadata.Author.ToString() };
}