diff --git a/GameData/ConformalDecals/Plugins/ConformalDecals.dll b/GameData/ConformalDecals/Plugins/ConformalDecals.dll
index 902be6d..e36bb22 100644
Binary files a/GameData/ConformalDecals/Plugins/ConformalDecals.dll and b/GameData/ConformalDecals/Plugins/ConformalDecals.dll differ
diff --git a/Source/ConformalDecals/ConformalDecals.csproj b/Source/ConformalDecals/ConformalDecals.csproj
index 8ab7fce..9501b09 100644
--- a/Source/ConformalDecals/ConformalDecals.csproj
+++ b/Source/ConformalDecals/ConformalDecals.csproj
@@ -91,6 +91,7 @@
+
diff --git a/Source/ConformalDecals/ModuleConformalText.cs b/Source/ConformalDecals/ModuleConformalText.cs
index bc282e4..501a1a4 100644
--- a/Source/ConformalDecals/ModuleConformalText.cs
+++ b/Source/ConformalDecals/ModuleConformalText.cs
@@ -99,6 +99,7 @@ namespace ConformalDecals {
public override void OnLoad(ConfigNode node) {
base.OnLoad(node);
OnAfterDeserialize();
+ text = TextEncoder.Decode(text);
if (HighLogic.LoadedSceneIsGame) {
// For some reason, rendering doesnt work right on the first frame a scene is loaded
@@ -112,6 +113,7 @@ namespace ConformalDecals {
}
public override void OnSave(ConfigNode node) {
+ text = TextEncoder.Encode(text);
OnBeforeSerialize();
base.OnSave(node);
}
diff --git a/Source/ConformalDecals/Text/TextEncoder.cs b/Source/ConformalDecals/Text/TextEncoder.cs
new file mode 100644
index 0000000..d804baa
--- /dev/null
+++ b/Source/ConformalDecals/Text/TextEncoder.cs
@@ -0,0 +1,31 @@
+using System.Collections.Generic;
+using System.Text;
+
+namespace ConformalDecals.Text {
+ public static class TextEncoder {
+ private static readonly Dictionary _escapeSequences = new Dictionary() {
+ {"\n", "\\n"},
+ {"\\", "\\\\"},
+ {"/", "\\/"},
+ {"=", "\\="}
+ };
+
+ public static string Encode(string input) {
+ var builder = new StringBuilder(input);
+ foreach (var escapePair in _escapeSequences) {
+ builder.Replace(escapePair.Key, escapePair.Value);
+ }
+
+ return builder.ToString();
+ }
+
+ public static string Decode(string input) {
+ var builder = new StringBuilder(input);
+ foreach (var escapePair in _escapeSequences) {
+ builder.Replace(escapePair.Value, escapePair.Key);
+ }
+
+ return builder.ToString();
+ }
+ }
+}
\ No newline at end of file
diff --git a/Source/ConformalDecals/Text/TextRenderer.cs b/Source/ConformalDecals/Text/TextRenderer.cs
index 8915905..4eefd64 100644
--- a/Source/ConformalDecals/Text/TextRenderer.cs
+++ b/Source/ConformalDecals/Text/TextRenderer.cs
@@ -280,25 +280,13 @@ namespace ConformalDecals.Text {
RenderTexture.ReleaseTemporary(renderTex);
// CLEAR SUBMESHES
+ _tmp.text = "";
+
for (int i = 0; i < transform.childCount; i++) {
var child = transform.GetChild(i);
- var renderer = child.GetComponent();
- var filter = child.GetComponent();
- if (filter == null || renderer == null) {
- Logging.Log("TMP Sub object has no filter or renderer, destroying");
- Destroy(child.gameObject);
- }
-
- if (filter.mesh.vertexCount < 3) {
- Logging.Log("TMP Sub object has no mesh, destroying");
- Destroy(child.gameObject);
- }
-
- renderer.enabled = false;
+ Destroy(child.gameObject);
}
- _tmp.ClearMesh(true);
-
return new TextRenderOutput(texture, window);
}
}