summaryrefslogtreecommitdiff
path: root/editor/project_manager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/project_manager.cpp')
-rw-r--r--editor/project_manager.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp
index 46c47d8656..00488a2a88 100644
--- a/editor/project_manager.cpp
+++ b/editor/project_manager.cpp
@@ -213,7 +213,7 @@ private:
}
String sp = p.simplify_path();
project_path->set_text(sp);
- set_message(TTR(" ")); // just so it does not disappear
+ set_message(" "); // just so it does not disappear
get_ok()->call_deferred("grab_focus");
}
@@ -508,7 +508,8 @@ public:
} else if (current->has_setting("application/config/name")) {
project_name->set_text(current->get("application/config/name"));
}
- project_name->grab_focus();
+
+ project_name->call_deferred("grab_focus");
create_dir->hide();
status_btn->hide();
@@ -655,6 +656,12 @@ void ProjectManager::_notification(int p_what) {
Engine::get_singleton()->set_editor_hint(false);
+ } else if (p_what == NOTIFICATION_READY) {
+
+ if (scroll_childs->get_child_count() == 0) {
+ open_templates->popup_centered_minsize();
+ }
+
} else if (p_what == NOTIFICATION_VISIBILITY_CHANGED) {
set_process_unhandled_input(is_visible_in_tree());
@@ -1432,9 +1439,15 @@ void ProjectManager::_bind_methods() {
ClassDB::bind_method("_favorite_pressed", &ProjectManager::_favorite_pressed);
ClassDB::bind_method("_install_project", &ProjectManager::_install_project);
ClassDB::bind_method("_files_dropped", &ProjectManager::_files_dropped);
+ ClassDB::bind_method("_open_asset_library", &ProjectManager::_open_asset_library);
ClassDB::bind_method(D_METHOD("_scan_multiple_folders", "files"), &ProjectManager::_scan_multiple_folders);
}
+void ProjectManager::_open_asset_library() {
+ asset_library->disable_community_support();
+ tabs->set_current_tab(1);
+}
+
ProjectManager::ProjectManager() {
// load settings
@@ -1705,6 +1718,12 @@ ProjectManager::ProjectManager() {
dialog_error = memnew(AcceptDialog);
gui_base->add_child(dialog_error);
+
+ open_templates = memnew(ConfirmationDialog);
+ open_templates->set_text(TTR("You don't currently have any projects.\nWould you like to explore the official example projects in the Asset Library?"));
+ open_templates->get_ok()->set_text(TTR("Open Asset Library"));
+ open_templates->connect("confirmed", this, "_open_asset_library");
+ add_child(open_templates);
}
ProjectManager::~ProjectManager() {
@@ -1756,6 +1775,7 @@ void ProjectListFilter::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_ENTER_TREE: {
clear_search_button->set_icon(get_icon("Close", "EditorIcons"));
+
} break;
}
}