From ff3c80a572109158ddb63d83778f21b35fd3d6f6 Mon Sep 17 00:00:00 2001 From: NotImplementedLife Date: Mon, 17 Jul 2023 13:35:25 +0300 Subject: [PATCH] fixes --- MainForm.cs | 19 +++++++++++++++---- TJA.cs | 2 +- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/MainForm.cs b/MainForm.cs index bc8b40b..f4634ce 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -349,16 +349,27 @@ namespace TaikoSoundEditor private void ExportDatatable(string path) { var mi = new MusicInfos(); - mi.Items.AddRange(MusicInfos.Items); - mi.Items.AddRange(AddedMusic.Select(_ => _.MusicInfo)); + mi.Items.AddRange(MusicInfos.Items); var ma = new MusicAttributes(); ma.Items.AddRange(MusicAttributes.Items); ma.Items.AddRange(AddedMusic.Select(_ => _.MusicAttribute)); var mo = new MusicOrders(); - mo.Items.AddRange(MusicOrders.Items); - mo.Items.AddRange(AddedMusic.Select(_ => _.MusicOrder)); + + var mbyg = MusicOrders.Items.GroupBy(_ => _.GenreNo).Select(_ => (_.Key, List: _.ToList())).ToDictionary(_ => _.Key, _ => _.List); + + foreach (var m in AddedMusic.Select(_ => _.MusicOrder)) + { + if (!mbyg.ContainsKey(m.GenreNo)) + mbyg[m.GenreNo] = new List(); + mbyg[m.GenreNo] = mbyg[m.GenreNo].Prepend(m).ToList(); + } + + foreach(var key in mbyg.Keys.OrderBy(_=>_)) + { + mo.Items.AddRange(mbyg[key]); + } var wl = new WordList(); wl.Items.AddRange(WordList.Items); diff --git a/TJA.cs b/TJA.cs index 8bb3b40..2e82da7 100644 --- a/TJA.cs +++ b/TJA.cs @@ -278,7 +278,7 @@ namespace TaikoSoundEditor if (parsed.Name == "TITLEJA") headers.TitleJa = parsed.Value; if (parsed.Name == "SUBTITLE") - headers.Subtitle = parsed.Value; + headers.Subtitle = parsed.Value.StartsWith("--") ? parsed.Value.Substring(2) : parsed.Value; if (parsed.Name == "BPM") headers.Bpm = float.Parse(parsed.Value); if (parsed.Name == "WAVE")