From 70e1d4144c493fe1a46fe38ee85a188831bde384 Mon Sep 17 00:00:00 2001 From: Sokomine Date: Sat, 9 Mar 2024 19:32:29 +0100 Subject: [PATCH] added more checks for dialog names --- editor/edit_mode_apply_changes.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/editor/edit_mode_apply_changes.lua b/editor/edit_mode_apply_changes.lua index 79a706a..0a2d1be 100644 --- a/editor/edit_mode_apply_changes.lua +++ b/editor/edit_mode_apply_changes.lua @@ -171,6 +171,12 @@ yl_speak_up.edit_mode_apply_changes = function(pname, fields) if(dialog.n_dialogs[fields.d_name]) then err_msg = "Sorry. There is already a dialog with a dialog id of ".. tostring(fields.d_name).."." + elseif(yl_speak_up.is_special_dialog(fields.d_name)) then + err_msg = "Sorry. That is a special dialog ID. You cannot use it as ".. + "a manually set name." + elseif(string.sub(fields.d_name, 1, 2) == "d_") then + err_msg = "Sorry. Names starting with \"d_\" are not allowed. They ".. + "may later be needed for new dialogs." end -- TODO: check if the name is allowed (only normal chars, numbers and underscore) if(err_msg) then