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.

(cherry picked from commit 42b48496de)
This commit is contained in:
Rémi Verschelde 2022-05-25 14:19:01 +02:00
parent 3891186536
commit 78c54043ce
2 changed files with 8 additions and 0 deletions

View file

@ -6964,11 +6964,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(this)));
} else {
WARN_PRINT("Asset Library not available, as it requires SSL to work.");
}
#endif
//add interface before adding plugins

View file

@ -2593,6 +2593,9 @@ ProjectManager::ProjectManager() {
about_btn->connect("pressed", this, "_show_about");
tree_vb->add_child(about_btn);
// 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"));
@ -2601,6 +2604,7 @@ ProjectManager::ProjectManager() {
} else {
WARN_PRINT("Asset Library not available, as it requires SSL to work.");
}
#endif
HBoxContainer *settings_hb = memnew(HBoxContainer);
settings_hb->set_alignment(BoxContainer::ALIGN_END);