summaryrefslogtreecommitdiffstats
path: root/editor/editor_interface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_interface.cpp')
-rw-r--r--editor/editor_interface.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/editor/editor_interface.cpp b/editor/editor_interface.cpp
index d9d9dc01c0..8d63082f31 100644
--- a/editor/editor_interface.cpp
+++ b/editor/editor_interface.cpp
@@ -31,6 +31,7 @@
#include "editor_interface.h"
#include "editor/editor_command_palette.h"
+#include "editor/editor_feature_profile.h"
#include "editor/editor_node.h"
#include "editor/editor_paths.h"
#include "editor/editor_resource_preview.h"
@@ -239,6 +240,14 @@ void EditorInterface::popup_dialog_centered_clamped(Window *p_dialog, const Size
p_dialog->popup_exclusive_centered_clamped(EditorNode::get_singleton(), p_size, p_fallback_ratio);
}
+String EditorInterface::get_current_feature_profile() const {
+ return EditorFeatureProfileManager::get_singleton()->get_current_profile_name();
+}
+
+void EditorInterface::set_current_feature_profile(const String &p_profile_name) {
+ EditorFeatureProfileManager::get_singleton()->set_current_profile(p_profile_name, true);
+}
+
// Editor docks.
FileSystemDock *EditorInterface::get_file_system_dock() const {
@@ -337,6 +346,10 @@ void EditorInterface::mark_scene_as_unsaved() {
EditorUndoRedoManager::get_singleton()->set_history_as_unsaved(EditorNode::get_editor_data().get_current_edited_scene_history_id());
}
+void EditorInterface::save_all_scenes() {
+ EditorNode::get_singleton()->save_all_scenes();
+}
+
// Scene playback.
void EditorInterface::play_main_scene() {
@@ -407,6 +420,9 @@ void EditorInterface::_bind_methods() {
ClassDB::bind_method(D_METHOD("popup_dialog_centered_ratio", "dialog", "ratio"), &EditorInterface::popup_dialog_centered_ratio, DEFVAL(0.8));
ClassDB::bind_method(D_METHOD("popup_dialog_centered_clamped", "dialog", "minsize", "fallback_ratio"), &EditorInterface::popup_dialog_centered_clamped, DEFVAL(Size2i()), DEFVAL(0.75));
+ ClassDB::bind_method(D_METHOD("get_current_feature_profile"), &EditorInterface::get_current_feature_profile);
+ ClassDB::bind_method(D_METHOD("set_current_feature_profile", "profile_name"), &EditorInterface::set_current_feature_profile);
+
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "distraction_free_mode"), "set_distraction_free_mode", "is_distraction_free_mode_enabled");
// Editor docks.
@@ -434,6 +450,7 @@ void EditorInterface::_bind_methods() {
ClassDB::bind_method(D_METHOD("save_scene"), &EditorInterface::save_scene);
ClassDB::bind_method(D_METHOD("save_scene_as", "path", "with_preview"), &EditorInterface::save_scene_as, DEFVAL(true));
+ ClassDB::bind_method(D_METHOD("save_all_scenes"), &EditorInterface::save_all_scenes);
ClassDB::bind_method(D_METHOD("mark_scene_as_unsaved"), &EditorInterface::mark_scene_as_unsaved);