You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
When selecting Nodes in the Scene Tree, if the current EditorPlugin is "Script" and if text_editor/behavior/navigation/stay_in_script_editor_on_node_selected is true, force inspector_only in order to not switch the EditorPlugin to the Node's main plugin.
This commit is contained in:
@@ -2176,6 +2176,7 @@ void EditorNode::_edit_current(bool p_skip_foreign) {
|
|||||||
Object *prev_inspected_object = InspectorDock::get_inspector_singleton()->get_edited_object();
|
Object *prev_inspected_object = InspectorDock::get_inspector_singleton()->get_edited_object();
|
||||||
|
|
||||||
bool disable_folding = bool(EDITOR_GET("interface/inspector/disable_folding"));
|
bool disable_folding = bool(EDITOR_GET("interface/inspector/disable_folding"));
|
||||||
|
bool stay_in_script_editor_on_node_selected = bool(EDITOR_GET("text_editor/behavior/navigation/stay_in_script_editor_on_node_selected"));
|
||||||
bool is_resource = current_obj->is_class("Resource");
|
bool is_resource = current_obj->is_class("Resource");
|
||||||
bool is_node = current_obj->is_class("Node");
|
bool is_node = current_obj->is_class("Node");
|
||||||
|
|
||||||
@@ -2214,6 +2215,9 @@ void EditorNode::_edit_current(bool p_skip_foreign) {
|
|||||||
NodeDock::get_singleton()->set_node(current_node);
|
NodeDock::get_singleton()->set_node(current_node);
|
||||||
SceneTreeDock::get_singleton()->set_selected(current_node);
|
SceneTreeDock::get_singleton()->set_selected(current_node);
|
||||||
InspectorDock::get_singleton()->update(current_node);
|
InspectorDock::get_singleton()->update(current_node);
|
||||||
|
if (!inspector_only) {
|
||||||
|
inspector_only = stay_in_script_editor_on_node_selected && ScriptEditor::get_singleton()->is_visible_in_tree();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
NodeDock::get_singleton()->set_node(nullptr);
|
NodeDock::get_singleton()->set_node(nullptr);
|
||||||
SceneTreeDock::get_singleton()->set_selected(nullptr);
|
SceneTreeDock::get_singleton()->set_selected(nullptr);
|
||||||
|
|||||||
@@ -544,6 +544,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
|
|||||||
_initial_set("text_editor/behavior/navigation/smooth_scrolling", true);
|
_initial_set("text_editor/behavior/navigation/smooth_scrolling", true);
|
||||||
EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "text_editor/behavior/navigation/v_scroll_speed", 80, "1,10000,1")
|
EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "text_editor/behavior/navigation/v_scroll_speed", 80, "1,10000,1")
|
||||||
_initial_set("text_editor/behavior/navigation/drag_and_drop_selection", true);
|
_initial_set("text_editor/behavior/navigation/drag_and_drop_selection", true);
|
||||||
|
_initial_set("text_editor/behavior/navigation/stay_in_script_editor_on_node_selected", true);
|
||||||
|
|
||||||
// Behavior: Indent
|
// Behavior: Indent
|
||||||
EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "text_editor/behavior/indent/type", 0, "Tabs,Spaces")
|
EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "text_editor/behavior/indent/type", 0, "Tabs,Spaces")
|
||||||
|
|||||||
Reference in New Issue
Block a user