summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2019-06-14 23:53:40 +0200
committerHugo Locurcio <hugo.locurcio@hugo.pro>2019-06-15 00:01:44 +0200
commitbf97247cecb533b1049c6d163b600385261296c4 (patch)
treea635c9a9b1aee717b59091bf86d50001c8911f42
parent8e04aecb193a59c3af42f25ff6f255875571ab39 (diff)
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.
-rw-r--r--editor/project_manager.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp
index 3fd497ed7b..9a3991bef1 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");