From ee14ffab6e7c950536c3fdef1223dcb902aace39 Mon Sep 17 00:00:00 2001 From: End User <40090446+End-User-Person@users.noreply.github.com> Date: Sat, 30 Nov 2024 15:25:40 -0800 Subject: [PATCH] SplitMDL: Temporary fix for an issue that causes SA2 project creation to fail. Cannot test if it works via manual building so it's a shot in the dark. --- Libraries/SplitTools/SplitMDL.cs | 39 ++++++++++++++++---------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/Libraries/SplitTools/SplitMDL.cs b/Libraries/SplitTools/SplitMDL.cs index 1ecd0f71..363c2f1c 100644 --- a/Libraries/SplitTools/SplitMDL.cs +++ b/Libraries/SplitTools/SplitMDL.cs @@ -65,7 +65,7 @@ public static void Split(string filePath, string outputFolder, string[] animatio { mdlsplitfilenames = IniSerializer.Deserialize>(mdllabelfile); } - string[] mdlmetadata = new string[0]; + string[] mdlmetadata = []; // mtn labels Dictionary mtnsectionlist = new Dictionary(); @@ -85,7 +85,7 @@ public static void Split(string filePath, string outputFolder, string[] animatio { mtnsplitpaths = IniSerializer.Deserialize>(exmtnfile); } - string[] exmtndata = new string[0]; + string[] exmtndata = []; // getting model pointers int address = 0; @@ -129,18 +129,19 @@ public static void Split(string filePath, string outputFolder, string[] animatio i = ByteConverter.ToInt16(anifile, address); while (i != -1) { - if (mtnlabelfile != null) - { - mtnmetadata = mtnsplitfilenames[i].Split('|'); // Filename|Description - string outFilename = mtnmetadata[0]; - if (!mtnmetadata[0].StartsWith("NO FILE")) - { - animmeta = mtnmetadata[1]; - mtnsectionlist[i] = outFilename + "|" + animmeta; - } - else - mtnsectionlist[i] = "NULL"; - } + // This doesn't work as of November 2024. Reimplement when fixed. + //if (mtnlabelfile != null) + //{ + // mtnmetadata = mtnsplitfilenames[i].Split('|'); // Filename|Description + // string outFilename = mtnmetadata[0]; + // if (!mtnmetadata[0].StartsWith("NO FILE")) + // { + // animmeta = mtnmetadata[1]; + // mtnsectionlist[i] = outFilename + "|" + animmeta; + // } + // else + // mtnsectionlist[i] = "NULL"; + //} int aniaddr = ByteConverter.ToInt32(anifile, address + 4); if (!processedanims.ContainsKey(aniaddr)) { @@ -203,11 +204,11 @@ public static void Split(string filePath, string outputFolder, string[] animatio IniSerializer.Serialize(mdlsectionlist, Path.Combine(outputFolder, mdlsectionListFilename)); } - if (mtnlabelfile != null) - { - string mtnsectionListFilename = Path.GetFileNameWithoutExtension(mtnlabelfile) + "_data.ini"; - IniSerializer.Serialize(mtnsectionlist, Path.Combine(outputFolder, mtnsectionListFilename)); - } + //if (mtnlabelfile != null) + //{ + // string mtnsectionListFilename = Path.GetFileNameWithoutExtension(mtnlabelfile) + "_data.ini"; + // IniSerializer.Serialize(mtnsectionlist, Path.Combine(outputFolder, mtnsectionListFilename)); + //} // save ini file IniSerializer.Serialize(new MDLInfo() { BigEndian = ByteConverter.BigEndian, Indexes = modelnames },