From 073abe4b9c633a00256957abd7a6352cec1ee0b8 Mon Sep 17 00:00:00 2001 From: Yuri Roubinsky Date: Thu, 10 Mar 2022 19:46:31 +0300 Subject: Add "Add Script" option to project autoload settings --- editor/editor_autoload_settings.h | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'editor/editor_autoload_settings.h') diff --git a/editor/editor_autoload_settings.h b/editor/editor_autoload_settings.h index 044eea4245..380cadbebb 100644 --- a/editor/editor_autoload_settings.h +++ b/editor/editor_autoload_settings.h @@ -47,7 +47,8 @@ class EditorAutoloadSettings : public VBoxContainer { BUTTON_DELETE }; - String autoload_changed; + String path = "res://"; + String autoload_changed = "autoload_changed"; struct AutoloadInfo { String name; @@ -64,17 +65,16 @@ class EditorAutoloadSettings : public VBoxContainer { List autoload_cache; - bool updating_autoload; - int number_of_autoloads; + bool updating_autoload = false; String selected_autoload; - Tree *tree; - LineEdit *autoload_add_name; - Button *add_autoload; - LineEdit *autoload_add_path; - Label *error_message; - Button *browse_button; - EditorFileDialog *file_dialog; + Tree *tree = nullptr; + LineEdit *autoload_add_name = nullptr; + Button *add_autoload = nullptr; + LineEdit *autoload_add_path = nullptr; + Label *error_message = nullptr; + Button *browse_button = nullptr; + EditorFileDialog *file_dialog = nullptr; bool _autoload_name_is_valid(const String &p_name, String *r_error = nullptr); @@ -90,6 +90,8 @@ class EditorAutoloadSettings : public VBoxContainer { void _autoload_file_callback(const String &p_path); Node *_create_autoload(const String &p_path); + void _script_created(Ref