From 9f32a4fefac543f4ce1ae4b60a707416d8cca6f2 Mon Sep 17 00:00:00 2001 From: MattNL Date: Fri, 2 Jun 2023 18:37:45 -0400 Subject: [PATCH] Added check for unknown tile names --- PCK-Studio/Forms/Editor/AnimationEditor.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/PCK-Studio/Forms/Editor/AnimationEditor.cs b/PCK-Studio/Forms/Editor/AnimationEditor.cs index 065e7ddc..5b7256bd 100644 --- a/PCK-Studio/Forms/Editor/AnimationEditor.cs +++ b/PCK-Studio/Forms/Editor/AnimationEditor.cs @@ -371,10 +371,23 @@ namespace PckStudio.Forms.Editor if (first is JProperty p) { tileLabel.Text = (string)p.Value; - break; + return; } } - } + + switch(MessageBox.Show(this, + $"{TileName} is not a valid tile for animation, and will not play in game. Would you like to choose a new tile?", + "Not a valid tile", + MessageBoxButtons.YesNo)) + { + case DialogResult.Yes: + changeTileToolStripMenuItem_Click(null, null); + break; + default: + DialogResult = DialogResult.Abort; + break; + } + } private void exportJavaAnimationToolStripMenuItem_Click(object sender, EventArgs e) {