summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/main.cpp39
1 files changed, 37 insertions, 2 deletions
diff --git a/main/main.cpp b/main/main.cpp
index 15166ce152..50add16f3d 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -87,6 +87,7 @@
#include "editor/editor_settings.h"
#include "editor/editor_translation.h"
#include "editor/progress_dialog.h"
+#include "editor/project_converter_3_to_4.h"
#include "editor/project_manager.h"
#ifndef NO_EDITOR_SPLASH
#include "main/splash_editor.gen.h"
@@ -368,6 +369,8 @@ void Main::print_help(const char *p_binary) {
OS::get_singleton()->print(" <path> should be absolute or relative to the project directory, and include the filename for the binary (e.g. 'builds/game.exe'). The target directory should exist.\n");
OS::get_singleton()->print(" --export-debug <preset> <path> Same as --export, but using the debug template.\n");
OS::get_singleton()->print(" --export-pack <preset> <path> Same as --export, but only export the game pack for the given preset. The <path> extension determines whether it will be in PCK or ZIP format.\n");
+ OS::get_singleton()->print(" --convert-3to4 Converts project from Godot 3.x to Godot 4.x.\n");
+ OS::get_singleton()->print(" --validate-conversion-3to4 Shows what elements will be renamed when converting project from Godot 3.x to Godot 4.x.\n");
OS::get_singleton()->print(" --doctool [<path>] Dump the engine API reference to the given <path> (defaults to current dir) in XML format, merging if existing files are found.\n");
OS::get_singleton()->print(" --no-docbase Disallow dumping the base types (used with --doctool).\n");
OS::get_singleton()->print(" --build-solutions Build the scripting solutions (e.g. for C# projects). Implies --editor and requires a valid project to edit.\n");
@@ -600,7 +603,9 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
GLOBAL_DEF_RST("application/run/flush_stdout_on_print.debug", true);
GLOBAL_DEF("debug/settings/crash_handler/message",
- String("Please include this when reporting the bug on https://github.com/godotengine/godot/issues"));
+ String("Please include this when reporting the bug to the project developer."));
+ GLOBAL_DEF("debug/settings/crash_handler/message.editor",
+ String("Please include this when reporting the bug on: https://github.com/godotengine/godot/issues"));
MAIN_PRINT("Main: Parse CMDLine");
@@ -996,6 +1001,14 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
editor = true;
cmdline_tool = true;
main_args.push_back(I->get());
+ } else if (I->get() == "--convert-3to4") {
+ // Actually handling is done in start().
+ cmdline_tool = true;
+ main_args.push_back(I->get());
+ } else if (I->get() == "--validate-conversion-3to4") {
+ // Actually handling is done in start().
+ cmdline_tool = true;
+ main_args.push_back(I->get());
} else if (I->get() == "--doctool") {
// Actually handling is done in start().
cmdline_tool = true;
@@ -1496,7 +1509,11 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
"0,33200,1,or_greater")); // No negative numbers
GLOBAL_DEF("display/window/ios/hide_home_indicator", true);
- GLOBAL_DEF("input_devices/pointing/ios/touch_delay", 0.150);
+ GLOBAL_DEF("input_devices/pointing/ios/touch_delay", 0.15);
+ ProjectSettings::get_singleton()->set_custom_property_info("input_devices/pointing/ios/touch_delay",
+ PropertyInfo(Variant::FLOAT,
+ "input_devices/pointing/ios/touch_delay",
+ PROPERTY_HINT_RANGE, "0,1,0.001"));
// XR project settings.
GLOBAL_DEF_RST_BASIC("xr/openxr/enabled", false);
@@ -2035,6 +2052,8 @@ bool Main::start() {
String _export_preset;
bool export_debug = false;
bool export_pack_only = false;
+ bool converting_project = false;
+ bool validating_converting_project = false;
#endif
main_timer_sync.init(OS::get_singleton()->get_ticks_usec());
@@ -2050,6 +2069,10 @@ bool Main::start() {
#ifdef TOOLS_ENABLED
} else if (args[i] == "--no-docbase") {
doc_base = false;
+ } else if (args[i] == "--convert-3to4") {
+ converting_project = true;
+ } else if (args[i] == "--validate-conversion-3to4") {
+ validating_converting_project = true;
} else if (args[i] == "-e" || args[i] == "--editor") {
editor = true;
} else if (args[i] == "-p" || args[i] == "--project-manager") {
@@ -2203,6 +2226,18 @@ bool Main::start() {
NativeExtensionAPIDump::generate_extension_json_file("extension_api.json");
return false;
}
+
+ if (converting_project) {
+ int exit_code = ProjectConverter3To4().convert();
+ OS::get_singleton()->set_exit_code(exit_code);
+ return false;
+ }
+ if (validating_converting_project) {
+ int exit_code = ProjectConverter3To4().validate_conversion();
+ OS::get_singleton()->set_exit_code(exit_code);
+ return false;
+ }
+
#endif
if (script.is_empty() && game_path.is_empty() && String(GLOBAL_GET("application/run/main_scene")) != "") {