mirror of https://github.com/ppy/osu
pass new hitobject properties through beatmap converters
This commit is contained in:
parent
139a1d7e6d
commit
4a0ff046ae
|
@ -26,6 +26,7 @@ protected override IEnumerable<CatchHitObject> ConvertHitObject(HitObject obj, I
|
|||
var xPositionData = obj as IHasXPosition;
|
||||
var yPositionData = obj as IHasYPosition;
|
||||
var comboData = obj as IHasCombo;
|
||||
var sliderVelocityData = obj as IHasSliderVelocity;
|
||||
|
||||
switch (obj)
|
||||
{
|
||||
|
@ -41,7 +42,8 @@ protected override IEnumerable<CatchHitObject> ConvertHitObject(HitObject obj, I
|
|||
NewCombo = comboData?.NewCombo ?? false,
|
||||
ComboOffset = comboData?.ComboOffset ?? 0,
|
||||
LegacyLastTickOffset = (obj as IHasLegacyLastTickOffset)?.LegacyLastTickOffset ?? 0,
|
||||
LegacyConvertedY = yPositionData?.Y ?? CatchHitObject.DEFAULT_LEGACY_CONVERT_Y
|
||||
LegacyConvertedY = yPositionData?.Y ?? CatchHitObject.DEFAULT_LEGACY_CONVERT_Y,
|
||||
SliderVelocity = sliderVelocityData?.SliderVelocity ?? 1
|
||||
}.Yield();
|
||||
|
||||
case IHasDuration endTime:
|
||||
|
|
|
@ -30,6 +30,8 @@ protected override IEnumerable<OsuHitObject> ConvertHitObject(HitObject original
|
|||
{
|
||||
var positionData = original as IHasPosition;
|
||||
var comboData = original as IHasCombo;
|
||||
var sliderVelocityData = original as IHasSliderVelocity;
|
||||
var generateTicksData = original as IHasGenerateTicks;
|
||||
|
||||
switch (original)
|
||||
{
|
||||
|
@ -47,7 +49,9 @@ protected override IEnumerable<OsuHitObject> ConvertHitObject(HitObject original
|
|||
LegacyLastTickOffset = (original as IHasLegacyLastTickOffset)?.LegacyLastTickOffset,
|
||||
// prior to v8, speed multipliers don't adjust for how many ticks are generated over the same distance.
|
||||
// this results in more (or less) ticks being generated in <v8 maps for the same time duration.
|
||||
TickDistanceMultiplier = beatmap.BeatmapInfo.BeatmapVersion < 8 ? 1f / ((LegacyControlPointInfo)beatmap.ControlPointInfo).DifficultyPointAt(original.StartTime).SliderVelocity : 1
|
||||
TickDistanceMultiplier = beatmap.BeatmapInfo.BeatmapVersion < 8 ? 1f / ((LegacyControlPointInfo)beatmap.ControlPointInfo).DifficultyPointAt(original.StartTime).SliderVelocity : 1,
|
||||
GenerateTicks = generateTicksData?.GenerateTicks ?? true,
|
||||
SliderVelocity = sliderVelocityData?.SliderVelocity ?? 1,
|
||||
}.Yield();
|
||||
|
||||
case IHasDuration endTimeData:
|
||||
|
|
|
@ -133,7 +133,8 @@ protected override IEnumerable<TaikoHitObject> ConvertHitObject(HitObject obj, I
|
|||
StartTime = obj.StartTime,
|
||||
Samples = obj.Samples,
|
||||
Duration = taikoDuration,
|
||||
TickRate = beatmap.Difficulty.SliderTickRate == 3 ? 3 : 4
|
||||
TickRate = beatmap.Difficulty.SliderTickRate == 3 ? 3 : 4,
|
||||
SliderVelocity = obj is IHasSliderVelocity velocityData ? velocityData.SliderVelocity : 1
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue