mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 07:06:35 +09:00
ControlPoint -> PathControlPoint
Also Curve -> Path.
This commit is contained in:
@ -37,7 +37,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Catch
|
||||
};
|
||||
}
|
||||
|
||||
protected override HitObject CreateSlider(Vector2 position, bool newCombo, int comboOffset, Vector2[] controlPoints, double length, CurveType curveType, int repeatCount, List<List<SampleInfo>> repeatSamples)
|
||||
protected override HitObject CreateSlider(Vector2 position, bool newCombo, int comboOffset, Vector2[] controlPoints, double length, PathType pathType, int repeatCount, List<List<SampleInfo>> repeatSamples)
|
||||
{
|
||||
newCombo |= forceNewCombo;
|
||||
comboOffset += extraComboOffset;
|
||||
@ -52,7 +52,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Catch
|
||||
ComboOffset = comboOffset,
|
||||
ControlPoints = controlPoints,
|
||||
Distance = length,
|
||||
CurveType = curveType,
|
||||
PathType = pathType,
|
||||
RepeatSamples = repeatSamples,
|
||||
RepeatCount = repeatCount
|
||||
};
|
||||
|
@ -70,7 +70,7 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
||||
}
|
||||
else if (type.HasFlag(ConvertHitObjectType.Slider))
|
||||
{
|
||||
CurveType curveType = CurveType.Catmull;
|
||||
PathType pathType = PathType.Catmull;
|
||||
double length = 0;
|
||||
|
||||
string[] pointSplit = split[5].Split('|');
|
||||
@ -90,16 +90,16 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
||||
switch (t)
|
||||
{
|
||||
case @"C":
|
||||
curveType = CurveType.Catmull;
|
||||
pathType = PathType.Catmull;
|
||||
break;
|
||||
case @"B":
|
||||
curveType = CurveType.Bezier;
|
||||
pathType = PathType.Bezier;
|
||||
break;
|
||||
case @"L":
|
||||
curveType = CurveType.Linear;
|
||||
pathType = PathType.Linear;
|
||||
break;
|
||||
case @"P":
|
||||
curveType = CurveType.PerfectCurve;
|
||||
pathType = PathType.PerfectCurve;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -113,8 +113,8 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
||||
// osu-stable special-cased colinear perfect curves to a CurveType.Linear
|
||||
bool isLinear(Vector2[] p) => Precision.AlmostEquals(0, (p[1].Y - p[0].Y) * (p[2].X - p[0].X) - (p[1].X - p[0].X) * (p[2].Y - p[0].Y));
|
||||
|
||||
if (points.Length == 3 && curveType == CurveType.PerfectCurve && isLinear(points))
|
||||
curveType = CurveType.Linear;
|
||||
if (points.Length == 3 && pathType == PathType.PerfectCurve && isLinear(points))
|
||||
pathType = PathType.Linear;
|
||||
|
||||
int repeatCount = Convert.ToInt32(split[6], CultureInfo.InvariantCulture);
|
||||
|
||||
@ -178,7 +178,7 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
||||
for (int i = 0; i < nodes; i++)
|
||||
nodeSamples.Add(convertSoundType(nodeSoundTypes[i], nodeBankInfos[i]));
|
||||
|
||||
result = CreateSlider(pos, combo, comboOffset, points, length, curveType, repeatCount, nodeSamples);
|
||||
result = CreateSlider(pos, combo, comboOffset, points, length, pathType, repeatCount, nodeSamples);
|
||||
}
|
||||
else if (type.HasFlag(ConvertHitObjectType.Spinner))
|
||||
{
|
||||
@ -268,11 +268,11 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
||||
/// <param name="comboOffset">When starting a new combo, the offset of the new combo relative to the current one.</param>
|
||||
/// <param name="controlPoints">The slider control points.</param>
|
||||
/// <param name="length">The slider length.</param>
|
||||
/// <param name="curveType">The slider curve type.</param>
|
||||
/// <param name="pathType">The slider curve type.</param>
|
||||
/// <param name="repeatCount">The slider repeat count.</param>
|
||||
/// <param name="repeatSamples">The samples to be played when the repeat nodes are hit. This includes the head and tail of the slider.</param>
|
||||
/// <returns>The hit object.</returns>
|
||||
protected abstract HitObject CreateSlider(Vector2 position, bool newCombo, int comboOffset, Vector2[] controlPoints, double length, CurveType curveType, int repeatCount, List<List<SampleInfo>> repeatSamples);
|
||||
protected abstract HitObject CreateSlider(Vector2 position, bool newCombo, int comboOffset, Vector2[] controlPoints, double length, PathType pathType, int repeatCount, List<List<SampleInfo>> repeatSamples);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a legacy Spinner-type hit object.
|
||||
|
@ -20,9 +20,9 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
||||
/// <summary>
|
||||
/// <see cref="ConvertSlider"/>s don't need a curve since they're converted to ruleset-specific hitobjects.
|
||||
/// </summary>
|
||||
public SliderCurve Curve { get; } = null;
|
||||
public SliderPath Path { get; } = null;
|
||||
public Vector2[] ControlPoints { get; set; }
|
||||
public CurveType CurveType { get; set; }
|
||||
public PathType PathType { get; set; }
|
||||
|
||||
public double Distance { get; set; }
|
||||
|
||||
|
@ -26,14 +26,14 @@ namespace osu.Game.Rulesets.Objects.Legacy.Mania
|
||||
};
|
||||
}
|
||||
|
||||
protected override HitObject CreateSlider(Vector2 position, bool newCombo, int comboOffset, Vector2[] controlPoints, double length, CurveType curveType, int repeatCount, List<List<SampleInfo>> repeatSamples)
|
||||
protected override HitObject CreateSlider(Vector2 position, bool newCombo, int comboOffset, Vector2[] controlPoints, double length, PathType pathType, int repeatCount, List<List<SampleInfo>> repeatSamples)
|
||||
{
|
||||
return new ConvertSlider
|
||||
{
|
||||
X = position.X,
|
||||
ControlPoints = controlPoints,
|
||||
Distance = length,
|
||||
CurveType = curveType,
|
||||
PathType = pathType,
|
||||
RepeatSamples = repeatSamples,
|
||||
RepeatCount = repeatCount
|
||||
};
|
||||
|
@ -38,7 +38,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
|
||||
};
|
||||
}
|
||||
|
||||
protected override HitObject CreateSlider(Vector2 position, bool newCombo, int comboOffset, Vector2[] controlPoints, double length, CurveType curveType, int repeatCount, List<List<SampleInfo>> repeatSamples)
|
||||
protected override HitObject CreateSlider(Vector2 position, bool newCombo, int comboOffset, Vector2[] controlPoints, double length, PathType pathType, int repeatCount, List<List<SampleInfo>> repeatSamples)
|
||||
{
|
||||
newCombo |= forceNewCombo;
|
||||
comboOffset += extraComboOffset;
|
||||
@ -53,7 +53,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
|
||||
ComboOffset = comboOffset,
|
||||
ControlPoints = controlPoints,
|
||||
Distance = Math.Max(0, length),
|
||||
CurveType = curveType,
|
||||
PathType = pathType,
|
||||
RepeatSamples = repeatSamples,
|
||||
RepeatCount = repeatCount
|
||||
};
|
||||
|
@ -23,13 +23,13 @@ namespace osu.Game.Rulesets.Objects.Legacy.Taiko
|
||||
return new ConvertHit();
|
||||
}
|
||||
|
||||
protected override HitObject CreateSlider(Vector2 position, bool newCombo, int comboOffset, Vector2[] controlPoints, double length, CurveType curveType, int repeatCount, List<List<SampleInfo>> repeatSamples)
|
||||
protected override HitObject CreateSlider(Vector2 position, bool newCombo, int comboOffset, Vector2[] controlPoints, double length, PathType pathType, int repeatCount, List<List<SampleInfo>> repeatSamples)
|
||||
{
|
||||
return new ConvertSlider
|
||||
{
|
||||
ControlPoints = controlPoints,
|
||||
Distance = length,
|
||||
CurveType = curveType,
|
||||
PathType = pathType,
|
||||
RepeatSamples = repeatSamples,
|
||||
RepeatCount = repeatCount
|
||||
};
|
||||
|
Reference in New Issue
Block a user