From 42b48496dedf20d7dd43756efac4408e0a9c639f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Wed, 25 May 2022 14:19:01 +0200 Subject: [PATCH] HTML5: Always disable Asset Library GitHub doesn't allow CORS so we can't download assets from it. There'd also be more work needed for the Asset Library plugin to be usable in the Web editor even if that was supported. --- editor/editor_node.cpp | 4 ++++ editor/project_manager.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 4998cc82e8a..c59c7de603c 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/project_manager.cpp b/editor/project_manager.cpp index 3a6c47aa224..a56b6ec9d46 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -2773,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")); @@ -2781,6 +2784,7 @@ ProjectManager::ProjectManager() { } else { WARN_PRINT("Asset Library not available, as it requires SSL to work."); } +#endif { // Dialogs