diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_node.cpp | 4 | ||||
-rw-r--r-- | editor/plugins/gdextension_export_plugin.h | 22 | ||||
-rw-r--r-- | editor/project_manager.cpp | 46 |
3 files changed, 45 insertions, 27 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 4998cc82e8..c59c7de603 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -7025,11 +7025,15 @@ EditorNode::EditorNode() { ScriptTextEditor::register_editor(); // Register one for text scripts. TextEditor::register_editor(); + // Asset Library can't work on Web editor for now as most assets are sourced + // directly from GitHub which does not set CORS. +#ifndef JAVASCRIPT_ENABLED if (StreamPeerSSL::is_available()) { add_editor_plugin(memnew(AssetLibraryEditorPlugin)); } else { WARN_PRINT("Asset Library not available, as it requires SSL to work."); } +#endif // Add interface before adding plugins. diff --git a/editor/plugins/gdextension_export_plugin.h b/editor/plugins/gdextension_export_plugin.h index c17e02e1fd..b91a17d9e5 100644 --- a/editor/plugins/gdextension_export_plugin.h +++ b/editor/plugins/gdextension_export_plugin.h @@ -47,14 +47,9 @@ void GDExtensionExportPlugin::_export_file(const String &p_path, const String &p config.instantiate(); Error err = config->load(p_path); + ERR_FAIL_COND_MSG(err, "Failed to load GDExtension file: " + p_path); - if (err != OK) { - return; - } - - if (!config->has_section_key("configuration", "entry_symbol")) { - return; - } + ERR_FAIL_COND_MSG(!config->has_section_key("configuration", "entry_symbol"), "Failed to export GDExtension file, missing entry symbol: " + p_path); String entry_symbol = config->get_value("configuration", "entry_symbol"); @@ -62,6 +57,7 @@ void GDExtensionExportPlugin::_export_file(const String &p_path, const String &p config->get_section_keys("libraries", &libraries); + bool could_export = false; for (const String &E : libraries) { Vector<String> tags = E.split("."); bool all_tags_met = true; @@ -101,13 +97,23 @@ void GDExtensionExportPlugin::_export_file(const String &p_path, const String &p String linker_flags = "-Wl,-U,_" + entry_symbol; add_ios_linker_flags(linker_flags); } + could_export = true; break; } } + if (!could_export) { + Vector<String> tags; + for (const String &E : p_features) { + tags.append(E); + } + ERR_FAIL_MSG(vformat("Couldn't export extension: %s. No suitable library found for export flags: %s", p_path, String(", ").join(tags))); + } List<String> dependencies; + if (config->has_section("dependencies")) { + config->get_section_keys("dependencies", &dependencies); + } - config->get_section_keys("dependencies", &dependencies); for (const String &E : libraries) { Vector<String> tags = E.split("."); bool all_tags_met = true; diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index 379c3bbb01..a56b6ec9d4 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -1881,18 +1881,20 @@ void ProjectManager::_notification(int p_what) { } break; case NOTIFICATION_RESIZED: { - if (open_templates->is_visible()) { + if (open_templates && open_templates->is_visible()) { open_templates->popup_centered(); } - real_t size = get_size().x / EDSCALE; - asset_library->set_columns(size < 1000 ? 1 : 2); - // Adjust names of tabs to fit the new size. - if (size < 650) { - local_projects_hb->set_name(TTR("Local")); - asset_library->set_name(TTR("Asset Library")); - } else { - local_projects_hb->set_name(TTR("Local Projects")); - asset_library->set_name(TTR("Asset Library Projects")); + if (asset_library) { + real_t size = get_size().x / EDSCALE; + asset_library->set_columns(size < 1000 ? 1 : 2); + // Adjust names of tabs to fit the new size. + if (size < 650) { + local_projects_hb->set_name(TTR("Local")); + asset_library->set_name(TTR("Asset Library")); + } else { + local_projects_hb->set_name(TTR("Local Projects")); + asset_library->set_name(TTR("Asset Library Projects")); + } } } break; @@ -1901,10 +1903,6 @@ void ProjectManager::_notification(int p_what) { filter_option->select(default_sorting); _project_list->set_order_option(default_sorting); - if (_project_list->get_project_count() == 0 && StreamPeerSSL::is_available()) { - open_templates->popup_centered(); - } - if (_project_list->get_project_count() >= 1) { // Focus on the search box immediately to allow the user // to search without having to reach for their mouse @@ -1914,6 +1912,10 @@ void ProjectManager::_notification(int p_what) { if (asset_library) { // Removes extra border margins. asset_library->add_theme_style_override("panel", memnew(StyleBoxEmpty)); + // Suggest browsing asset library to get templates/demos. + if (open_templates && _project_list->get_project_count() == 0) { + open_templates->popup_centered(); + } } } break; @@ -2771,6 +2773,9 @@ ProjectManager::ProjectManager() { center_box->add_child(settings_hb); } + // Asset Library can't work on Web editor for now as most assets are sourced + // directly from GitHub which does not set CORS. +#ifndef JAVASCRIPT_ENABLED if (StreamPeerSSL::is_available()) { asset_library = memnew(EditorAssetLibrary(true)); asset_library->set_name(TTR("Asset Library Projects")); @@ -2779,6 +2784,7 @@ ProjectManager::ProjectManager() { } else { WARN_PRINT("Asset Library not available, as it requires SSL to work."); } +#endif { // Dialogs @@ -2847,11 +2853,13 @@ ProjectManager::ProjectManager() { dialog_error = memnew(AcceptDialog); add_child(dialog_error); - open_templates = memnew(ConfirmationDialog); - open_templates->set_text(TTR("You currently don't have any projects.\nWould you like to explore official example projects in the Asset Library?")); - open_templates->get_ok_button()->set_text(TTR("Open Asset Library")); - open_templates->connect("confirmed", callable_mp(this, &ProjectManager::_open_asset_library)); - add_child(open_templates); + if (asset_library) { + open_templates = memnew(ConfirmationDialog); + open_templates->set_text(TTR("You currently don't have any projects.\nWould you like to explore official example projects in the Asset Library?")); + open_templates->get_ok_button()->set_text(TTR("Open Asset Library")); + open_templates->connect("confirmed", callable_mp(this, &ProjectManager::_open_asset_library)); + add_child(open_templates); + } about = memnew(EditorAbout); add_child(about); |