diff options
Diffstat (limited to 'main/main.cpp')
-rw-r--r-- | main/main.cpp | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/main/main.cpp b/main/main.cpp index 9014bfad29..5206e9b84c 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -245,6 +245,7 @@ static MovieWriter *movie_writer = nullptr; static bool disable_vsync = false; static bool print_fps = false; #ifdef TOOLS_ENABLED +static bool editor_pseudolocalization = false; static bool dump_gdextension_interface = false; static bool dump_extension_api = false; static bool include_docs_in_extension_api_dump = false; @@ -649,6 +650,9 @@ void Main::print_help(const char *p_binary) { print_help_option("--fixed-fps <fps>", "Force a fixed number of frames per second. This setting disables real-time synchronization.\n"); print_help_option("--delta-smoothing <enable>", "Enable or disable frame delta smoothing [\"enable\", \"disable\"].\n"); print_help_option("--print-fps", "Print the frames per second to the stdout.\n"); +#ifdef TOOLS_ENABLED + print_help_option("--editor-pseudolocalization", "Enable pseudolocalization for the editor and the project manager.\n"); +#endif print_help_title("Standalone tools"); print_help_option("-s, --script <script>", "Run a script.\n"); @@ -1716,6 +1720,10 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph disable_vsync = true; } else if (arg == "--print-fps") { print_fps = true; +#ifdef TOOLS_ENABLED + } else if (arg == "--editor-pseudolocalization") { + editor_pseudolocalization = true; +#endif // TOOLS_ENABLED } else if (arg == "--profile-gpu") { profile_gpu = true; } else if (arg == "--disable-crash-handler") { @@ -2755,7 +2763,6 @@ Error Main::setup2(bool p_show_boot_logo) { bool prefer_wayland_found = false; bool prefer_wayland = false; - bool remember_window_size_and_position_found = false; if (editor) { screen_property = "interface/editor/editor_screen"; @@ -2771,7 +2778,7 @@ Error Main::setup2(bool p_show_boot_logo) { prefer_wayland_found = true; } - while (!screen_found || !prefer_wayland_found || !remember_window_size_and_position_found) { + while (!screen_found || !prefer_wayland_found) { assign = Variant(); next_tag.fields.clear(); next_tag.name = String(); @@ -2785,17 +2792,16 @@ Error Main::setup2(bool p_show_boot_logo) { if (!screen_found && assign == screen_property) { init_screen = value; screen_found = true; + + if (editor) { + restore_editor_window_layout = value.operator int() == EditorSettings::InitialScreen::INITIAL_SCREEN_AUTO; + } } if (!prefer_wayland_found && assign == "run/platforms/linuxbsd/prefer_wayland") { prefer_wayland = value; prefer_wayland_found = true; } - - if (!remember_window_size_and_position_found && assign == "interface/editor/remember_window_size_and_position") { - restore_editor_window_layout = value; - remember_window_size_and_position_found = true; - } } } @@ -4008,6 +4014,11 @@ int Main::start() { if (editor) { OS::get_singleton()->benchmark_begin_measure("Startup", "Editor"); editor_node = memnew(EditorNode); + + if (editor_pseudolocalization) { + translation_server->get_editor_domain()->set_pseudolocalization_enabled(true); + } + sml->get_root()->add_child(editor_node); if (!_export_preset.is_empty()) { @@ -4095,8 +4106,7 @@ int Main::start() { if (editor_embed_subwindows) { sml->get_root()->set_embedding_subwindows(true); } - restore_editor_window_layout = EditorSettings::get_singleton()->get_setting( - "interface/editor/remember_window_size_and_position"); + restore_editor_window_layout = EditorSettings::get_singleton()->get_setting("interface/editor/editor_screen").operator int() == EditorSettings::InitialScreen::INITIAL_SCREEN_AUTO; } #endif @@ -4203,6 +4213,11 @@ int Main::start() { ProjectManager *pmanager = memnew(ProjectManager); ProgressDialog *progress_dialog = memnew(ProgressDialog); pmanager->add_child(progress_dialog); + + if (editor_pseudolocalization) { + translation_server->get_editor_domain()->set_pseudolocalization_enabled(true); + } + sml->get_root()->add_child(pmanager); OS::get_singleton()->benchmark_end_measure("Startup", "Project Manager"); } |