From 8f3d6891b92e5ce9143bea4d7ecce540070e036f Mon Sep 17 00:00:00 2001 From: B-DeshiDev Date: Thu, 1 Aug 2024 12:51:09 +0600 Subject: [PATCH] Remove key from speaker export --- .../Editor/DialogueGraphExportWindow.cs | 39 +++++-------------- .../package.json | 2 +- 2 files changed, 10 insertions(+), 31 deletions(-) diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/Editor/DialogueGraphExportWindow.cs b/Assets/Packages/com.studio23.ss2.dialoguesystem/Editor/DialogueGraphExportWindow.cs index c63485d..254e627 100644 --- a/Assets/Packages/com.studio23.ss2.dialoguesystem/Editor/DialogueGraphExportWindow.cs +++ b/Assets/Packages/com.studio23.ss2.dialoguesystem/Editor/DialogueGraphExportWindow.cs @@ -178,14 +178,19 @@ private static void ExportStringTable(DialogueGraph graph, string path, List + /// #TODO temporary measure till I figure out columnmapping + /// + /// + /// public void ExportSpeakerData(List dialogueLinesInOrder, string path) { // StringBuilder to construct the CSV content StringBuilder csvContent = new StringBuilder(); // Append the header - csvContent.AppendLine("Key,Id,Speaker, Expression"); + csvContent.AppendLine("Id,Speaker, Expression"); // Append each dialogue line foreach (var line in dialogueLinesInOrder) @@ -195,11 +200,11 @@ public void ExportSpeakerData(List dialogueLinesInOrder, s { if (line.SpeakerData.Character != null) { - csvContent.AppendLine($"{entry.Key},{entry.Id},{line.SpeakerData.Character.CharacterName}, {line.SpeakerData.Expression}"); + csvContent.AppendLine($"{entry.Id},{line.SpeakerData.Character.CharacterName}, {line.SpeakerData.Expression.name}"); } else { - csvContent.AppendLine($"{entry.Key},{entry.Id},,"); + csvContent.AppendLine($"{entry.Id},,"); } } } @@ -301,32 +306,6 @@ public static void ExportStringTable(TextWriter writer, StringTableCollection co } } - private static void WriteCSV(List dialogueLines, string path) - { - StringBuilder csvContent = new StringBuilder(); - - // Append the header - csvContent.AppendLine("Key,Id,English(en),Japanese(ja),Russian(ru),Spanish(es),Bangla(bn)"); - - // Append each dialogue line - foreach (var line in dialogueLines) - { - var entry = GetTableEntry(line); - if (entry == null) - { - Debug.LogError($"entry null for {line}", line); - } - else - { - csvContent.AppendLine($"{entry.Key},{entry.Id},{line.DialogueLocalizedString.GetLocalizedStringInEditor()},,,,"); - } - // csvContent.AppendLine($"{line.DialogueLocalizedString.Keys},{line.Key},{line.English},{line.Japanese},{line.Russian},{line.Spanish},{line.Bangla}"); - } - - // Write the content to the file - File.WriteAllText(path, csvContent.ToString()); - } - public void HandleDialogueLineNodeTraversed(DialogueLineNodeBase node) { traversedLinesCache.Add(node); diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/package.json b/Assets/Packages/com.studio23.ss2.dialoguesystem/package.json index 22dff37..1387c58 100644 --- a/Assets/Packages/com.studio23.ss2.dialoguesystem/package.json +++ b/Assets/Packages/com.studio23.ss2.dialoguesystem/package.json @@ -1,6 +1,6 @@ { "name": "com.studio23.ss2.dialoguesystem", - "version": "0.4.21", + "version": "0.4.22", "displayName": "Dialogue System", "description": "Dialogue system is an authoring tool for developers to integrate dialogue from scriptwriters inside unity.", "unity": "2022.3",