diff options
author | Ramesh Ravone <ramesh.maran443@gmail.com> | 2017-04-25 17:18:35 +0530 |
---|---|---|
committer | Ramesh Ravone <ramesh.maran443@gmail.com> | 2017-04-26 17:43:35 +0530 |
commit | 204d3ccf5fb491c0ce4dda618ee9c268d84c943d (patch) | |
tree | a5534c3317d3f43178a57bdcd514a5c06789f74d | |
parent | 7dba15b83fb2d2bd72559356cfedfec53215c55d (diff) |
Separate fullscreen state for scene & script editor
-rw-r--r-- | editor/editor_node.cpp | 31 | ||||
-rw-r--r-- | editor/editor_node.h | 3 | ||||
-rw-r--r-- | editor/editor_settings.cpp | 2 |
3 files changed, 35 insertions, 1 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 04d369fed4..14ac3cafe4 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -2688,6 +2688,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) { @@ -4381,7 +4389,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) { @@ -4805,6 +4831,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); diff --git a/editor/editor_node.h b/editor/editor_node.h index 7de713eae9..fc107bb505 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -357,6 +357,9 @@ private: bool docks_visible; ToolButton *distraction_free; + bool scene_distraction; + bool script_distraction; + String _tmp_import_path; EditorExport *editor_export; diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 9beffa3c67..ff87e9ef84 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -509,6 +509,8 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { set("interface/dim_transition_time", 0.08f); hints["interface/dim_transition_time"] = PropertyInfo(Variant::REAL, "interface/dim_transition_time", PROPERTY_HINT_RANGE, "0,1,0.001", PROPERTY_USAGE_DEFAULT); + set("interface/separate_distraction_mode", false); + set("filesystem/directories/autoscan_project_path", ""); hints["filesystem/directories/autoscan_project_path"] = PropertyInfo(Variant::STRING, "filesystem/directories/autoscan_project_path", PROPERTY_HINT_GLOBAL_DIR); set("filesystem/directories/default_project_path", ""); |