mirror of
https://github.com/osukey/osukey.git
synced 2025-05-20 21:17:32 +09:00
Add back autogeneration rules
Will be removed in https://github.com/ppy/osu/pull/6604
This commit is contained in:
parent
7100319858
commit
d6a49b9e93
@ -30,10 +30,19 @@ namespace osu.Game.Beatmaps.ControlPoints
|
|||||||
|
|
||||||
public void Add(ControlPoint point)
|
public void Add(ControlPoint point)
|
||||||
{
|
{
|
||||||
point.AttachGroup(this);
|
var existing = controlPoints.FirstOrDefault(p => p.GetType() == point.GetType());
|
||||||
|
|
||||||
|
if (existing != null)
|
||||||
|
{
|
||||||
|
// autogenerated points should not replace non-autogenerated.
|
||||||
|
// this allows for incorrectly ordered timing points to still be correctly handled.
|
||||||
|
if (point.AutoGenerated && !existing.AutoGenerated)
|
||||||
|
return;
|
||||||
|
|
||||||
foreach (var existing in controlPoints.Where(p => p.GetType() == point.GetType()).ToArray())
|
|
||||||
Remove(existing);
|
Remove(existing);
|
||||||
|
}
|
||||||
|
|
||||||
|
point.AttachGroup(this);
|
||||||
|
|
||||||
controlPoints.Add(point);
|
controlPoints.Add(point);
|
||||||
ItemAdded?.Invoke(point);
|
ItemAdded?.Invoke(point);
|
||||||
|
@ -184,9 +184,6 @@ namespace osu.Game.Beatmaps.ControlPoints
|
|||||||
|
|
||||||
public void Add(double time, ControlPoint newPoint, bool force = false)
|
public void Add(double time, ControlPoint newPoint, bool force = false)
|
||||||
{
|
{
|
||||||
if (!force && SimilarPointAt(time, newPoint)?.EquivalentTo(newPoint) == true)
|
|
||||||
return;
|
|
||||||
|
|
||||||
GroupAt(time, true).Add(newPoint);
|
GroupAt(time, true).Add(newPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -374,14 +374,12 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
|
|
||||||
beatmap.ControlPointInfo.Add(time, controlPoint);
|
beatmap.ControlPointInfo.Add(time, controlPoint);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
beatmap.ControlPointInfo.Add(time, new DifficultyControlPoint
|
beatmap.ControlPointInfo.Add(time, new DifficultyControlPoint
|
||||||
{
|
{
|
||||||
SpeedMultiplier = speedMultiplier,
|
SpeedMultiplier = speedMultiplier,
|
||||||
AutoGenerated = false
|
AutoGenerated = timingChange
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
beatmap.ControlPointInfo.Add(time, new EffectControlPoint
|
beatmap.ControlPointInfo.Add(time, new EffectControlPoint
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user