Fixed Audio Editor LOC support

This commit is contained in:
MattNL
2022-08-02 18:56:22 -04:00
parent 58be77a1b8
commit e0a439fbf3
2 changed files with 12 additions and 11 deletions

View File

@@ -443,14 +443,14 @@ namespace PckStudio.Forms.Utilities
int creditCount = 1;
while ((line = reader.ReadLine()) != null)
{
ValueTuple<string, string> credit_entry = new ValueTuple<string, string>("CREDIT", line);
audioPCK.Files[0].properties.Add(credit_entry);
//string credit_id = "IDS_CREDIT" + (creditCount != 1 ? creditCount.ToString() : "");
//ValueTuple<string, string> creditid_entry = new ValueTuple<string, string>("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())

View File

@@ -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)