Use Jolt Physics by default in newly created projects

This also adds infrastructure to make specific settings the default, but only
in projects created after this point (so that existing projects
are not affected). This can be used for progressive upgrades in the future.

This applies to both the project creation dialog and creating projects
through the command line using `touch project.godot`.
This commit is contained in:
Hugo Locurcio
2025-04-25 02:24:12 +02:00
parent 1f7630f1bf
commit c4bbf27cb5
4 changed files with 31 additions and 1 deletions

View File

@@ -34,6 +34,7 @@
#include "core/io/dir_access.h"
#include "core/io/zip_io.h"
#include "core/version.h"
#include "editor/editor_node.h"
#include "editor/editor_string_names.h"
#include "editor/gui/editor_file_dialog.h"
#include "editor/settings/editor_settings.h"
@@ -545,6 +546,11 @@ void ProjectDialog::ok_pressed() {
initial_settings["application/config/features"] = project_features;
initial_settings["application/config/name"] = project_name->get_text().strip_edges();
initial_settings["application/config/icon"] = "res://icon.svg";
ProjectSettings::CustomMap extra_settings = EditorNode::get_initial_settings();
for (const KeyValue<String, Variant> &extra_setting : extra_settings) {
// Merge with other initial settings defined above.
initial_settings[extra_setting.key] = extra_setting.value;
}
Error err = ProjectSettings::get_singleton()->save_custom(path.path_join("project.godot"), initial_settings, Vector<String>(), false);
if (err != OK) {