diff --git a/Json.cs b/Json.cs index b52b299..5362582 100644 --- a/Json.cs +++ b/Json.cs @@ -13,13 +13,14 @@ namespace TaikoSoundEditor return JsonSerializer.Deserialize(json); } - public static string Serialize(T item) + + public static string Serialize(T item, bool indented = true) { Logger.Info($"Serializing {typeof(T)}:\n{item}"); return JsonSerializer.Serialize(item, new JsonSerializerOptions { Encoder = JavaScriptEncoder.Create(UnicodeRanges.All), - WriteIndented = true + WriteIndented = indented }); } diff --git a/MainForm.Designer.cs b/MainForm.Designer.cs index 961f9c2..e0d7649 100644 --- a/MainForm.Designer.cs +++ b/MainForm.Designer.cs @@ -45,6 +45,7 @@ this.MusicAttributePathSelector = new TaikoSoundEditor.PathSelector(); this.label8 = new System.Windows.Forms.Label(); this.tabPage2 = new System.Windows.Forms.TabPage(); + this.DatatableSpaces = new System.Windows.Forms.CheckBox(); this.ExportOpenOnFinished = new System.Windows.Forms.CheckBox(); this.ExportAllButton = new System.Windows.Forms.Button(); this.ExportSoundBanksButton = new System.Windows.Forms.Button(); @@ -299,6 +300,7 @@ // // tabPage2 // + this.tabPage2.Controls.Add(this.DatatableSpaces); this.tabPage2.Controls.Add(this.ExportOpenOnFinished); this.tabPage2.Controls.Add(this.ExportAllButton); this.tabPage2.Controls.Add(this.ExportSoundBanksButton); @@ -316,11 +318,24 @@ this.tabPage2.Text = "tabPage2"; this.tabPage2.UseVisualStyleBackColor = true; // + // DatatableSpaces + // + this.DatatableSpaces.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.DatatableSpaces.AutoSize = true; + this.DatatableSpaces.Checked = true; + this.DatatableSpaces.CheckState = System.Windows.Forms.CheckState.Checked; + this.DatatableSpaces.Location = new System.Drawing.Point(139, 372); + this.DatatableSpaces.Name = "DatatableSpaces"; + this.DatatableSpaces.Size = new System.Drawing.Size(308, 19); + this.DatatableSpaces.TabIndex = 11; + this.DatatableSpaces.Text = "Remove spaces in datatable files (musicinfo, wordlist)"; + this.DatatableSpaces.UseVisualStyleBackColor = true; + // // ExportOpenOnFinished // - this.ExportOpenOnFinished.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.ExportOpenOnFinished.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.ExportOpenOnFinished.AutoSize = true; - this.ExportOpenOnFinished.Location = new System.Drawing.Point(318, 425); + this.ExportOpenOnFinished.Location = new System.Drawing.Point(139, 395); this.ExportOpenOnFinished.Name = "ExportOpenOnFinished"; this.ExportOpenOnFinished.Size = new System.Drawing.Size(203, 19); this.ExportOpenOnFinished.TabIndex = 10; @@ -851,5 +866,6 @@ private Button ExportDatatableButton; private CheckBox ExportOpenOnFinished; private CheckBox AddSilenceBox; + private CheckBox DatatableSpaces; } } \ No newline at end of file diff --git a/MainForm.cs b/MainForm.cs index f55364b..e1c933d 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -470,10 +470,10 @@ namespace TaikoSoundEditor wl.Items.AddRange(WordList.Items); wl.Items.AddRange(AddedMusic.Select(_ => new List() { _.Word, _.WordSub, _.WordDetail }).SelectMany(_ => _)); - var jmi = JsonFix(Json.Serialize(mi)); + var jmi = JsonFix(Json.Serialize(mi, !DatatableSpaces.Checked)); var jma = JsonFix(Json.Serialize(ma)); var jmo = JsonFix(Json.Serialize(mo)); - var jwl = JsonFix(Json.Serialize(wl)); + var jwl = JsonFix(Json.Serialize(wl, !DatatableSpaces.Checked)); jma = jma.Replace("\"new\": true,", "\"new\":true,"); jma = jma.Replace("\"new\": false,", "\"new\":false,"); @@ -624,5 +624,6 @@ namespace TaikoSoundEditor if (name.Length == 6) SongNameBox.Text = name; } + } } \ No newline at end of file