diff options
Diffstat (limited to 'tools/editor/project_settings.cpp')
-rw-r--r-- | tools/editor/project_settings.cpp | 43 |
1 files changed, 32 insertions, 11 deletions
diff --git a/tools/editor/project_settings.cpp b/tools/editor/project_settings.cpp index fd76ea3087..bf7d8b190a 100644 --- a/tools/editor/project_settings.cpp +++ b/tools/editor/project_settings.cpp @@ -60,6 +60,8 @@ void ProjectSettings::_notification(int p_what) { if (p_what==NOTIFICATION_ENTER_TREE) { + globals_editor->edit(Globals::get_singleton()); + search_button->set_icon(get_icon("Zoom","EditorIcons")); clear_button->set_icon(get_icon("Close","EditorIcons")); @@ -566,10 +568,10 @@ void ProjectSettings::popup_project_settings() { //popup_centered(Size2(500,400)); popup_centered_ratio(); - globals_editor->edit(NULL); - globals_editor->edit(Globals::get_singleton()); + globals_editor->update_category_list(); _update_translations(); _update_autoload(); + plugin_settings->update_plugins(); } @@ -604,37 +606,45 @@ void ProjectSettings::_item_add() { case 3: value=""; break; } - String catname = category->get_text(); + String catname = category->get_text().strip_edges(); /*if (!catname.is_valid_identifier()) { message->set_text("Invalid Category.\nValid characters: a-z,A-Z,0-9 or _"); message->popup_centered(Size2(300,100)); return; }*/ - String propname = property->get_text(); + String propname = property->get_text().strip_edges(); /*if (!propname.is_valid_identifier()) { message->set_text("Invalid Property.\nValid characters: a-z,A-Z,0-9 or _"); message->popup_centered(Size2(300,100)); return; }*/ - String name = catname+"/"+propname; + String name = catname!="" ? catname+"/"+propname : propname; + Globals::get_singleton()->set(name,value); - globals_editor->edit(NULL); - globals_editor->edit(Globals::get_singleton()); + + globals_editor->set_current_section(catname); + globals_editor->update_category_list(); + + _settings_changed(); } void ProjectSettings::_item_del() { - String catname = category->get_text(); + String catname = category->get_text().strip_edges(); //ERR_FAIL_COND(!catname.is_valid_identifier()); - String propname = property->get_text(); + String propname = property->get_text().strip_edges(); //ERR_FAIL_COND(!propname.is_valid_identifier()); - String name = catname+"/"+propname; + String name = catname!="" ? catname+"/"+propname : propname; + Globals::get_singleton()->set(name,Variant()); - globals_editor->get_property_editor()->update_tree(); + globals_editor->set_current_section(catname); + globals_editor->update_category_list(); + + _settings_changed(); } void ProjectSettings::_action_adds(String) { @@ -739,6 +749,10 @@ void ProjectSettings::_settings_changed() { timer->start(); } +void ProjectSettings::queue_save() { + _settings_changed(); +} + void ProjectSettings::_copy_to_platform(int p_which) { @@ -1830,6 +1844,13 @@ ProjectSettings::ProjectSettings(EditorData *p_data) { } + { + + plugin_settings = memnew( EditorPluginSettings ); + plugin_settings->set_name("Plugins"); + tab_container->add_child(plugin_settings); + } + timer = memnew( Timer ); timer->set_wait_time(1.5); timer->connect("timeout",Globals::get_singleton(),"save"); |