Skip to content

Commit 0253a12

Browse files
committed
[F] MA2Parser 星星时长不分段,Touch C触摸区
1 parent ee33185 commit 0253a12

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

chart/Note.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ public class Touch(Chart chart, Rational time) : Note(chart, time)
6666

6767
public string TouchArea
6868
{
69-
get => _touchSeries.ToString() + Key;
70-
set
69+
get => _touchSeries.ToString() + (Key == 0 ? "" : Key);
70+
set
7171
{
7272
if (value == "C") // 只有一个C字母的情况
7373
{

generator/MA2Generator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ private void AddTap(Tap tap, int bar, int tick)
197197
lines = lines.OrderBy(x => x.Bar * RSL + x.Tick).ToList();
198198
foreach (var l in lines)
199199
{
200-
var extra = string.IsNullOrEmpty(l.Extra) ? "\t" + l.Extra : "";
200+
var extra = !string.IsNullOrEmpty(l.Extra) ? "\t" + l.Extra : "";
201201
result.AppendLine($"{l.Name}\t{l.Bar}\t{l.Tick}\t{l.Key}{extra}");
202202
}
203203
result.AppendLine();

parser/MA2Parser.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,11 @@ void pair()
237237
else if (note.Time < now) throw Utils.Fail("时间倒流,说明Chart.Sort写错了");
238238

239239
if (note is Tap tap and not Hold) taps[tap.Key - 1] ??= tap; // 只有在数组中原本为空的情况下才set。不然不set。这是因为万一有人写宴谱,在同一时刻同一键位上塞了大于一个tap(这显然是无理)怎么办(x)
240-
else if (note is Slide slide) slideLists[slide.Key - 1].Add(slide);
240+
else if (note is Slide slide)
241+
{
242+
slide.Duration = slide.Duration; // 确保只有最后一段有时间
243+
slideLists[slide.Key - 1].Add(slide);
244+
}
241245
}
242246
pair(); // 最后一个时刻
243247
chart.Notes.RemoveAll(x => toRemove.Contains(x)); // 移除所有的toRemove

0 commit comments

Comments
 (0)