make log readable

This commit is contained in:
Cat Flynn 2021-02-15 23:26:42 +00:00
parent 9eea5cd4d5
commit 28b8b860d1
1 changed files with 8 additions and 4 deletions

View File

@ -62,14 +62,18 @@ public static partial class DialogueDatabase
}
Debug.Log($":: importing dialogue");
var sb = new StringBuilder();
var sbFile = new StringBuilder();
var sbLog = new StringBuilder();
var lines = 0;
foreach (var row in values)
{
Debug.Log($"{row[0]} {row[1]}");
sb.AppendLine($"{row[0]},{row[1]},");
sbLog.AppendLine($"{row[0]} {row[1]}");
sbFile.AppendLine($"{row[0]},{row[1]},");
lines++;
}
Debug.Log($":: imported {lines} lines of dialogue\n{sbLog}");
File.WriteAllText(EDITOR_DialogueFile, sb.ToString());
File.WriteAllText(EDITOR_DialogueFile, sbFile.ToString());
if (!File.Exists(EDITOR_DialogueFile))
{
Debug.LogError($":: import failed: file doesn't exist: {EDITOR_DialogueFile}");