|
29 | 29 | /**************************************************************************/ |
30 | 30 |
|
31 | 31 | #include "editor_interface.h" |
| 32 | +#include "core/string/print_string.h" |
32 | 33 | #include "editor_interface.compat.inc" |
33 | 34 |
|
34 | 35 | #include "core/config/project_settings.h" |
35 | 36 | #include "core/io/resource_loader.h" |
| 37 | +#include "editor/asset_library/asset_library_editor_plugin.h" |
36 | 38 | #include "editor/docks/filesystem_dock.h" |
37 | 39 | #include "editor/docks/inspector_dock.h" |
38 | 40 | #include "editor/editor_main_screen.h" |
|
52 | 54 | #include "editor/settings/editor_command_palette.h" |
53 | 55 | #include "editor/settings/editor_feature_profile.h" |
54 | 56 | #include "editor/settings/editor_settings.h" |
| 57 | +#include "editor/settings/project_settings_editor.h" |
55 | 58 | #include "editor/themes/editor_scale.h" |
56 | 59 | #include "main/main.h" |
57 | 60 | #include "scene/3d/light_3d.h" |
58 | 61 | #include "scene/3d/mesh_instance_3d.h" |
59 | 62 | #include "scene/gui/box_container.h" |
60 | 63 | #include "scene/gui/control.h" |
| 64 | +#include "scene/gui/line_edit.h" |
| 65 | +#include "scene/main/http_request.h" |
61 | 66 | #include "scene/main/window.h" |
62 | 67 | #include "scene/resources/packed_scene.h" |
63 | 68 | #include "scene/resources/theme.h" |
@@ -105,6 +110,31 @@ EditorUndoRedoManager *EditorInterface::get_editor_undo_redo() const { |
105 | 110 | return EditorUndoRedoManager::get_singleton(); |
106 | 111 | } |
107 | 112 |
|
| 113 | +void EditorInterface::open_project_settings(const String &p_general_page, const String &p_filter) { |
| 114 | + ProjectSettingsEditor *project_settings = EditorNode::get_singleton()->get_project_settings(); |
| 115 | + |
| 116 | + if (!p_general_page.is_empty()) { |
| 117 | + project_settings->set_general_page(p_general_page); |
| 118 | + } |
| 119 | + if (!p_filter.is_empty()) { |
| 120 | + project_settings->set_filter(p_filter); |
| 121 | + } |
| 122 | + |
| 123 | + project_settings->popup_project_settings(false); |
| 124 | +} |
| 125 | + |
| 126 | +void EditorInterface::open_export_dialog() { |
| 127 | + EditorNode::get_singleton()->open_export_dialog(); |
| 128 | +} |
| 129 | + |
| 130 | +void EditorInterface::search_asset_library(const String &p_filter) { |
| 131 | + AssetLibraryEditorPlugin *asset_lib = EditorNode::get_singleton()->get_asset_library(); |
| 132 | + ERR_FAIL_NULL_MSG(asset_lib, "Asset Library not available."); |
| 133 | + |
| 134 | + set_main_screen_editor("AssetLib"); |
| 135 | + asset_lib->search_assset_library(p_filter); |
| 136 | +} |
| 137 | + |
108 | 138 | AABB EditorInterface::_calculate_aabb_for_scene(Node *p_node, AABB &p_scene_aabb) { |
109 | 139 | MeshInstance3D *mesh_node = Object::cast_to<MeshInstance3D>(p_node); |
110 | 140 | if (mesh_node && mesh_node->get_mesh().is_valid()) { |
@@ -830,6 +860,10 @@ void EditorInterface::_bind_methods() { |
830 | 860 | ClassDB::bind_method(D_METHOD("get_editor_toaster"), &EditorInterface::get_editor_toaster); |
831 | 861 | ClassDB::bind_method(D_METHOD("get_editor_undo_redo"), &EditorInterface::get_editor_undo_redo); |
832 | 862 |
|
| 863 | + ClassDB::bind_method(D_METHOD("open_project_settings", "general_page", "filter"), &EditorInterface::open_project_settings, DEFVAL(""), DEFVAL("")); |
| 864 | + ClassDB::bind_method(D_METHOD("open_export_dialog"), &EditorInterface::open_export_dialog); |
| 865 | + ClassDB::bind_method(D_METHOD("search_asset_library", "filter"), &EditorInterface::search_asset_library); |
| 866 | + |
833 | 867 | ClassDB::bind_method(D_METHOD("make_mesh_previews", "meshes", "preview_size"), &EditorInterface::_make_mesh_previews); |
834 | 868 |
|
835 | 869 | ClassDB::bind_method(D_METHOD("set_plugin_enabled", "plugin", "enabled"), &EditorInterface::set_plugin_enabled); |
|
0 commit comments