From ad504b926f9a0cfabde78254f6a4b40901cb8592 Mon Sep 17 00:00:00 2001 From: Luka Dornhecker Date: Tue, 18 Dec 2018 14:17:43 +0100 Subject: Add option to toggle console window on Windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is an editor setting and its value can also be toggled using an entry in the Editor toolbar. The console will still appear briefly when starting the project manager or editor, as it's still compiled as console application. Does not impact exported games, which will still run without console in release and with console in debug mode. A project setting or export option could be added to disable it in debug mode if there's demand for it, but that would greatly reduce the usefulness of debug builds if Windows users can no longer report error and crash messages. Fixes #17889. Co-authored-by: Rémi Verschelde --- main/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'main/main.cpp') diff --git a/main/main.cpp b/main/main.cpp index c51ffd9124..c765ff9700 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -1797,6 +1797,7 @@ bool Main::start() { pmanager->add_child(progress_dialog); sml->get_root()->add_child(pmanager); OS::get_singleton()->set_context(OS::CONTEXT_PROJECTMAN); + project_manager = true; } if (project_manager || editor) { @@ -1806,6 +1807,10 @@ bool Main::start() { StreamPeerSSL::load_certs_from_file(certs); else StreamPeerSSL::load_certs_from_memory(StreamPeerSSL::get_project_cert_array()); + + // Hide console window if requested (Windows-only) + bool hide_console = EditorSettings::get_singleton()->get_setting("interface/editor/hide_console_window"); + OS::get_singleton()->set_console_visible(!hide_console); } #endif } -- cgit v1.2.3