diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-01-10 17:08:02 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2016-01-10 17:08:02 -0300 |
commit | eb7901c8b8182a258efd16acc1db1a8e318a520c (patch) | |
tree | c440a28e1cc7665a80630c4488b7c984de45d96e | |
parent | 027072728e7dc95f2312f7bbaaa29a6be2140343 (diff) |
-Project settings can properly add/remove properties again, fixes #3177
-rw-r--r-- | tools/editor/project_settings.cpp | 5 | ||||
-rw-r--r-- | tools/editor/property_editor.cpp | 5 | ||||
-rw-r--r-- | tools/editor/property_editor.h | 1 |
3 files changed, 9 insertions, 2 deletions
diff --git a/tools/editor/project_settings.cpp b/tools/editor/project_settings.cpp index b61fcfa780..6c5e18ec9a 100644 --- a/tools/editor/project_settings.cpp +++ b/tools/editor/project_settings.cpp @@ -530,7 +530,7 @@ void ProjectSettings::_item_selected() { return; if (!ti->get_parent()) return; - category->set_text(ti->get_parent()->get_text(0)); + category->set_text(globals_editor->get_current_section()); property->set_text(ti->get_text(0)); popup_platform->set_disabled(false); @@ -569,7 +569,8 @@ void ProjectSettings::_item_add() { String name = catname+"/"+propname; Globals::get_singleton()->set(name,value); - globals_editor->get_property_editor()->update_tree(); + globals_editor->edit(NULL); + globals_editor->edit(Globals::get_singleton()); } void ProjectSettings::_item_del() { diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp index fc5fce1d47..d0a37f0c7d 100644 --- a/tools/editor/property_editor.cpp +++ b/tools/editor/property_editor.cpp @@ -3812,6 +3812,11 @@ void SectionedPropertyEditor::_section_selected(int p_which) { filter->set_section( sections->get_item_metadata(p_which) ); } +String SectionedPropertyEditor::get_current_section() const { + + return sections->get_item_metadata( sections->get_current() ); +} + String SectionedPropertyEditor::get_full_item_path(const String& p_item) { String base = sections->get_item_metadata( sections->get_current() ); diff --git a/tools/editor/property_editor.h b/tools/editor/property_editor.h index 4f03c0381f..63ad090901 100644 --- a/tools/editor/property_editor.h +++ b/tools/editor/property_editor.h @@ -270,6 +270,7 @@ public: PropertyEditor *get_property_editor(); void edit(Object* p_object); String get_full_item_path(const String& p_item); + String get_current_section() const; SectionedPropertyEditor(); ~SectionedPropertyEditor(); |