Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion GDWeave.Dumper/CodeGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,11 @@ private string GenerateToken(Token token, ref uint tabs) {
constantToken.Value is StringVariant stringVariant
&& stringVariant.GetValue() is string str
) {
return $"\"{str}\"";
// Prevent output of processed escape sequences
// (These are literal chars so it is insufficient to escape backslashes as a catch-all)
str = str.Replace("\n", "\\n");
str = str.Replace("\t", "\\t");
return '"' + str + '"';
} else if (constantToken.Value is BoolVariant boolVariant) {
// Lowercase to match GDScript
return (bool) boolVariant.GetValue() ? "true" : "false";
Expand Down
Loading