Skip to content

Commit b4627b7

Browse files
committed
Added "See Migration Guide" button to the Project Manager
1 parent 88b9932 commit b4627b7

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

editor/project_manager.cpp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,9 @@ void ProjectManager::_update_theme(bool p_skip_creation) {
288288
open_options_popup->set_item_icon(1, get_editor_theme_icon(SNAME("NodeWarning")));
289289
}
290290

291+
// Dialogs
292+
migration_guide_button->set_button_icon(get_editor_theme_icon(SNAME("ExternalLink")));
293+
291294
// Asset library popup.
292295
if (asset_library) {
293296
// Removes extra border margins.
@@ -567,6 +570,7 @@ void ProjectManager::_open_selected_projects_check_warnings() {
567570
ask_update_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_LEFT); // Reset in case of previous center align.
568571
ask_update_backup->set_pressed(false);
569572
full_convert_button->hide();
573+
migration_guide_button->hide();
570574
ask_update_backup->hide();
571575

572576
ask_update_settings->get_ok_button()->set_text("OK");
@@ -581,14 +585,14 @@ void ProjectManager::_open_selected_projects_check_warnings() {
581585
if (config_version < ProjectSettings::CONFIG_VERSION) {
582586
if (config_version == GODOT4_CONFIG_VERSION - 1 && ProjectSettings::CONFIG_VERSION == GODOT4_CONFIG_VERSION) { // Conversion from Godot 3 to 4.
583587
full_convert_button->show();
584-
ask_update_backup->show();
585588
ask_update_label->set_text(vformat(TTR("The selected project \"%s\" was generated by Godot 3.x, and needs to be converted for Godot 4.x.\n\nProject path: %s\n\nYou have three options:\n- Convert only the configuration file (\"project.godot\"). Use this to open the project without attempting to convert its scenes, resources and scripts.\n- Convert the entire project including its scenes, resources and scripts (recommended if you are upgrading).\n- Do nothing and go back.\n\nWarning: If you select a conversion option, you won't be able to open the project with previous versions of the engine anymore."), project.project_name, project.path));
586589
ask_update_settings->get_ok_button()->set_text(TTRC("Convert project.godot Only"));
587590
} else {
588-
ask_update_backup->show();
589591
ask_update_label->set_text(vformat(TTR("The selected project \"%s\" was generated by an older engine version, and needs to be converted for this version.\n\nProject path: %s\n\nDo you want to convert it?\n\nWarning: You won't be able to open the project with previous versions of the engine anymore."), project.project_name, project.path));
590592
ask_update_settings->get_ok_button()->set_text(TTRC("Convert project.godot"));
591593
}
594+
ask_update_backup->show();
595+
migration_guide_button->show();
592596
ask_update_settings->popup_centered(popup_min_size);
593597
ask_update_settings->get_cancel_button()->grab_focus(); // To prevent accidents.
594598
return;
@@ -614,6 +618,7 @@ void ProjectManager::_open_selected_projects_check_warnings() {
614618
i--;
615619
} else if (ProjectList::project_feature_looks_like_version(feature)) {
616620
ask_update_backup->show();
621+
migration_guide_button->show();
617622
version_convert_feature = feature;
618623
warning_message += vformat(TTR("Warning: This project was last edited in Godot %s. Opening will change it to Godot %s.\n\n"), Variant(feature), Variant(GODOT_VERSION_BRANCH));
619624
unsupported_features.remove_at(i);
@@ -1088,6 +1093,11 @@ void ProjectManager::_full_convert_button_pressed() {
10881093
ask_full_convert_dialog->get_cancel_button()->grab_focus();
10891094
}
10901095

1096+
void ProjectManager::_migration_guide_button_pressed() {
1097+
const String url = vformat("%s/tutorials/migrating/index.html", GODOT_VERSION_DOCS_URL);
1098+
OS::get_singleton()->shell_open(url);
1099+
}
1100+
10911101
void ProjectManager::_perform_full_project_conversion() {
10921102
Vector<ProjectList::Item> selected_list = project_list->get_selected_projects();
10931103
if (selected_list.is_empty()) {
@@ -1728,6 +1738,8 @@ ProjectManager::ProjectManager() {
17281738
}
17291739
full_convert_button = ask_update_settings->add_button(TTRC("Convert Full Project"), ed_swap_cancel_ok != 2);
17301740
full_convert_button->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_full_convert_button_pressed));
1741+
migration_guide_button = ask_update_settings->add_button(TTRC("See Migration Guide"), ed_swap_cancel_ok != 2);
1742+
migration_guide_button->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_migration_guide_button_pressed));
17311743

17321744
ask_full_convert_dialog = memnew(ConfirmationDialog);
17331745
ask_full_convert_dialog->set_autowrap(true);

editor/project_manager.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ class ProjectManager : public Control {
244244
Label *ask_update_label = nullptr;
245245
CheckBox *ask_update_backup = nullptr;
246246
Button *full_convert_button = nullptr;
247+
Button *migration_guide_button = nullptr;
247248

248249
String version_convert_feature;
249250
bool open_in_recovery_mode = false;
@@ -253,6 +254,7 @@ class ProjectManager : public Control {
253254
void _minor_project_migrate();
254255
#endif
255256
void _full_convert_button_pressed();
257+
void _migration_guide_button_pressed();
256258
void _perform_full_project_conversion();
257259

258260
// Input and I/O.

0 commit comments

Comments
 (0)