diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2018-03-13 08:17:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-13 08:17:03 +0100 |
commit | ded94af48b2b3908af6522088723b6665a0e5c16 (patch) | |
tree | 1a6844f9684fbeac9ea866437a1503ba08d90954 | |
parent | 3bca3b071d04fdb4167f6f79bb6fe5b620593553 (diff) | |
parent | ea94a8259624a1915fa4b92682755e28f2bb6af5 (diff) |
Merge pull request #17474 from robfram/fix-input-map-spaces-17322
Fix non working action names containing whitespaces
-rw-r--r-- | core/project_settings.cpp | 5 | ||||
-rw-r--r-- | editor/project_settings_editor.cpp | 8 |
2 files changed, 8 insertions, 5 deletions
diff --git a/core/project_settings.cpp b/core/project_settings.cpp index 427fa77e62..3eb8ad7bf5 100644 --- a/core/project_settings.cpp +++ b/core/project_settings.cpp @@ -692,7 +692,10 @@ Error ProjectSettings::_save_settings_text(const String &p_file, const Map<Strin String vstr; VariantWriter::write_to_string(value, vstr); - file->store_string(F->get() + "=" + vstr + "\n"); + if (F->get().find(" ") != -1) + file->store_string(F->get().quote() + "=" + vstr + "\n"); + else + file->store_string(F->get() + "=" + vstr + "\n"); } } diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index 9625bc19c0..096d9c1a90 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -137,12 +137,12 @@ void ProjectSettingsEditor::_action_edited() { if (new_name == old_name) return; - if (new_name.find("/") != -1 || new_name.find(":") != -1 || new_name == "") { + if (new_name.find("/") != -1 || new_name.find(":") != -1 || new_name.find("\"") != -1 || new_name == "") { ti->set_text(0, old_name); add_at = "input/" + old_name; - message->set_text(TTR("Invalid action (anything goes but '/' or ':').")); + message->set_text(TTR("Invalid action (anything goes but '/', ':' or '\"').")); message->popup_centered(Size2(300, 100) * EDSCALE); return; } @@ -830,9 +830,9 @@ void ProjectSettingsEditor::_action_check(String p_action) { action_add->set_disabled(true); } else { - if (p_action.find("/") != -1 || p_action.find(":") != -1) { + if (p_action.find("/") != -1 || p_action.find(":") != -1 || p_action.find("\"") != -1) { - action_add_error->set_text(TTR("Can't contain '/' or ':'")); + action_add_error->set_text(TTR("Can't contain '/', ':' or '\"'")); action_add_error->show(); action_add->set_disabled(true); return; |