mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Fix custom sample set 0 not falling back to default samples
This commit is contained in:
@ -168,7 +168,7 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
{
|
{
|
||||||
var baseInfo = base.ApplyTo(hitSampleInfo);
|
var baseInfo = base.ApplyTo(hitSampleInfo);
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(baseInfo.Suffix) && CustomSampleBank > 1)
|
if (string.IsNullOrEmpty(baseInfo.Suffix) && CustomSampleBank > 0)
|
||||||
baseInfo.Suffix = CustomSampleBank.ToString();
|
baseInfo.Suffix = CustomSampleBank.ToString();
|
||||||
|
|
||||||
return baseInfo;
|
return baseInfo;
|
||||||
|
@ -415,7 +415,7 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
|||||||
{
|
{
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (value > 1)
|
if (value > 0)
|
||||||
Suffix = value.ToString();
|
Suffix = value.ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,8 +2,10 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using osu.Framework.Audio;
|
using osu.Framework.Audio;
|
||||||
|
using osu.Framework.Audio.Sample;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.IO.Stores;
|
using osu.Framework.IO.Stores;
|
||||||
|
using osu.Game.Audio;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
|
|
||||||
namespace osu.Game.Skinning
|
namespace osu.Game.Skinning
|
||||||
@ -33,6 +35,17 @@ namespace osu.Game.Skinning
|
|||||||
return base.GetConfig<TLookup, TValue>(lookup);
|
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) =>
|
private static SkinInfo createSkinInfo(BeatmapInfo beatmap) =>
|
||||||
new SkinInfo { Name = beatmap.ToString(), Creator = beatmap.Metadata.Author.ToString() };
|
new SkinInfo { Name = beatmap.ToString(), Creator = beatmap.Metadata.Author.ToString() };
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user