Warn about built-in script limitations in the script creation dialog
This partially addresses #31758.
This commit is contained in:
parent
3d0c633e7b
commit
ac210e196c
|
@ -689,6 +689,8 @@ void ScriptCreateDialog::_update_dialog() {
|
||||||
|
|
||||||
// Is Script created or loaded from existing file?
|
// Is Script created or loaded from existing file?
|
||||||
|
|
||||||
|
builtin_warning_label->set_visible(is_built_in);
|
||||||
|
|
||||||
if (is_built_in) {
|
if (is_built_in) {
|
||||||
get_ok()->set_text(TTR("Create"));
|
get_ok()->set_text(TTR("Create"));
|
||||||
parent_name->set_editable(true);
|
parent_name->set_editable(true);
|
||||||
|
@ -756,6 +758,13 @@ ScriptCreateDialog::ScriptCreateDialog() {
|
||||||
path_error_label = memnew(Label);
|
path_error_label = memnew(Label);
|
||||||
vb->add_child(path_error_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 = memnew(PanelContainer);
|
||||||
status_panel->set_h_size_flags(Control::SIZE_FILL);
|
status_panel->set_h_size_flags(Control::SIZE_FILL);
|
||||||
status_panel->add_child(vb);
|
status_panel->add_child(vb);
|
||||||
|
|
|
@ -49,6 +49,7 @@ class ScriptCreateDialog : public ConfirmationDialog {
|
||||||
LineEdit *class_name;
|
LineEdit *class_name;
|
||||||
Label *error_label;
|
Label *error_label;
|
||||||
Label *path_error_label;
|
Label *path_error_label;
|
||||||
|
Label *builtin_warning_label;
|
||||||
PanelContainer *status_panel;
|
PanelContainer *status_panel;
|
||||||
LineEdit *parent_name;
|
LineEdit *parent_name;
|
||||||
Button *parent_browse_button;
|
Button *parent_browse_button;
|
||||||
|
|
Loading…
Reference in New Issue