mirror of
https://github.com/ppy/osu.git
synced 2025-01-27 13:23:05 +08:00
Fix hit normals always being played, regardless of sound type.
This commit is contained in:
parent
6e3125e115
commit
ac9f0ccb48
@ -108,43 +108,8 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
|||||||
result.StartTime = Convert.ToDouble(split[2], CultureInfo.InvariantCulture);
|
result.StartTime = Convert.ToDouble(split[2], CultureInfo.InvariantCulture);
|
||||||
|
|
||||||
var soundType = (LegacySoundType)int.Parse(split[4]);
|
var soundType = (LegacySoundType)int.Parse(split[4]);
|
||||||
|
result.Samples = convertSoundType(soundType, normalSampleBank, addSampleBank);
|
||||||
result.Samples.Add(new SampleInfo
|
result.Samples.ForEach(s => s.Volume = sampleVolume);
|
||||||
{
|
|
||||||
Bank = normalSampleBank,
|
|
||||||
Name = SampleInfo.HIT_NORMAL,
|
|
||||||
Volume = sampleVolume
|
|
||||||
});
|
|
||||||
|
|
||||||
if ((soundType & LegacySoundType.Finish) > 0)
|
|
||||||
{
|
|
||||||
result.Samples.Add(new SampleInfo
|
|
||||||
{
|
|
||||||
Bank = addSampleBank,
|
|
||||||
Name = SampleInfo.HIT_FINISH,
|
|
||||||
Volume = sampleVolume
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((soundType & LegacySoundType.Whistle) > 0)
|
|
||||||
{
|
|
||||||
result.Samples.Add(new SampleInfo
|
|
||||||
{
|
|
||||||
Bank = addSampleBank,
|
|
||||||
Name = SampleInfo.HIT_WHISTLE,
|
|
||||||
Volume = sampleVolume
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((soundType & LegacySoundType.Clap) > 0)
|
|
||||||
{
|
|
||||||
result.Samples.Add(new SampleInfo
|
|
||||||
{
|
|
||||||
Bank = addSampleBank,
|
|
||||||
Name = SampleInfo.HIT_CLAP,
|
|
||||||
Volume = sampleVolume
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -202,6 +167,49 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
|||||||
/// <returns>The hit object.</returns>
|
/// <returns>The hit object.</returns>
|
||||||
protected abstract HitObject CreateSpinner(Vector2 position, double endTime);
|
protected abstract HitObject CreateSpinner(Vector2 position, double endTime);
|
||||||
|
|
||||||
|
private List<SampleInfo> convertSoundType(LegacySoundType type, string normalSampleBank, string addSampleBank)
|
||||||
|
{
|
||||||
|
List<SampleInfo> soundTypes = new List<SampleInfo>();
|
||||||
|
|
||||||
|
if ((type & LegacySoundType.Normal) > 0)
|
||||||
|
{
|
||||||
|
soundTypes.Add(new SampleInfo
|
||||||
|
{
|
||||||
|
Bank = normalSampleBank,
|
||||||
|
Name = SampleInfo.HIT_NORMAL
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((type & LegacySoundType.Finish) > 0)
|
||||||
|
{
|
||||||
|
soundTypes.Add(new SampleInfo
|
||||||
|
{
|
||||||
|
Bank = addSampleBank,
|
||||||
|
Name = SampleInfo.HIT_FINISH
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((type & LegacySoundType.Whistle) > 0)
|
||||||
|
{
|
||||||
|
soundTypes.Add(new SampleInfo
|
||||||
|
{
|
||||||
|
Bank = addSampleBank,
|
||||||
|
Name = SampleInfo.HIT_WHISTLE
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((type & LegacySoundType.Clap) > 0)
|
||||||
|
{
|
||||||
|
soundTypes.Add(new SampleInfo
|
||||||
|
{
|
||||||
|
Bank = addSampleBank,
|
||||||
|
Name = SampleInfo.HIT_CLAP
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return soundTypes;
|
||||||
|
}
|
||||||
|
|
||||||
[Flags]
|
[Flags]
|
||||||
private enum LegacySoundType
|
private enum LegacySoundType
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user