From 2a2d603891d8598bfadc6f9d4f18e49b33a90f38 Mon Sep 17 00:00:00 2001 From: VioletXF Date: Thu, 17 Aug 2023 07:20:49 +0900 Subject: [PATCH] Fix loops & start points --- Assets/Scripts/BMSParser.cs | 10 +++++++++- Assets/Scripts/RhythmControl.cs | 8 ++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Assets/Scripts/BMSParser.cs b/Assets/Scripts/BMSParser.cs index 26814f5..b246bbc 100644 --- a/Assets/Scripts/BMSParser.cs +++ b/Assets/Scripts/BMSParser.cs @@ -248,7 +248,15 @@ public void Parse(string path, bool addReadyMeasure = false, bool metaOnly = fal for (var j = 0; j < dataCount; ++j) { var val = data.Substring(j * 2, 2); - if (val == "00") continue; + if (val == "00") + { + if (i == 0 && timelines.Count == 0) + { + timelines.Add(0, new TimeLine(TempKey)); // add ghost timeline to make sure the game gets correct start time + } + + continue; + } var g = Gcd(j, dataCount); // ReSharper disable PossibleLossOfFraction diff --git a/Assets/Scripts/RhythmControl.cs b/Assets/Scripts/RhythmControl.cs index e8554d6..84e889a 100644 --- a/Assets/Scripts/RhythmControl.cs +++ b/Assets/Scripts/RhythmControl.cs @@ -38,9 +38,9 @@ class GameState public GameState(Chart chart, bool addReadyMeasure) { Judge = new Judge(chart.ChartMeta.Rank); - if(addReadyMeasure) - if(chart.Measures.Count > 1) - firstTiming = chart.Measures[1].Timelines[0].Timing; + // if(addReadyMeasure) + // if(chart.Measures.Count > 1) + // firstTiming = chart.Measures[1].Timelines[0].Timing; } @@ -591,7 +591,7 @@ private async void LoadGame() var (sound, bgainfo) = ((Sound sound, (int id, string path) bgainfo))tasks[i].Result; wavSounds[i] = sound; // To prevent concurrent modification, we should wait for all tasks to complete before assigning wavSounds. - + wavSounds[i].setLoopCount(0); if (bgainfo.id != -1) { bgas.Add(bgainfo); // Same as above.