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.
This commit is contained in:
Rémi Verschelde 2022-05-25 14:19:01 +02:00
parent 971daadfa0
commit 42b48496de
2 changed files with 8 additions and 0 deletions

View file

@ -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.

View file

@ -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