diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2016-07-19 07:41:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-19 07:41:24 +0200 |
commit | c83aa5f86383bf89871f0a41752f5c6eeb148950 (patch) | |
tree | 82ca3b855680b9b4095c92900b3dc9ad859f37b0 /tools/editor/property_editor.cpp | |
parent | 919e9dd358161a4eb65697aaad1e2b03cf08a164 (diff) | |
parent | ea775534163cd0661eb4f316035610f1017f7d6a (diff) |
Merge pull request #5794 from TheHX/editor-settings-dialog
Keep selected section in Editor Settings when reopening the dialog
Diffstat (limited to 'tools/editor/property_editor.cpp')
-rw-r--r-- | tools/editor/property_editor.cpp | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp index ceb62d5ff0..54d197f10d 100644 --- a/tools/editor/property_editor.cpp +++ b/tools/editor/property_editor.cpp @@ -4232,19 +4232,32 @@ String SectionedPropertyEditor::get_full_item_path(const String& p_item) { void SectionedPropertyEditor::edit(Object* p_object) { - if (p_object) { - obj=p_object->get_instance_ID(); - update_category_list(); - } else { + if (!p_object) { + obj = -1; sections->clear(); + + filter->set_edited(NULL); + editor->edit(NULL); + + return; } - filter->set_edited(p_object); - editor->edit(filter); + ObjectID id = p_object->get_instance_ID(); + + if (obj != id) { + + obj = id; + update_category_list(); - sections->select(0); - _section_selected(0); + filter->set_edited(p_object); + editor->edit(filter); + sections->select(0); + _section_selected(0); + } else { + + update_category_list(); + } } void SectionedPropertyEditor::update_category_list() { @@ -4300,6 +4313,8 @@ PropertyEditor *SectionedPropertyEditor::get_property_editor() { SectionedPropertyEditor::SectionedPropertyEditor() { + obj = -1; + VBoxContainer *left_vb = memnew( VBoxContainer); left_vb->set_custom_minimum_size(Size2(160,0)*EDSCALE); add_child(left_vb); |