From e0a439fbf31df8ad31d5a3f1f323586b9765d70f Mon Sep 17 00:00:00 2001 From: MattNL Date: Tue, 2 Aug 2022 18:56:22 -0400 Subject: [PATCH] Fixed Audio Editor LOC support --- .../Forms/Utilities/Audio/AudioEditor.cs | 16 ++++++++-------- MinecraftUSkinEditor/MainForm.cs | 7 ++++--- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/MinecraftUSkinEditor/Forms/Utilities/Audio/AudioEditor.cs b/MinecraftUSkinEditor/Forms/Utilities/Audio/AudioEditor.cs index 351d9c40..46295cc6 100644 --- a/MinecraftUSkinEditor/Forms/Utilities/Audio/AudioEditor.cs +++ b/MinecraftUSkinEditor/Forms/Utilities/Audio/AudioEditor.cs @@ -443,14 +443,14 @@ namespace PckStudio.Forms.Utilities int creditCount = 1; while ((line = reader.ReadLine()) != null) { - ValueTuple credit_entry = new ValueTuple("CREDIT", line); - audioPCK.Files[0].properties.Add(credit_entry); - //string credit_id = "IDS_CREDIT" + (creditCount != 1 ? creditCount.ToString() : ""); - //ValueTuple creditid_entry = new ValueTuple("CREDITID", credit_id); - //audioPCK.Files[0].properties.Add(creditid_entry); - //loc.AddLocKey(credit_id, line); - //creditCount++; - //Console.WriteLine(line); + var credit = ("CREDIT", line); + string credit_id = "IDS_CREDIT" + (creditCount > 1 ? creditCount.ToString() : ""); + var creditid = ("CREDITID", credit_id); + audioPCK.Files[0].properties.Add(credit); + audioPCK.Files[0].properties.Add(creditid); + loc.AddLocKey(credit_id, line); + creditCount++; + Console.WriteLine(line); } } using (var stream = new MemoryStream()) diff --git a/MinecraftUSkinEditor/MainForm.cs b/MinecraftUSkinEditor/MainForm.cs index 085a1ef6..fa23df94 100644 --- a/MinecraftUSkinEditor/MainForm.cs +++ b/MinecraftUSkinEditor/MainForm.cs @@ -511,7 +511,7 @@ namespace PckStudio throw new Exception("No .loc file found."); AudioEditor diag = new AudioEditor(locFile, LittleEndianCheckBox.Checked); diag.ShowDialog(this); - if (diag.saved) saved = false; + if (diag.saved) TrySetLocFile(locFile); diag.Dispose(); } @@ -593,7 +593,8 @@ namespace PckStudio throw new Exception("No .loc File found."); AudioEditor audioEditor = new AudioEditor(file, locFile, LittleEndianCheckBox.Checked); audioEditor.ShowDialog(this); - audioEditor.Dispose(); + if (audioEditor.saved) TrySetLocFile(locFile); + audioEditor.Dispose(); } catch (Exception ex) { @@ -2766,7 +2767,7 @@ namespace PckStudio throw new Exception("No .loc File found."); AudioEditor diag = new AudioEditor(file, locFile, LittleEndianCheckBox.Checked); diag.ShowDialog(this); - if (diag.saved) saved = false; + if (diag.saved) TrySetLocFile(locFile); diag.Dispose(); } catch (Exception ex)