You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
[AssetLib] Fix crash in Web editor.
Add EditorAssetLibrary::is_available which always returns false in the Web editor and use it in EditorNode for detection.
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
|
||||
#include "core/input/input.h"
|
||||
#include "core/io/json.h"
|
||||
#include "core/io/stream_peer_ssl.h"
|
||||
#include "core/os/keyboard.h"
|
||||
#include "core/version.h"
|
||||
#include "editor/editor_file_dialog.h"
|
||||
@@ -1588,6 +1589,16 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) {
|
||||
|
||||
///////
|
||||
|
||||
bool AssetLibraryEditorPlugin::is_available() {
|
||||
#ifdef JAVASCRIPT_ENABLED
|
||||
// Asset Library can't work on Web editor for now as most assets are sourced
|
||||
// directly from GitHub which does not set CORS.
|
||||
return false;
|
||||
#else
|
||||
return StreamPeerSSL::is_available();
|
||||
#endif
|
||||
}
|
||||
|
||||
void AssetLibraryEditorPlugin::make_visible(bool p_visible) {
|
||||
if (p_visible) {
|
||||
addon_library->show();
|
||||
|
||||
Reference in New Issue
Block a user