diff options
Diffstat (limited to 'main/main.cpp')
-rw-r--r-- | main/main.cpp | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/main/main.cpp b/main/main.cpp index 75797e31de..9014bfad29 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -612,7 +612,9 @@ void Main::print_help(const char *p_binary) { print_help_option("--position <X>,<Y>", "Request window position.\n"); print_help_option("--screen <N>", "Request window screen.\n"); print_help_option("--single-window", "Use a single window (no separate subwindows).\n"); +#ifndef _3D_DISABLED print_help_option("--xr-mode <mode>", "Select XR (Extended Reality) mode [\"default\", \"off\", \"on\"].\n"); +#endif print_help_title("Debug options"); print_help_option("-d, --debug", "Debug (local stdout debugger).\n"); @@ -659,6 +661,8 @@ void Main::print_help(const char *p_binary) { print_help_option("", "The target directory must exist.\n"); print_help_option("--export-debug <preset> <path>", "Export the project in debug mode using the given preset and output path. See --export-release description for other considerations.\n", CLI_OPTION_AVAILABILITY_EDITOR); print_help_option("--export-pack <preset> <path>", "Export the project data only using the given preset and output path. The <path> extension determines whether it will be in PCK or ZIP format.\n", CLI_OPTION_AVAILABILITY_EDITOR); + print_help_option("--export-patch <preset> <path>", "Export pack with changed files only. See --export-pack description for other considerations.\n", CLI_OPTION_AVAILABILITY_EDITOR); + print_help_option("--patches <paths>", "List of patches to use with --export-patch. The list is comma-separated.\n", CLI_OPTION_AVAILABILITY_EDITOR); print_help_option("--install-android-build-template", "Install the Android build template. Used in conjunction with --export-release or --export-debug.\n", CLI_OPTION_AVAILABILITY_EDITOR); #ifndef DISABLE_DEPRECATED // Commands are long; split the description to a second line. @@ -1478,12 +1482,23 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph wait_for_import = true; quit_after = 1; } else if (arg == "--export-release" || arg == "--export-debug" || - arg == "--export-pack") { // Export project + arg == "--export-pack" || arg == "--export-patch") { // Export project // Actually handling is done in start(). editor = true; cmdline_tool = true; wait_for_import = true; main_args.push_back(arg); + } else if (arg == "--patches") { + if (N) { + // Actually handling is done in start(). + main_args.push_back(arg); + main_args.push_back(N->get()); + + N = N->next(); + } else { + OS::get_singleton()->print("Missing comma-separated list of patches after --patches, aborting.\n"); + goto error; + } #ifndef DISABLE_DEPRECATED } else if (arg == "--export") { // For users used to 3.x syntax. OS::get_singleton()->print("The Godot 3 --export option was changed to more explicit --export-release / --export-debug / --export-pack options.\nSee the --help output for details.\n"); @@ -2558,6 +2573,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph GLOBAL_DEF("display/window/ios/hide_status_bar", true); GLOBAL_DEF("display/window/ios/suppress_ui_gesture", true); +#ifndef _3D_DISABLED // XR project settings. GLOBAL_DEF_RST_BASIC("xr/openxr/enabled", false); GLOBAL_DEF_BASIC(PropertyInfo(Variant::STRING, "xr/openxr/default_action_map", PROPERTY_HINT_FILE, "*.tres"), "res://openxr_action_map.tres"); @@ -2586,7 +2602,8 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph // editor settings (it seems we're too early in the process when setting up rendering, to access editor settings...) // EDITOR_DEF_RST("xr/openxr/in_editor", false); // GLOBAL_DEF("xr/openxr/in_editor", false); -#endif +#endif // TOOLS_ENABLED +#endif // _3D_DISABLED Engine::get_singleton()->set_frame_delay(frame_delay); @@ -3489,9 +3506,11 @@ int Main::start() { bool doc_tool_implicit_cwd = false; BitField<DocTools::GenerateFlags> gen_flags; String _export_preset; + Vector<String> patches; bool export_debug = false; bool export_pack_only = false; bool install_android_build_template = false; + bool export_patch = false; #ifdef MODULE_GDSCRIPT_ENABLED String gdscript_docs_path; #endif @@ -3581,6 +3600,14 @@ int Main::start() { editor = true; _export_preset = E->next()->get(); export_pack_only = true; + } else if (E->get() == "--export-patch") { + ERR_FAIL_COND_V_MSG(!editor && !found_project, EXIT_FAILURE, "Please provide a valid project path when exporting, aborting."); + editor = true; + _export_preset = E->next()->get(); + export_pack_only = true; + export_patch = true; + } else if (E->get() == "--patches") { + patches = E->next()->get().split(",", false); #endif } else { // The parameter does not match anything known, don't skip the next argument @@ -3984,7 +4011,7 @@ int Main::start() { sml->get_root()->add_child(editor_node); if (!_export_preset.is_empty()) { - editor_node->export_preset(_export_preset, positional_arg, export_debug, export_pack_only, install_android_build_template); + editor_node->export_preset(_export_preset, positional_arg, export_debug, export_pack_only, install_android_build_template, export_patch, patches); game_path = ""; // Do not load anything. } |