summaryrefslogtreecommitdiff
path: root/editor/project_manager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/project_manager.cpp')
-rw-r--r--editor/project_manager.cpp25
1 files changed, 22 insertions, 3 deletions
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp
index 7b521aba13..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");
@@ -961,9 +961,25 @@ void ProjectManager::_notification(int p_what) {
set_process_unhandled_input(is_visible_in_tree());
} break;
+ case NOTIFICATION_WM_QUIT_REQUEST: {
+
+ _dim_window();
+ } break;
}
}
+void ProjectManager::_dim_window() {
+
+ // This method must be called before calling `get_tree()->quit()`.
+ // Otherwise, its effect won't be visible
+
+ // Dim the project manager window while it's quitting to make it clearer that it's busy.
+ // No transition is applied, as the effect needs to be visible immediately
+ float c = 1.0f - float(EDITOR_GET("interface/editor/dim_amount"));
+ Color dim_color = Color(c, c, c);
+ gui_base->set_modulate(dim_color);
+}
+
void ProjectManager::_panel_draw(Node *p_hb) {
HBoxContainer *hb = Object::cast_to<HBoxContainer>(p_hb);
@@ -1514,6 +1530,7 @@ void ProjectManager::_open_selected_projects() {
ERR_FAIL_COND(err);
}
+ _dim_window();
get_tree()->quit();
}
@@ -1780,11 +1797,13 @@ void ProjectManager::_restart_confirm() {
Error err = OS::get_singleton()->execute(exec, args, false, &pid);
ERR_FAIL_COND(err);
+ _dim_window();
get_tree()->quit();
}
void ProjectManager::_exit_dialog() {
+ _dim_window();
get_tree()->quit();
}