summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-04-10 12:02:57 +0200
committerGitHub <noreply@github.com>2020-04-10 12:02:57 +0200
commit29651de5836642525cd509d50d15a30cf7d87751 (patch)
treeb1e27ebefc640f86e6a4d2c048c2fbe36baf3e59 /editor
parent82e12a0f3e85ef623a4d603160b4cc5fcb995061 (diff)
parentac210e196c7775a4b8955ad74b77e9ff017cae36 (diff)
Merge pull request #37565 from Calinou/builtin-script-warn-limitations
Warn about built-in script limitations in the script creation dialog
Diffstat (limited to 'editor')
-rw-r--r--editor/script_create_dialog.cpp9
-rw-r--r--editor/script_create_dialog.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp
index 82199fc1f1..12b21d871b 100644
--- a/editor/script_create_dialog.cpp
+++ b/editor/script_create_dialog.cpp
@@ -689,6 +689,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);
@@ -756,6 +758,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 f164cd2a15..63a30eba88 100644
--- a/editor/script_create_dialog.h
+++ b/editor/script_create_dialog.h
@@ -49,6 +49,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;