From 00bfdc834bc028e7c15e939662a72353250d00f3 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Thu, 9 Jun 2016 22:47:43 -0300 Subject: [PATCH] Better way to disable asset library --- tools/editor/editor_node.cpp | 12 ++++++------ tools/editor/project_manager.cpp | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 269ecb1032d..26e40cf8166 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -56,7 +56,7 @@ #include "io/zip_io.h" #include "io/config_file.h" #include "animation_editor.h" - +#include "io/stream_peer_ssl.h" // plugins #include "plugins/sprite_frames_editor_plugin.h" #include "plugins/texture_region_editor_plugin.h" @@ -6381,12 +6381,12 @@ EditorNode::EditorNode() { add_editor_plugin( memnew( CanvasItemEditorPlugin(this) ) ); add_editor_plugin( memnew( SpatialEditorPlugin(this) ) ); add_editor_plugin( memnew( ScriptEditorPlugin(this) ) ); -#ifdef OPENSSL_ENABLED - add_editor_plugin( memnew( AssetLibraryEditorPlugin(this) ) ); -#else -#warning Asset Library will not compile without SSL -#endif + if (StreamPeerSSL::is_available()) { + add_editor_plugin( memnew( AssetLibraryEditorPlugin(this) ) ); + } else { + WARN_PRINT("Asset Library not available, as it requires SSL to work."); + } //more visually meaningful to have this later raise_bottom_panel_item(AnimationPlayerEditor::singleton); diff --git a/tools/editor/project_manager.cpp b/tools/editor/project_manager.cpp index 037b2f3eafe..419f05f2cf1 100644 --- a/tools/editor/project_manager.cpp +++ b/tools/editor/project_manager.cpp @@ -39,7 +39,7 @@ #include "scene/gui/line_edit.h" #include "scene/gui/panel_container.h" #include "scene/gui/center_container.h" - +#include "io/stream_peer_ssl.h" #include "scene/gui/texture_frame.h" #include "scene/gui/margin_container.h" @@ -986,15 +986,15 @@ ProjectManager::ProjectManager() { tree_vb->add_spacer(); -#ifdef OPENSSL_ENABLED + if (StreamPeerSSL::is_available()) { - asset_library = memnew( EditorAssetLibrary(true) ); - asset_library->set_name("Templates"); - tabs->add_child(asset_library); + asset_library = memnew( EditorAssetLibrary(true) ); + asset_library->set_name("Templates"); + tabs->add_child(asset_library); + } else { + WARN_PRINT("Asset Library not available, as it requires SSL to work."); + } -#else -#warning Asset Library will not compile without SSL -#endif CenterContainer *cc = memnew( CenterContainer ); Button * cancel = memnew( Button );