1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 06:42:54 +08:00

Only custom sample banks > 1 modify the filename

This commit is contained in:
smoogipoo 2018-06-28 18:27:33 +09:00
parent 3a9a82c80c
commit 94f1b2eeb8
2 changed files with 8 additions and 5 deletions

View File

@ -12,6 +12,7 @@ using osu.Game.Beatmaps;
using osu.Game.Rulesets.Objects.Types;
using osu.Game.Beatmaps.Formats;
using osu.Game.Beatmaps.Timing;
using osu.Game.Rulesets.Objects;
using osu.Game.Skinning;
namespace osu.Game.Tests.Beatmaps.Formats
@ -222,11 +223,13 @@ namespace osu.Game.Tests.Beatmaps.Formats
{
var hitObjects = decoder.Decode(stream).HitObjects;
Assert.AreEqual(0, ((LegacyDecoder<Beatmap>.LegacySampleControlPoint)hitObjects[0].SampleControlPoint).CustomSampleBank);
Assert.AreEqual(1, ((LegacyDecoder<Beatmap>.LegacySampleControlPoint)hitObjects[1].SampleControlPoint).CustomSampleBank);
Assert.AreEqual(2, ((LegacyDecoder<Beatmap>.LegacySampleControlPoint)hitObjects[2].SampleControlPoint).CustomSampleBank);
Assert.AreEqual(0, ((LegacyDecoder<Beatmap>.LegacySampleControlPoint)hitObjects[3].SampleControlPoint).CustomSampleBank);
Assert.AreEqual("hitnormal", getTestableSampleInfo(hitObjects[0]).Name);
Assert.AreEqual("hitnormal", getTestableSampleInfo(hitObjects[1]).Name);
Assert.AreEqual("hitnormal2", getTestableSampleInfo(hitObjects[2]).Name);
Assert.AreEqual("hitnormal", getTestableSampleInfo(hitObjects[3]).Name);
}
SampleInfo getTestableSampleInfo(HitObject hitObject) => hitObject.SampleControlPoint.ApplyTo(new SampleInfo { Name = "hitnormal" });
}
}
}

View File

@ -178,7 +178,7 @@ namespace osu.Game.Beatmaps.Formats
{
var baseInfo = base.ApplyTo(sampleInfo);
if (CustomSampleBank > 0)
if (CustomSampleBank > 1)
baseInfo.Name += CustomSampleBank;
return baseInfo;