From 50fe39183ec7772e5b94eb4c181d7c88e87ce192 Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Mon, 27 Mar 2023 18:24:18 +0200 Subject: [PATCH] Update LOCEditor and MainForm with LOCFileReader/Writer --- PCK-Studio/Forms/Editor/LOCEditor.cs | 3 ++- PCK-Studio/MainForm.cs | 6 ++++-- Vendor/OMI-Lib | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/PCK-Studio/Forms/Editor/LOCEditor.cs b/PCK-Studio/Forms/Editor/LOCEditor.cs index 82b317e3..464bbe09 100644 --- a/PCK-Studio/Forms/Editor/LOCEditor.cs +++ b/PCK-Studio/Forms/Editor/LOCEditor.cs @@ -143,7 +143,8 @@ namespace PckStudio.Forms.Editor { using (var ms = new MemoryStream()) { - LOCFileWriter.Write(ms, currentLoc); + var writer = new LOCFileWriter(currentLoc, 2); + writer.WriteToStream(ms); _file.SetData(ms.ToArray()); } DialogResult = DialogResult.OK; diff --git a/PCK-Studio/MainForm.cs b/PCK-Studio/MainForm.cs index 61e09012..6e708d47 100644 --- a/PCK-Studio/MainForm.cs +++ b/PCK-Studio/MainForm.cs @@ -1226,7 +1226,8 @@ namespace PckStudio var locFile = new LOCFile(); locFile.InitializeDefault(packName); using var stream = new MemoryStream(); - LOCFileWriter.Write(stream, locFile); + var writer = new LOCFileWriter(locFile, 2); + writer.WriteToStream(stream); return stream.ToArray(); }); @@ -1592,7 +1593,8 @@ namespace PckStudio { using (var stream = new MemoryStream()) { - LOCFileWriter.Write(stream, locFile); + var writer = new LOCFileWriter(locFile, 2); + writer.WriteToStream(stream); locdata.SetData(stream.ToArray()); } return true; diff --git a/Vendor/OMI-Lib b/Vendor/OMI-Lib index 77ae65c6..9b991f6d 160000 --- a/Vendor/OMI-Lib +++ b/Vendor/OMI-Lib @@ -1 +1 @@ -Subproject commit 77ae65c68dfb7612d9883094210c0d572f425705 +Subproject commit 9b991f6d1a3591b92693aaff8a39fbe68803f7db