|
158 | 158 | #include "editor/plugins/visual_shader_editor_plugin.h" |
159 | 159 | #include "editor/progress_dialog.h" |
160 | 160 | #include "editor/project_settings_editor.h" |
| 161 | +#include "editor/project_upgrade_tool.h" |
161 | 162 | #include "editor/register_exporters.h" |
162 | 163 | #include "editor/scene_tree_dock.h" |
163 | | -#include "editor/surface_upgrade_tool.h" |
164 | 164 | #include "editor/themes/editor_scale.h" |
165 | 165 | #include "editor/themes/editor_theme_manager.h" |
166 | | -#include "editor/uid_upgrade_tool.h" |
167 | 166 | #include "editor/window_wrapper.h" |
168 | 167 |
|
169 | 168 | #include "modules/modules_enabled.gen.h" // For gdscript, mono. |
@@ -649,10 +648,7 @@ void EditorNode::_notification(int p_what) { |
649 | 648 |
|
650 | 649 | OS::get_singleton()->benchmark_begin_measure("Editor", "First Scan"); |
651 | 650 |
|
652 | | - if (run_surface_upgrade_tool || run_uid_upgrade_tool) { |
653 | | - EditorFileSystem::get_singleton()->connect("filesystem_changed", callable_mp(this, &EditorNode::_execute_upgrades), CONNECT_ONE_SHOT); |
654 | | - } |
655 | | - |
| 651 | + EditorFileSystem::get_singleton()->connect("filesystem_changed", callable_mp(this, &EditorNode::_execute_upgrades), CONNECT_ONE_SHOT); |
656 | 652 | EditorFileSystem::get_singleton()->scan(); |
657 | 653 | } |
658 | 654 | } break; |
@@ -735,23 +731,6 @@ void EditorNode::_notification(int p_what) { |
735 | 731 |
|
736 | 732 | // Save the project after opening to mark it as last modified, except in headless mode. |
737 | 733 | if (DisplayServer::get_singleton()->window_can_draw()) { |
738 | | - // Try to determine if this project's Godot version was less than 4.4 - if |
739 | | - // so, we'll ask the user if they want to upgrade the project. |
740 | | - PackedStringArray features = ProjectSettings::get_singleton()->get_setting("application/config/features"); |
741 | | - if (!features.is_empty()) { |
742 | | - String version_str = features[0]; |
743 | | - PackedStringArray version_parts = version_str.split(".", true, 1); |
744 | | - if (version_parts.size() >= 2) { |
745 | | - if (version_parts[0].is_valid_int() && version_parts[1].is_valid_int()) { |
746 | | - int major_ver = version_parts[0].to_int(); |
747 | | - int minor_ver = version_parts[1].to_int(); |
748 | | - if (major_ver < 4 || (major_ver == 4 && minor_ver < 4)) { |
749 | | - should_prompt_uid_upgrade_tool = true; |
750 | | - } |
751 | | - } |
752 | | - } |
753 | | - } |
754 | | - |
755 | 734 | ProjectSettings::get_singleton()->save(); |
756 | 735 | } |
757 | 736 |
|
@@ -896,16 +875,11 @@ void EditorNode::_update_update_spinner() { |
896 | 875 | } |
897 | 876 |
|
898 | 877 | void EditorNode::_execute_upgrades() { |
899 | | - if (run_surface_upgrade_tool) { |
900 | | - run_surface_upgrade_tool = false; |
| 878 | + if (run_project_upgrade_tool) { |
| 879 | + run_project_upgrade_tool = false; |
901 | 880 | // Execute another scan to reimport the modified files. |
902 | | - SurfaceUpgradeTool::get_singleton()->connect("upgrade_finished", callable_mp(EditorFileSystem::get_singleton(), &EditorFileSystem::scan), CONNECT_ONE_SHOT); |
903 | | - SurfaceUpgradeTool::get_singleton()->finish_upgrade(); |
904 | | - } else if (run_uid_upgrade_tool) { |
905 | | - run_uid_upgrade_tool = false; |
906 | | - // Execute another scan to reimport the modified files. |
907 | | - UIDUpgradeTool::get_singleton()->connect("upgrade_finished", callable_mp(EditorFileSystem::get_singleton(), &EditorFileSystem::scan), CONNECT_ONE_SHOT); |
908 | | - UIDUpgradeTool::get_singleton()->finish_upgrade(); |
| 881 | + project_upgrade_tool->connect(project_upgrade_tool->UPGRADE_FINISHED, callable_mp(EditorFileSystem::get_singleton(), &EditorFileSystem::scan), CONNECT_ONE_SHOT); |
| 882 | + project_upgrade_tool->finish_upgrade(); |
909 | 883 | } |
910 | 884 | } |
911 | 885 |
|
@@ -1202,20 +1176,10 @@ void EditorNode::_sources_changed(bool p_exist) { |
1202 | 1176 | OS::get_singleton()->benchmark_dump(); |
1203 | 1177 | } |
1204 | 1178 |
|
1205 | | - if (SurfaceUpgradeTool::get_singleton()->is_show_requested()) { |
1206 | | - SurfaceUpgradeTool::get_singleton()->show_popup(); |
1207 | | - } |
1208 | | - |
1209 | 1179 | // Start preview thread now that it's safe. |
1210 | 1180 | if (!singleton->cmdline_mode) { |
1211 | 1181 | EditorResourcePreview::get_singleton()->start(); |
1212 | 1182 | } |
1213 | | - |
1214 | | - if (should_prompt_uid_upgrade_tool) { |
1215 | | - should_prompt_uid_upgrade_tool = false; |
1216 | | - uid_upgrade_dialog->popup_on_demand(); |
1217 | | - } |
1218 | | - |
1219 | 1183 | get_tree()->create_timer(1.0f)->connect("timeout", callable_mp(this, &EditorNode::_remove_lock_file)); |
1220 | 1184 | } |
1221 | 1185 | } |
@@ -3349,11 +3313,8 @@ void EditorNode::_tool_menu_option(int p_idx) { |
3349 | 3313 | case TOOLS_BUILD_PROFILE_MANAGER: { |
3350 | 3314 | build_profile_manager->popup_centered_clamped(Size2(700, 800) * EDSCALE, 0.8); |
3351 | 3315 | } break; |
3352 | | - case TOOLS_SURFACE_UPGRADE: { |
3353 | | - surface_upgrade_dialog->popup_on_demand(); |
3354 | | - } break; |
3355 | | - case TOOLS_UID_UPGRADE: { |
3356 | | - uid_upgrade_dialog->popup_on_demand(); |
| 3316 | + case TOOLS_PROJECT_UPGRADE: { |
| 3317 | + project_upgrade_tool->popup_dialog(); |
3357 | 3318 | } break; |
3358 | 3319 | case TOOLS_CUSTOM: { |
3359 | 3320 | if (tool_menu->get_item_submenu(p_idx) == "") { |
@@ -6963,18 +6924,11 @@ EditorNode::EditorNode() { |
6963 | 6924 |
|
6964 | 6925 | _update_vsync_mode(); |
6965 | 6926 |
|
6966 | | - // Warm up the surface upgrade tool as early as possible. |
6967 | | - surface_upgrade_tool = memnew(SurfaceUpgradeTool); |
6968 | | - run_surface_upgrade_tool = EditorSettings::get_singleton()->get_project_metadata("surface_upgrade_tool", "run_on_restart", false); |
6969 | | - if (run_surface_upgrade_tool) { |
6970 | | - SurfaceUpgradeTool::get_singleton()->begin_upgrade(); |
6971 | | - } |
6972 | | - |
6973 | | - // Same for UID upgrade tool. |
6974 | | - uid_upgrade_tool = memnew(UIDUpgradeTool); |
6975 | | - run_uid_upgrade_tool = EditorSettings::get_singleton()->get_project_metadata(UIDUpgradeTool::META_UID_UPGRADE_TOOL, UIDUpgradeTool::META_RUN_ON_RESTART, false); |
6976 | | - if (run_uid_upgrade_tool) { |
6977 | | - UIDUpgradeTool::get_singleton()->begin_upgrade(); |
| 6927 | + // Warm up the project upgrade tool as early as possible. |
| 6928 | + project_upgrade_tool = memnew(ProjectUpgradeTool); |
| 6929 | + run_project_upgrade_tool = EditorSettings::get_singleton()->get_project_metadata(project_upgrade_tool->META_PROJECT_UPGRADE_TOOL, project_upgrade_tool->META_RUN_ON_RESTART, false); |
| 6930 | + if (run_project_upgrade_tool) { |
| 6931 | + project_upgrade_tool->begin_upgrade(); |
6978 | 6932 | } |
6979 | 6933 |
|
6980 | 6934 | { |
@@ -7518,8 +7472,7 @@ EditorNode::EditorNode() { |
7518 | 7472 | project_menu->add_submenu_node_item(TTR("Tools"), tool_menu); |
7519 | 7473 | tool_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/orphan_resource_explorer", TTRC("Orphan Resource Explorer...")), TOOLS_ORPHAN_RESOURCES); |
7520 | 7474 | tool_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/engine_compilation_configuration_editor", TTRC("Engine Compilation Configuration Editor...")), TOOLS_BUILD_PROFILE_MANAGER); |
7521 | | - tool_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/upgrade_mesh_surfaces", TTRC("Upgrade Mesh Surfaces...")), TOOLS_SURFACE_UPGRADE); |
7522 | | - tool_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/upgrade_uids", TTRC("Upgrade UIDs...")), TOOLS_UID_UPGRADE); |
| 7475 | + tool_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/upgrade_project", TTRC("Upgrade Project Files...")), TOOLS_PROJECT_UPGRADE); |
7523 | 7476 |
|
7524 | 7477 | project_menu->add_separator(); |
7525 | 7478 | project_menu->add_shortcut(ED_SHORTCUT("editor/reload_current_project", TTRC("Reload Current Project")), PROJECT_RELOAD_CURRENT_PROJECT); |
@@ -7797,12 +7750,6 @@ EditorNode::EditorNode() { |
7797 | 7750 | orphan_resources = memnew(OrphanResourcesDialog); |
7798 | 7751 | gui_base->add_child(orphan_resources); |
7799 | 7752 |
|
7800 | | - surface_upgrade_dialog = memnew(SurfaceUpgradeDialog); |
7801 | | - gui_base->add_child(surface_upgrade_dialog); |
7802 | | - |
7803 | | - uid_upgrade_dialog = memnew(UIDUpgradeDialog); |
7804 | | - gui_base->add_child(uid_upgrade_dialog); |
7805 | | - |
7806 | 7753 | confirmation = memnew(ConfirmationDialog); |
7807 | 7754 | gui_base->add_child(confirmation); |
7808 | 7755 | confirmation->connect(SceneStringName(confirmed), callable_mp(this, &EditorNode::_menu_confirm_current)); |
@@ -8196,8 +8143,7 @@ EditorNode::~EditorNode() { |
8196 | 8143 | memdelete(editor_plugins_force_over); |
8197 | 8144 | memdelete(editor_plugins_force_input_forwarding); |
8198 | 8145 | memdelete(progress_hb); |
8199 | | - memdelete(surface_upgrade_tool); |
8200 | | - memdelete(uid_upgrade_tool); |
| 8146 | + memdelete(project_upgrade_tool); |
8201 | 8147 | memdelete(editor_dock_manager); |
8202 | 8148 |
|
8203 | 8149 | EditorSettings::destroy(); |
|
0 commit comments