浏览代码

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.
Rémi Verschelde 3 年之前
父节点
当前提交
42b48496de
共有 2 个文件被更改,包括 8 次插入0 次删除
  1. 4 0
      editor/editor_node.cpp
  2. 4 0
      editor/project_manager.cpp

+ 4 - 0
editor/editor_node.cpp

@@ -7025,11 +7025,15 @@ EditorNode::EditorNode() {
 	ScriptTextEditor::register_editor(); // Register one for text scripts.
 	ScriptTextEditor::register_editor(); // Register one for text scripts.
 	TextEditor::register_editor();
 	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()) {
 	if (StreamPeerSSL::is_available()) {
 		add_editor_plugin(memnew(AssetLibraryEditorPlugin));
 		add_editor_plugin(memnew(AssetLibraryEditorPlugin));
 	} else {
 	} else {
 		WARN_PRINT("Asset Library not available, as it requires SSL to work.");
 		WARN_PRINT("Asset Library not available, as it requires SSL to work.");
 	}
 	}
+#endif
 
 
 	// Add interface before adding plugins.
 	// Add interface before adding plugins.
 
 

+ 4 - 0
editor/project_manager.cpp

@@ -2773,6 +2773,9 @@ ProjectManager::ProjectManager() {
 		center_box->add_child(settings_hb);
 		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()) {
 	if (StreamPeerSSL::is_available()) {
 		asset_library = memnew(EditorAssetLibrary(true));
 		asset_library = memnew(EditorAssetLibrary(true));
 		asset_library->set_name(TTR("Asset Library Projects"));
 		asset_library->set_name(TTR("Asset Library Projects"));
@@ -2781,6 +2784,7 @@ ProjectManager::ProjectManager() {
 	} else {
 	} else {
 		WARN_PRINT("Asset Library not available, as it requires SSL to work.");
 		WARN_PRINT("Asset Library not available, as it requires SSL to work.");
 	}
 	}
+#endif
 
 
 	{
 	{
 		// Dialogs
 		// Dialogs