Make long motion events standalone to avoid transition overflow.
This commit is contained in:
@@ -9,6 +9,12 @@ using System.Linq;
|
|||||||
using UnsafeIL;
|
using UnsafeIL;
|
||||||
|
|
||||||
namespace Cryville.Crtr {
|
namespace Cryville.Crtr {
|
||||||
|
[Flags]
|
||||||
|
public enum CoeventMode {
|
||||||
|
None = 0x0,
|
||||||
|
Coevent = 0x1,
|
||||||
|
Standalone = 0x2,
|
||||||
|
}
|
||||||
public abstract class ChartEvent {
|
public abstract class ChartEvent {
|
||||||
public BeatTime? time;
|
public BeatTime? time;
|
||||||
|
|
||||||
@@ -36,7 +42,7 @@ namespace Cryville.Crtr {
|
|||||||
public abstract int Priority { get; }
|
public abstract int Priority { get; }
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public virtual bool Standalone { get { return false; } }
|
public virtual CoeventMode CoeventMode { get { return CoeventMode.Coevent; } }
|
||||||
|
|
||||||
public ChartEvent Clone() {
|
public ChartEvent Clone() {
|
||||||
return (ChartEvent)MemberwiseClone();
|
return (ChartEvent)MemberwiseClone();
|
||||||
@@ -279,6 +285,7 @@ namespace Cryville.Crtr {
|
|||||||
public float sumfix = 0.0f;
|
public float sumfix = 0.0f;
|
||||||
|
|
||||||
public override int Priority { get { return 0x1000; } }
|
public override int Priority { get { return 0x1000; } }
|
||||||
|
public override CoeventMode CoeventMode { get { return IsLong ? CoeventMode.Standalone : CoeventMode.Coevent; } }
|
||||||
|
|
||||||
public Motion() {
|
public Motion() {
|
||||||
SubmitPropOp("motion", new PropOp.String(v => motion = v)); // TODO Obsolete
|
SubmitPropOp("motion", new PropOp.String(v => motion = v)); // TODO Obsolete
|
||||||
@@ -327,7 +334,7 @@ namespace Cryville.Crtr {
|
|||||||
#pragma warning restore IDE1006
|
#pragma warning restore IDE1006
|
||||||
|
|
||||||
public override int Priority { get { return 0; } }
|
public override int Priority { get { return 0; } }
|
||||||
public override bool Standalone { get { return true; } }
|
public override CoeventMode CoeventMode { get { return CoeventMode.Standalone; } }
|
||||||
|
|
||||||
public Judge() {
|
public Judge() {
|
||||||
SubmitPropSrc("name", new PropSrc.Identifier(() => Id.Key));
|
SubmitPropSrc("name", new PropSrc.Identifier(() => Id.Key));
|
||||||
|
|||||||
@@ -48,10 +48,9 @@ namespace Cryville.Crtr.Event {
|
|||||||
}
|
}
|
||||||
foreach (var ev in c.Events) {
|
foreach (var ev in c.Events) {
|
||||||
if (ev.time == null) {
|
if (ev.time == null) {
|
||||||
if (!ev.Standalone) coevents.Add(ev);
|
|
||||||
ev.time = c.time;
|
ev.time = c.time;
|
||||||
if (ev is EventContainer)
|
if (ev is EventContainer) ev.endtime = c.endtime;
|
||||||
ev.endtime = c.endtime;
|
if ((ev.CoeventMode & CoeventMode.Coevent) != 0) coevents.Add(ev);
|
||||||
}
|
}
|
||||||
if (ev.IsLong) {
|
if (ev.IsLong) {
|
||||||
Events.Add(ev.ReleaseEvent);
|
Events.Add(ev.ReleaseEvent);
|
||||||
@@ -119,6 +118,9 @@ namespace Cryville.Crtr.Event {
|
|||||||
coeventMap.Add(con, cevs = new List<StampedEvent>());
|
coeventMap.Add(con, cevs = new List<StampedEvent>());
|
||||||
}
|
}
|
||||||
cevs.Add(sev);
|
cevs.Add(sev);
|
||||||
|
if ((ev.CoeventMode & CoeventMode.Standalone) != 0) {
|
||||||
|
stampedEvents.Add(sev);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else stampedEvents.Add(sev);
|
else stampedEvents.Add(sev);
|
||||||
map.Add(ev, sev);
|
map.Add(ev, sev);
|
||||||
|
|||||||
Reference in New Issue
Block a user