mirror of
https://github.com/godotengine/godot.git
synced 2024-11-10 22:23:07 +00:00
small feature: set project name automatically when choosing path for new projects
This commit is contained in:
parent
40e32b1fca
commit
0be5ff50aa
@ -98,22 +98,20 @@ class NewProjectDialog : public ConfirmationDialog {
|
|||||||
|
|
||||||
void _path_text_changed(const String& p_path) {
|
void _path_text_changed(const String& p_path) {
|
||||||
|
|
||||||
_test_path();
|
if ( _test_path() ) {
|
||||||
if (import_mode) {
|
|
||||||
|
|
||||||
String sp=p_path;
|
String sp=p_path;
|
||||||
|
|
||||||
sp=sp.replace("\\","/");
|
sp=sp.replace("\\","/");
|
||||||
int lidx=sp.find_last("/");
|
int lidx=sp.find_last("/");
|
||||||
if (lidx!=-1) {
|
if (lidx!=-1) {
|
||||||
sp=sp.substr(lidx+1,sp.length());
|
sp=sp.substr(lidx+1,sp.length());
|
||||||
}
|
}
|
||||||
if (sp=="")
|
if (sp=="" && import_mode )
|
||||||
sp="Imported Project";
|
sp="Imported Project";
|
||||||
|
|
||||||
project_name->set_text(sp);
|
project_name->set_text(sp);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void _file_selected(const String& p_path) {
|
void _file_selected(const String& p_path) {
|
||||||
|
Loading…
Reference in New Issue
Block a user