From b04c82aa32204d4c14222f07c1753baa0d2fa3fa Mon Sep 17 00:00:00 2001 From: SuperSonic16 <25761885+thesupersonic16@users.noreply.github.com> Date: Sun, 29 Sep 2024 05:42:49 +1000 Subject: [PATCH] Added import and export for TableEditor --- .../DALLib/ImportExport/TranslationCSVFile.cs | 8 ++ .../DALLib/ImportExport/TranslationTSVFile.cs | 8 ++ DALTools/TableEditor/MainWindow.xaml | 2 + DALTools/TableEditor/MainWindow.xaml.cs | 101 +++++++++++++++++- 4 files changed, 114 insertions(+), 5 deletions(-) diff --git a/DALTools/DALLib/ImportExport/TranslationCSVFile.cs b/DALTools/DALLib/ImportExport/TranslationCSVFile.cs index ffb213a..86d9567 100644 --- a/DALTools/DALLib/ImportExport/TranslationCSVFile.cs +++ b/DALTools/DALLib/ImportExport/TranslationCSVFile.cs @@ -25,6 +25,14 @@ public class TranslationCSVFile : TranslationBase public override string TypeExtension => ".csv"; + public TranslationCSVFile() { } + + public TranslationCSVFile(string text) : this() + { + _buffer = text; + _bufferIndex = 0; + } + public override TranslationLine[] ImportTranslation(string data) { var lines = new List(); diff --git a/DALTools/DALLib/ImportExport/TranslationTSVFile.cs b/DALTools/DALLib/ImportExport/TranslationTSVFile.cs index 1b2106c..708b58f 100644 --- a/DALTools/DALLib/ImportExport/TranslationTSVFile.cs +++ b/DALTools/DALLib/ImportExport/TranslationTSVFile.cs @@ -25,6 +25,14 @@ public class TranslationTSVFile : TranslationBase public override string TypeExtension => ".tsv"; + public TranslationTSVFile() { } + + public TranslationTSVFile(string text) : this() + { + _buffer = text; + _bufferIndex = 0; + } + public override TranslationLine[] ImportTranslation(string data) { var lines = new List(); diff --git a/DALTools/TableEditor/MainWindow.xaml b/DALTools/TableEditor/MainWindow.xaml index 35cb283..fed1f02 100644 --- a/DALTools/TableEditor/MainWindow.xaml +++ b/DALTools/TableEditor/MainWindow.xaml @@ -21,6 +21,8 @@