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