|
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. |
@@ -653,10 +652,7 @@ void EditorNode::_notification(int p_what) { |
653 | 652 |
|
654 | 653 | OS::get_singleton()->benchmark_begin_measure("Editor", "First Scan"); |
655 | 654 |
|
656 | | - if (run_surface_upgrade_tool || run_uid_upgrade_tool) { |
657 | | - EditorFileSystem::get_singleton()->connect("filesystem_changed", callable_mp(this, &EditorNode::_execute_upgrades), CONNECT_ONE_SHOT); |
658 | | - } |
659 | | - |
| 655 | + EditorFileSystem::get_singleton()->connect("filesystem_changed", callable_mp(this, &EditorNode::_execute_upgrades), CONNECT_ONE_SHOT); |
660 | 656 | EditorFileSystem::get_singleton()->scan(); |
661 | 657 | } |
662 | 658 | } break; |
@@ -739,23 +735,6 @@ void EditorNode::_notification(int p_what) { |
739 | 735 |
|
740 | 736 | // Save the project after opening to mark it as last modified, except in headless mode. |
741 | 737 | if (DisplayServer::get_singleton()->window_can_draw()) { |
742 | | - // Try to determine if this project's Godot version was less than 4.4 - if |
743 | | - // so, we'll ask the user if they want to upgrade the project. |
744 | | - PackedStringArray features = ProjectSettings::get_singleton()->get_setting("application/config/features"); |
745 | | - if (!features.is_empty()) { |
746 | | - String version_str = features[0]; |
747 | | - PackedStringArray version_parts = version_str.split(".", true, 1); |
748 | | - if (version_parts.size() >= 2) { |
749 | | - if (version_parts[0].is_valid_int() && version_parts[1].is_valid_int()) { |
750 | | - int major_ver = version_parts[0].to_int(); |
751 | | - int minor_ver = version_parts[1].to_int(); |
752 | | - if (major_ver < 4 || (major_ver == 4 && minor_ver < 4)) { |
753 | | - should_prompt_uid_upgrade_tool = true; |
754 | | - } |
755 | | - } |
756 | | - } |
757 | | - } |
758 | | - |
759 | 738 | ProjectSettings::get_singleton()->save(); |
760 | 739 | } |
761 | 740 |
|
@@ -900,16 +879,11 @@ void EditorNode::_update_update_spinner() { |
900 | 879 | } |
901 | 880 |
|
902 | 881 | void EditorNode::_execute_upgrades() { |
903 | | - if (run_surface_upgrade_tool) { |
904 | | - run_surface_upgrade_tool = false; |
| 882 | + if (run_project_upgrade_tool) { |
| 883 | + run_project_upgrade_tool = false; |
905 | 884 | // Execute another scan to reimport the modified files. |
906 | | - SurfaceUpgradeTool::get_singleton()->connect("upgrade_finished", callable_mp(EditorFileSystem::get_singleton(), &EditorFileSystem::scan), CONNECT_ONE_SHOT); |
907 | | - SurfaceUpgradeTool::get_singleton()->finish_upgrade(); |
908 | | - } else if (run_uid_upgrade_tool) { |
909 | | - run_uid_upgrade_tool = false; |
910 | | - // Execute another scan to reimport the modified files. |
911 | | - UIDUpgradeTool::get_singleton()->connect("upgrade_finished", callable_mp(EditorFileSystem::get_singleton(), &EditorFileSystem::scan), CONNECT_ONE_SHOT); |
912 | | - UIDUpgradeTool::get_singleton()->finish_upgrade(); |
| 885 | + project_upgrade_tool->connect(project_upgrade_tool->UPGRADE_FINISHED, callable_mp(EditorFileSystem::get_singleton(), &EditorFileSystem::scan), CONNECT_ONE_SHOT); |
| 886 | + project_upgrade_tool->finish_upgrade(); |
913 | 887 | } |
914 | 888 | } |
915 | 889 |
|
@@ -1206,20 +1180,10 @@ void EditorNode::_sources_changed(bool p_exist) { |
1206 | 1180 | OS::get_singleton()->benchmark_dump(); |
1207 | 1181 | } |
1208 | 1182 |
|
1209 | | - if (SurfaceUpgradeTool::get_singleton()->is_show_requested()) { |
1210 | | - SurfaceUpgradeTool::get_singleton()->show_popup(); |
1211 | | - } |
1212 | | - |
1213 | 1183 | // Start preview thread now that it's safe. |
1214 | 1184 | if (!singleton->cmdline_mode) { |
1215 | 1185 | EditorResourcePreview::get_singleton()->start(); |
1216 | 1186 | } |
1217 | | - |
1218 | | - if (should_prompt_uid_upgrade_tool) { |
1219 | | - should_prompt_uid_upgrade_tool = false; |
1220 | | - uid_upgrade_dialog->popup_on_demand(); |
1221 | | - } |
1222 | | - |
1223 | 1187 | get_tree()->create_timer(1.0f)->connect("timeout", callable_mp(this, &EditorNode::_remove_lock_file)); |
1224 | 1188 | } |
1225 | 1189 | } |
@@ -3353,11 +3317,8 @@ void EditorNode::_tool_menu_option(int p_idx) { |
3353 | 3317 | case TOOLS_BUILD_PROFILE_MANAGER: { |
3354 | 3318 | build_profile_manager->popup_centered_clamped(Size2(700, 800) * EDSCALE, 0.8); |
3355 | 3319 | } break; |
3356 | | - case TOOLS_SURFACE_UPGRADE: { |
3357 | | - surface_upgrade_dialog->popup_on_demand(); |
3358 | | - } break; |
3359 | | - case TOOLS_UID_UPGRADE: { |
3360 | | - uid_upgrade_dialog->popup_on_demand(); |
| 3320 | + case TOOLS_PROJECT_UPGRADE: { |
| 3321 | + project_upgrade_tool->popup_dialog(); |
3361 | 3322 | } break; |
3362 | 3323 | case TOOLS_CUSTOM: { |
3363 | 3324 | if (tool_menu->get_item_submenu(p_idx) == "") { |
@@ -6967,18 +6928,11 @@ EditorNode::EditorNode() { |
6967 | 6928 |
|
6968 | 6929 | _update_vsync_mode(); |
6969 | 6930 |
|
6970 | | - // Warm up the surface upgrade tool as early as possible. |
6971 | | - surface_upgrade_tool = memnew(SurfaceUpgradeTool); |
6972 | | - run_surface_upgrade_tool = EditorSettings::get_singleton()->get_project_metadata("surface_upgrade_tool", "run_on_restart", false); |
6973 | | - if (run_surface_upgrade_tool) { |
6974 | | - SurfaceUpgradeTool::get_singleton()->begin_upgrade(); |
6975 | | - } |
6976 | | - |
6977 | | - // Same for UID upgrade tool. |
6978 | | - uid_upgrade_tool = memnew(UIDUpgradeTool); |
6979 | | - run_uid_upgrade_tool = EditorSettings::get_singleton()->get_project_metadata(UIDUpgradeTool::META_UID_UPGRADE_TOOL, UIDUpgradeTool::META_RUN_ON_RESTART, false); |
6980 | | - if (run_uid_upgrade_tool) { |
6981 | | - UIDUpgradeTool::get_singleton()->begin_upgrade(); |
| 6931 | + // Warm up the project upgrade tool as early as possible. |
| 6932 | + project_upgrade_tool = memnew(ProjectUpgradeTool); |
| 6933 | + 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); |
| 6934 | + if (run_project_upgrade_tool) { |
| 6935 | + project_upgrade_tool->begin_upgrade(); |
6982 | 6936 | } |
6983 | 6937 |
|
6984 | 6938 | { |
@@ -7522,8 +7476,7 @@ EditorNode::EditorNode() { |
7522 | 7476 | project_menu->add_submenu_node_item(TTR("Tools"), tool_menu); |
7523 | 7477 | tool_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/orphan_resource_explorer", TTRC("Orphan Resource Explorer...")), TOOLS_ORPHAN_RESOURCES); |
7524 | 7478 | tool_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/engine_compilation_configuration_editor", TTRC("Engine Compilation Configuration Editor...")), TOOLS_BUILD_PROFILE_MANAGER); |
7525 | | - tool_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/upgrade_mesh_surfaces", TTRC("Upgrade Mesh Surfaces...")), TOOLS_SURFACE_UPGRADE); |
7526 | | - tool_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/upgrade_uids", TTRC("Upgrade UIDs...")), TOOLS_UID_UPGRADE); |
| 7479 | + tool_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/upgrade_project", TTRC("Upgrade Project Files...")), TOOLS_PROJECT_UPGRADE); |
7527 | 7480 |
|
7528 | 7481 | project_menu->add_separator(); |
7529 | 7482 | project_menu->add_shortcut(ED_SHORTCUT("editor/reload_current_project", TTRC("Reload Current Project")), PROJECT_RELOAD_CURRENT_PROJECT); |
@@ -7806,12 +7759,6 @@ EditorNode::EditorNode() { |
7806 | 7759 | orphan_resources = memnew(OrphanResourcesDialog); |
7807 | 7760 | gui_base->add_child(orphan_resources); |
7808 | 7761 |
|
7809 | | - surface_upgrade_dialog = memnew(SurfaceUpgradeDialog); |
7810 | | - gui_base->add_child(surface_upgrade_dialog); |
7811 | | - |
7812 | | - uid_upgrade_dialog = memnew(UIDUpgradeDialog); |
7813 | | - gui_base->add_child(uid_upgrade_dialog); |
7814 | | - |
7815 | 7762 | confirmation = memnew(ConfirmationDialog); |
7816 | 7763 | gui_base->add_child(confirmation); |
7817 | 7764 | confirmation->connect(SceneStringName(confirmed), callable_mp(this, &EditorNode::_menu_confirm_current)); |
@@ -8205,8 +8152,7 @@ EditorNode::~EditorNode() { |
8205 | 8152 | memdelete(editor_plugins_force_over); |
8206 | 8153 | memdelete(editor_plugins_force_input_forwarding); |
8207 | 8154 | memdelete(progress_hb); |
8208 | | - memdelete(surface_upgrade_tool); |
8209 | | - memdelete(uid_upgrade_tool); |
| 8155 | + memdelete(project_upgrade_tool); |
8210 | 8156 | memdelete(editor_dock_manager); |
8211 | 8157 |
|
8212 | 8158 | EditorSettings::destroy(); |
|
0 commit comments