From 826415ad2f1ac60e421028089f64db3b5ef4e679 Mon Sep 17 00:00:00 2001 From: 31 <31eee384@gmail.com> Date: Wed, 25 May 2022 20:39:17 -0700 Subject: [PATCH] C#: Fix debugger options missing from Project Settings --- modules/mono/mono_gd/gd_mono.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/mono/mono_gd/gd_mono.cpp b/modules/mono/mono_gd/gd_mono.cpp index f3d446fbdb9..3860c53b249 100644 --- a/modules/mono/mono_gd/gd_mono.cpp +++ b/modules/mono/mono_gd/gd_mono.cpp @@ -157,6 +157,12 @@ void gd_mono_debug_init() { } #ifdef TOOLS_ENABLED + // Define debugger_agent settings even if we end up ignoring the current values. This makes sure + // they show up in Editor Settings. + int da_port = GLOBAL_DEF("mono/debugger_agent/port", 23685); + bool da_suspend = GLOBAL_DEF("mono/debugger_agent/wait_for_debugger", false); + int da_timeout = GLOBAL_DEF("mono/debugger_agent/wait_timeout", 3000); + if (Engine::get_singleton()->is_editor_hint() || ProjectSettings::get_singleton()->get_resource_path().empty() || Main::is_project_manager()) { @@ -167,10 +173,6 @@ void gd_mono_debug_init() { if (da_args.length() == 0) { // Use project settings defaults for the editor player - int da_port = GLOBAL_DEF("mono/debugger_agent/port", 23685); - bool da_suspend = GLOBAL_DEF("mono/debugger_agent/wait_for_debugger", false); - int da_timeout = GLOBAL_DEF("mono/debugger_agent/wait_timeout", 3000); - da_args = String("--debugger-agent=transport=dt_socket,address=127.0.0.1:" + itos(da_port) + ",embedding=1,server=y,suspend=" + (da_suspend ? "y,timeout=" + itos(da_timeout) : "n")) .utf8();