From 0ce6ac0bbb6c5b0c23ee3df405a4b90794f8400e Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Fri, 3 Apr 2020 23:56:57 +0200 Subject: [PATCH] Warn about built-in script limitations in the script creation dialog This partially addresses #31758. (cherry picked from commit ac210e196c7775a4b8955ad74b77e9ff017cae36) --- editor/script_create_dialog.cpp | 9 +++++++++ editor/script_create_dialog.h | 1 + 2 files changed, 10 insertions(+) diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp index 032edf065c3..7df437fe017 100644 --- a/editor/script_create_dialog.cpp +++ b/editor/script_create_dialog.cpp @@ -687,6 +687,8 @@ void ScriptCreateDialog::_update_dialog() { // Is Script created or loaded from existing file? + builtin_warning_label->set_visible(is_built_in); + if (is_built_in) { get_ok()->set_text(TTR("Create")); parent_name->set_editable(true); @@ -765,6 +767,13 @@ ScriptCreateDialog::ScriptCreateDialog() { path_error_label = memnew(Label); vb->add_child(path_error_label); + builtin_warning_label = memnew(Label); + builtin_warning_label->set_text( + TTR("Note: Built-in scripts have some limitations and can't be edited using an external editor.")); + vb->add_child(builtin_warning_label); + builtin_warning_label->set_autowrap(true); + builtin_warning_label->hide(); + status_panel = memnew(PanelContainer); status_panel->set_h_size_flags(Control::SIZE_FILL); status_panel->add_child(vb); diff --git a/editor/script_create_dialog.h b/editor/script_create_dialog.h index 00f642fcf70..19bb6da6afc 100644 --- a/editor/script_create_dialog.h +++ b/editor/script_create_dialog.h @@ -48,6 +48,7 @@ class ScriptCreateDialog : public ConfirmationDialog { LineEdit *class_name; Label *error_label; Label *path_error_label; + Label *builtin_warning_label; PanelContainer *status_panel; LineEdit *parent_name; Button *parent_browse_button;