aboutsummaryrefslogtreecommitdiff
path: root/editor/editor_node.cpp
diff options
context:
space:
mode:
authorRémi Verschelde2017-05-05 22:40:57 +0200
committerGitHub2017-05-05 22:40:57 +0200
commit1f9266cbff83e611b3178f5c62fc512f91a7f94a (patch)
treeacd2d6778b8ddd06fd59d80180d98516824ccb13 /editor/editor_node.cpp
parent243f05920042b61b19d032d297d28bff73a760a2 (diff)
parent204d3ccf5fb491c0ce4dda618ee9c268d84c943d (diff)
downloadgodot-1f9266cbff83e611b3178f5c62fc512f91a7f94a.tar.gz
godot-1f9266cbff83e611b3178f5c62fc512f91a7f94a.tar.zst
godot-1f9266cbff83e611b3178f5c62fc512f91a7f94a.zip
Merge pull request #8532 from RameshRavone/patch-4
Separate distraction mode for scene & script editor
Diffstat (limited to 'editor/editor_node.cpp')
-rw-r--r--editor/editor_node.cpp31
1 files changed, 30 insertions, 1 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 6b23a0227..5f88a928c 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -2689,6 +2689,14 @@ void EditorNode::_editor_select(int p_which) {
editor_plugin_screen = new_editor;
editor_plugin_screen->make_visible(true);
editor_plugin_screen->selected_notify();
+
+ if (EditorSettings::get_singleton()->get("interface/separate_distraction_mode")) {
+ if (p_which == EDITOR_SCRIPT) {
+ set_distraction_free_mode(script_distraction);
+ } else {
+ set_distraction_free_mode(scene_distraction);
+ }
+ }
}
void EditorNode::add_editor_plugin(EditorPlugin *p_editor) {
@@ -4382,7 +4390,25 @@ bool EditorNode::get_docks_visible() const {
void EditorNode::_toggle_distraction_free_mode() {
- set_distraction_free_mode(distraction_free->is_pressed());
+ if (EditorSettings::get_singleton()->get("interface/separate_distraction_mode")) {
+ int screen = -1;
+ for (int i = 0; i < editor_table.size(); i++) {
+ if (editor_plugin_screen == editor_table[i]) {
+ screen = i;
+ break;
+ }
+ }
+
+ if (screen == EDITOR_SCRIPT) {
+ script_distraction = not script_distraction;
+ set_distraction_free_mode(script_distraction);
+ } else {
+ scene_distraction = not scene_distraction;
+ set_distraction_free_mode(scene_distraction);
+ }
+ } else {
+ set_distraction_free_mode(distraction_free->is_pressed());
+ }
}
void EditorNode::set_distraction_free_mode(bool p_enter) {
@@ -4806,6 +4832,9 @@ EditorNode::EditorNode() {
_initializing_addons = false;
docks_visible = true;
+ scene_distraction = false;
+ script_distraction = false;
+
FileAccess::set_backup_save(true);
TranslationServer::get_singleton()->set_enabled(false);