Initialize project name when importing project

This commit is contained in:
kobewi 2024-08-07 13:22:55 +02:00
parent 1e8bfdcd4f
commit 9a8ba93963
2 changed files with 7 additions and 2 deletions

View File

@ -429,6 +429,10 @@ void ProjectDialog::_install_path_selected(const String &p_path) {
get_ok_button()->grab_focus();
}
void ProjectDialog::_reset_name() {
project_name->set_text(TTR("New Game Project"));
}
void ProjectDialog::_renderer_selected() {
ERR_FAIL_NULL(renderer_button_group->get_pressed_button());
@ -694,6 +698,7 @@ void ProjectDialog::set_project_path(const String &p_path) {
}
void ProjectDialog::ask_for_path_and_show() {
_reset_name();
_browse_project_path();
}
@ -718,8 +723,7 @@ void ProjectDialog::show_dialog(bool p_reset_name) {
callable_mp(project_name, &LineEdit::select_all).call_deferred();
} else {
if (p_reset_name) {
String proj = TTR("New Game Project");
project_name->set_text(proj);
_reset_name();
}
project_path->set_editable(true);

View File

@ -122,6 +122,7 @@ private:
void _project_path_selected(const String &p_path);
void _install_path_selected(const String &p_path);
void _reset_name();
void _renderer_selected();
void _nonempty_confirmation_ok_pressed();