From 702197c639ef5239ecf56a2025586dc91291e8ec Mon Sep 17 00:00:00 2001 From: Emmanouil Papadeas <35376950+OverloadedOrama@users.noreply.github.com> Date: Wed, 28 Aug 2024 18:17:30 +0300 Subject: [PATCH] Fix issue where the '\n` escape character got inserted inside the palette name, causing it to fail to be saved --- src/Autoload/Palettes.gd | 4 ++-- src/Palette/Palette.gd | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Autoload/Palettes.gd b/src/Autoload/Palettes.gd index 236fde980..aee7ff6b2 100644 --- a/src/Autoload/Palettes.gd +++ b/src/Autoload/Palettes.gd @@ -463,9 +463,9 @@ func _import_gpl(path: String, text: String) -> Palette: comments += line.trim_prefix("#") + "\n" # Some programs output palette name in a comment for old format if line.begins_with("#Palette Name: "): - palette_name = line.replace("#Palette Name: ", "") + palette_name = line.replace("#Palette Name: ", "").strip_edges() elif line.begins_with("Name: "): - palette_name = line.replace("Name: ", "") + palette_name = line.replace("Name: ", "").strip_edges() elif line.begins_with("Columns: "): # The width of the palette. line = line.trim_prefix("Columns: ").strip_edges() diff --git a/src/Palette/Palette.gd b/src/Palette/Palette.gd index 5d4a969d7..80c97880c 100644 --- a/src/Palette/Palette.gd +++ b/src/Palette/Palette.gd @@ -7,7 +7,9 @@ const DEFAULT_WIDTH := 8 const DEFAULT_HEIGHT := 8 # Metadata -var name := "Custom Palette" +var name := "Custom Palette": + set(value): + name = value.strip_edges() var comment := "" var path := ""