Fix BestdoriChartConverter generating track motions incorrectly. Add outro time to BestdoriChartConverter.

This commit is contained in:
2022-12-01 12:34:56 +08:00
parent 35d2e06625
commit 69e4ecd0a9

View File

@@ -76,13 +76,17 @@ namespace Cryville.Crtr.Extensions.Bestdori {
}; };
for (int i = 0; i < tev.connections.Count; i++) { for (int i = 0; i < tev.connections.Count; i++) {
BestdoriChartEvent.Connection c = tev.connections[i]; BestdoriChartEvent.Connection c = tev.connections[i];
note.motions.Add(new Chart.Motion { motion = "track:" + c.lane.ToString(CultureInfo.InvariantCulture) }); if (i == 0) {
if (i == 0)
note.judges.Add(new Chart.Judge { name = "single" }); note.judges.Add(new Chart.Judge { name = "single" });
else if (i == tev.connections.Count - 1) note.motions.Add(new Chart.Motion { motion = "track:" + c.lane.ToString(CultureInfo.InvariantCulture) });
note.judges.Add(new Chart.Judge { time = ToBeatTime(c.beat), name = c.flick ? "longend_flick" : "longend" }); }
else if (!c.hidden) else {
note.judges.Add(new Chart.Judge { time = ToBeatTime(c.beat), name = "longnode" }); note.motions.Add(new Chart.Motion { time = ToBeatTime(tev.connections[i - 1].beat), endtime = ToBeatTime(c.beat), motion = "track:" + c.lane.ToString(CultureInfo.InvariantCulture) });
if (i == tev.connections.Count - 1)
note.judges.Add(new Chart.Judge { time = ToBeatTime(c.beat), name = c.flick ? "longend_flick" : "longend" });
else if (!c.hidden)
note.judges.Add(new Chart.Judge { time = ToBeatTime(c.beat), name = "longnode" });
}
} }
if (c1.beat > endbeat) endbeat = c1.beat; if (c1.beat > endbeat) endbeat = c1.beat;
group.notes.Add(note); group.notes.Add(note);
@@ -90,7 +94,7 @@ namespace Cryville.Crtr.Extensions.Bestdori {
else throw new NotImplementedException("Unsupported event: " + ev.type); else throw new NotImplementedException("Unsupported event: " + ev.type);
} }
if (bgm == null) throw new FormatException("Chart contains no song"); if (bgm == null) throw new FormatException("Chart contains no song");
chart.endtime = ToBeatTime(endbeat); chart.endtime = ToBeatTime(endbeat + 4);
result.Add(new RawChartResource(string.Format("bang_dream_girls_band_party__{0}__{1}", bgm, StringUtils.TrimExt(file.Name)), chart, new ChartMeta { result.Add(new RawChartResource(string.Format("bang_dream_girls_band_party__{0}__{1}", bgm, StringUtils.TrimExt(file.Name)), chart, new ChartMeta {
name = string.Format("Bandori {0} {1}", bgm, StringUtils.TrimExt(file.Name)), name = string.Format("Bandori {0} {1}", bgm, StringUtils.TrimExt(file.Name)),
author = "©BanG Dream! Project ©Craft Egg Inc. ©bushiroad", author = "©BanG Dream! Project ©Craft Egg Inc. ©bushiroad",