mirror of
https://github.com/godotengine/godot.git
synced 2024-11-10 14:12:51 +00:00
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.
This commit is contained in:
parent
8e04aecb19
commit
bf97247cec
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user