diff options
Diffstat (limited to 'editor/project_settings_editor.cpp')
-rw-r--r-- | editor/project_settings_editor.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index 2da49f11cc..f23b08409e 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -36,6 +36,7 @@ #include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_undo_redo_manager.h" +#include "scene/gui/check_button.h" #include "servers/movie_writer/movie_writer.h" ProjectSettingsEditor *ProjectSettingsEditor::singleton = nullptr; @@ -72,6 +73,11 @@ void ProjectSettingsEditor::set_plugins_page() { tab_container->set_current_tab(tab_container->get_tab_idx_from_control(plugin_settings)); } +void ProjectSettingsEditor::set_general_page(const String &p_category) { + tab_container->set_current_tab(tab_container->get_tab_idx_from_control(general_editor)); + general_settings_inspector->set_current_section(p_category); +} + void ProjectSettingsEditor::update_plugins() { plugin_settings->update_plugins(); } @@ -346,7 +352,7 @@ void ProjectSettingsEditor::_action_added(const String &p_name) { void ProjectSettingsEditor::_action_edited(const String &p_name, const Dictionary &p_action) { const String property_name = "input/" + p_name; - Dictionary old_val = ProjectSettings::get_singleton()->get(property_name); + Dictionary old_val = GLOBAL_GET(property_name); if (old_val["deadzone"] != p_action["deadzone"]) { // Deadzone Changed @@ -356,12 +362,12 @@ void ProjectSettingsEditor::_action_edited(const String &p_name, const Dictionar } else { // Events changed - int event_count = ((Array)p_action["events"]).size(); + int act_event_count = ((Array)p_action["events"]).size(); int old_event_count = ((Array)old_val["events"]).size(); - if (event_count == old_event_count) { + if (act_event_count == old_event_count) { undo_redo->create_action(TTR("Edit Input Action Event")); - } else if (event_count > old_event_count) { + } else if (act_event_count > old_event_count) { undo_redo->create_action(TTR("Add Input Action Event")); } else { undo_redo->create_action(TTR("Remove Input Action Event")); @@ -381,7 +387,7 @@ void ProjectSettingsEditor::_action_edited(const String &p_name, const Dictionar void ProjectSettingsEditor::_action_removed(const String &p_name) { const String property_name = "input/" + p_name; - Dictionary old_val = ProjectSettings::get_singleton()->get(property_name); + Dictionary old_val = GLOBAL_GET(property_name); int order = ProjectSettings::get_singleton()->get_order(property_name); undo_redo->create_action(TTR("Erase Input Action")); @@ -404,7 +410,7 @@ void ProjectSettingsEditor::_action_renamed(const String &p_old_name, const Stri "An action with this name already exists."); int order = ProjectSettings::get_singleton()->get_order(old_property_name); - Dictionary action = ProjectSettings::get_singleton()->get(old_property_name); + Dictionary action = GLOBAL_GET(old_property_name); undo_redo->create_action(TTR("Rename Input Action Event")); // Do: clear old, set new @@ -499,7 +505,7 @@ void ProjectSettingsEditor::_update_action_map_editor() { // Strip the "input/" from the left. String display_name = property_name.substr(String("input/").size() - 1); - Dictionary action = ProjectSettings::get_singleton()->get(property_name); + Dictionary action = GLOBAL_GET(property_name); ActionMapEditor::ActionInfo action_info; action_info.action = action; @@ -575,7 +581,7 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { tab_container->set_theme_type_variation("TabContainerOdd"); add_child(tab_container); - VBoxContainer *general_editor = memnew(VBoxContainer); + general_editor = memnew(VBoxContainer); general_editor->set_name(TTR("General")); general_editor->set_alignment(BoxContainer::ALIGNMENT_BEGIN); general_editor->set_v_size_flags(Control::SIZE_EXPAND_FILL); |