summaryrefslogtreecommitdiffstats
path: root/editor/project_manager/project_dialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/project_manager/project_dialog.cpp')
-rw-r--r--editor/project_manager/project_dialog.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/editor/project_manager/project_dialog.cpp b/editor/project_manager/project_dialog.cpp
index 7acda16890..7aadb9ac3c 100644
--- a/editor/project_manager/project_dialog.cpp
+++ b/editor/project_manager/project_dialog.cpp
@@ -552,6 +552,21 @@ void ProjectDialog::ok_pressed() {
fa_icon->store_string(get_default_project_icon());
EditorVCSInterface::create_vcs_metadata_files(EditorVCSInterface::VCSMetadata(vcs_metadata_selection->get_selected()), path);
+
+ // Ensures external editors and IDEs use UTF-8 encoding.
+ const String editor_config_path = path.path_join(".editorconfig");
+ Ref<FileAccess> f = FileAccess::open(editor_config_path, FileAccess::WRITE);
+ if (f.is_null()) {
+ // .editorconfig isn't so critical.
+ ERR_PRINT("Couldn't create .editorconfig in project path.");
+ } else {
+ f->store_line("root = true");
+ f->store_line("");
+ f->store_line("[*]");
+ f->store_line("charset = utf-8");
+ f->close();
+ FileAccess::set_hidden_attribute(editor_config_path, true);
+ }
}
// Two cases for importing a ZIP.
@@ -986,7 +1001,7 @@ ProjectDialog::ProjectDialog() {
rvb->add_child(renderer_info);
rd_not_supported = memnew(Label);
- rd_not_supported->set_text(TTR("Rendering Device backend not available. Please use the Compatibility renderer."));
+ rd_not_supported->set_text(vformat(TTR("RenderingDevice-based methods not available on this GPU:\n%s\nPlease use the Compatibility renderer."), RenderingServer::get_singleton()->get_video_adapter_name()));
rd_not_supported->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER);
rd_not_supported->set_custom_minimum_size(Size2(200, 0) * EDSCALE);
rd_not_supported->set_autowrap_mode(TextServer::AUTOWRAP_WORD_SMART);
@@ -1024,8 +1039,14 @@ ProjectDialog::ProjectDialog() {
add_child(fdialog_install);
project_name->connect(SceneStringName(text_changed), callable_mp(this, &ProjectDialog::_project_name_changed).unbind(1));
+ project_name->connect(SceneStringName(text_submitted), callable_mp(this, &ProjectDialog::ok_pressed).unbind(1));
+
project_path->connect(SceneStringName(text_changed), callable_mp(this, &ProjectDialog::_project_path_changed).unbind(1));
+ project_path->connect(SceneStringName(text_submitted), callable_mp(this, &ProjectDialog::ok_pressed).unbind(1));
+
install_path->connect(SceneStringName(text_changed), callable_mp(this, &ProjectDialog::_install_path_changed).unbind(1));
+ install_path->connect(SceneStringName(text_submitted), callable_mp(this, &ProjectDialog::ok_pressed).unbind(1));
+
fdialog_install->connect("dir_selected", callable_mp(this, &ProjectDialog::_install_path_selected));
fdialog_install->connect("file_selected", callable_mp(this, &ProjectDialog::_install_path_selected));