summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/editor/project_settings.cpp14
-rw-r--r--tools/editor/property_editor.cpp10
-rw-r--r--tools/editor/property_editor.h1
3 files changed, 20 insertions, 5 deletions
diff --git a/tools/editor/project_settings.cpp b/tools/editor/project_settings.cpp
index 879fe1bda5..dd3c7552de 100644
--- a/tools/editor/project_settings.cpp
+++ b/tools/editor/project_settings.cpp
@@ -671,10 +671,14 @@ void ProjectSettings::_action_rename(const String &p_name) {
void ProjectSettings::_item_checked(const String& p_item, bool p_check) {
undo_redo->create_action("Toggle Persisting");
- undo_redo->add_do_method(Globals::get_singleton(),"set_persisting",p_item,p_check);
- undo_redo->add_undo_method(Globals::get_singleton(),"set_persisting",p_item,!p_check);
+ String full_item = globals_editor->get_full_item_path(p_item);
+
+ undo_redo->add_do_method(Globals::get_singleton(),"set_persisting",full_item,p_check);
+ undo_redo->add_undo_method(Globals::get_singleton(),"set_persisting",full_item,!p_check);
undo_redo->add_do_method(this,"_settings_changed");
undo_redo->add_undo_method(this,"_settings_changed");
+ undo_redo->add_do_method(globals_editor->get_property_editor(),"update_tree");
+ undo_redo->add_undo_method(globals_editor->get_property_editor(),"update_tree");
undo_redo->commit_action();
}
@@ -692,8 +696,8 @@ void ProjectSettings::_save() {
void ProjectSettings::_settings_prop_edited(const String& p_name) {
if (!Globals::get_singleton()->is_persisting(p_name)) {
-
- Globals::get_singleton()->set_persisting(p_name,true);
+ String full_item = globals_editor->get_full_item_path(p_name);
+ Globals::get_singleton()->set_persisting(full_item,true);
// globals_editor->update_property(p_name);
globals_editor->get_property_editor()->update_tree();
}
@@ -1405,7 +1409,7 @@ ProjectSettings::ProjectSettings(EditorData *p_data) {
globals_editor->get_property_editor()->register_text_enter(search_box);
globals_editor->get_property_editor()->set_capitalize_paths(false);
globals_editor->get_property_editor()->get_scene_tree()->connect("cell_selected",this,"_item_selected");
- globals_editor->get_property_editor()->connect("property_toggled",this,"_item_checked");
+ globals_editor->get_property_editor()->connect("property_toggled",this,"_item_checked",varray(),CONNECT_DEFERRED);
globals_editor->get_property_editor()->connect("property_edited",this,"_settings_prop_edited");
/*
diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp
index 5ab92f5ddc..141f0c2943 100644
--- a/tools/editor/property_editor.cpp
+++ b/tools/editor/property_editor.cpp
@@ -3486,6 +3486,7 @@ void PropertyEditor::_bind_methods() {
ObjectTypeDB::bind_method( "_draw_flags",&PropertyEditor::_draw_flags);
ObjectTypeDB::bind_method( "_set_range_def",&PropertyEditor::_set_range_def);
ObjectTypeDB::bind_method( "_filter_changed",&PropertyEditor::_filter_changed);
+ ObjectTypeDB::bind_method( "update_tree",&PropertyEditor::update_tree);
ADD_SIGNAL( MethodInfo("property_toggled",PropertyInfo( Variant::STRING, "property"),PropertyInfo( Variant::BOOL, "value")));
ADD_SIGNAL( MethodInfo("resource_selected", PropertyInfo( Variant::OBJECT, "res"),PropertyInfo( Variant::STRING, "prop") ) );
@@ -3738,6 +3739,15 @@ void SectionedPropertyEditor::_section_selected(int p_which) {
filter->set_section( sections->get_item_metadata(p_which) );
}
+String SectionedPropertyEditor::get_full_item_path(const String& p_item) {
+
+ String base = sections->get_item_metadata( sections->get_current() );
+ if (base!="")
+ return base+"/"+p_item;
+ else
+ return p_item;
+}
+
void SectionedPropertyEditor::edit(Object* p_object) {
List<PropertyInfo> pinfo;
diff --git a/tools/editor/property_editor.h b/tools/editor/property_editor.h
index 7579ba7ded..81fb078a11 100644
--- a/tools/editor/property_editor.h
+++ b/tools/editor/property_editor.h
@@ -267,6 +267,7 @@ public:
PropertyEditor *get_property_editor();
void edit(Object* p_object);
+ String get_full_item_path(const String& p_item);
SectionedPropertyEditor();
~SectionedPropertyEditor();