mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 18:03:11 +08:00
Move implementation to DrawableHit to avoid "breaking" legacy encoding
This commit is contained in:
parent
b4d790c076
commit
77041bdbb5
@ -171,30 +171,6 @@ namespace osu.Game.Rulesets.Taiko.Beatmaps
|
|||||||
|
|
||||||
bool isRim = samples.Any(isRimDefinition);
|
bool isRim = samples.Any(isRimDefinition);
|
||||||
|
|
||||||
if (isRim)
|
|
||||||
{
|
|
||||||
// consume then remove the rim definition sample types.
|
|
||||||
var updatedSamples = samples.Where(s => !isRimDefinition(s)).ToList();
|
|
||||||
|
|
||||||
// strong + rim always maps to whistle.
|
|
||||||
if (strong)
|
|
||||||
{
|
|
||||||
for (var i = 0; i < updatedSamples.Count; i++)
|
|
||||||
{
|
|
||||||
var s = samples[i];
|
|
||||||
|
|
||||||
if (s.Name != HitSampleInfo.HIT_FINISH)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
var sClone = s.Clone();
|
|
||||||
sClone.Name = HitSampleInfo.HIT_WHISTLE;
|
|
||||||
updatedSamples[i] = sClone;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
samples = updatedSamples;
|
|
||||||
}
|
|
||||||
|
|
||||||
yield return new Hit
|
yield return new Hit
|
||||||
{
|
{
|
||||||
StartTime = obj.StartTime,
|
StartTime = obj.StartTime,
|
||||||
|
@ -52,7 +52,32 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
|||||||
protected override IEnumerable<HitSampleInfo> GetSamples()
|
protected override IEnumerable<HitSampleInfo> GetSamples()
|
||||||
{
|
{
|
||||||
// normal and claps are always handled by the drum (see DrumSampleMapping).
|
// normal and claps are always handled by the drum (see DrumSampleMapping).
|
||||||
return HitObject.Samples.Where(s => s.Name != HitSampleInfo.HIT_NORMAL && s.Name != HitSampleInfo.HIT_CLAP);
|
var samples = HitObject.Samples.Where(s => s.Name != HitSampleInfo.HIT_NORMAL && s.Name != HitSampleInfo.HIT_CLAP);
|
||||||
|
|
||||||
|
if (HitObject.Type == HitType.Rim && HitObject.IsStrong)
|
||||||
|
{
|
||||||
|
// strong + rim always maps to whistle.
|
||||||
|
// TODO: this should really be in the legacy decoder, but can't be because legacy encoding parity would be broken.
|
||||||
|
// when we add a taiko editor, this is probably not going to play nice.
|
||||||
|
|
||||||
|
var corrected = samples.ToList();
|
||||||
|
|
||||||
|
for (var i = 0; i < corrected.Count; i++)
|
||||||
|
{
|
||||||
|
var s = corrected[i];
|
||||||
|
|
||||||
|
if (s.Name != HitSampleInfo.HIT_FINISH)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
var sClone = s.Clone();
|
||||||
|
sClone.Name = HitSampleInfo.HIT_WHISTLE;
|
||||||
|
corrected[i] = sClone;
|
||||||
|
}
|
||||||
|
|
||||||
|
return corrected;
|
||||||
|
}
|
||||||
|
|
||||||
|
return samples;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void CheckForResult(bool userTriggered, double timeOffset)
|
protected override void CheckForResult(bool userTriggered, double timeOffset)
|
||||||
|
Loading…
Reference in New Issue
Block a user