From bf97247cecb533b1049c6d163b600385261296c4 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Fri, 14 Jun 2019 23:53:40 +0200 Subject: [PATCH] Improve the default project naming in the Project Manager The Project Manager will now infer a project name from the project path if the name is empty or equal to the default value. The project name will also be capitalized automatically. --- editor/project_manager.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index 3fd497ed7b7..9a3991bef16 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -294,13 +294,13 @@ private: String sp = _test_path(); if (sp != "") { - // set the project name to the select folder name - if (project_name->get_text() == "") { + // If the project name is empty or default, infer the project name from the selected folder name + if (project_name->get_text() == "" || project_name->get_text() == TTR("New Game Project")) { sp = sp.replace("\\", "/"); int lidx = sp.find_last("/"); if (lidx != -1) { - sp = sp.substr(lidx + 1, sp.length()); + sp = sp.substr(lidx + 1, sp.length()).capitalize(); } if (sp == "" && mode == MODE_IMPORT) sp = TTR("Imported Project");