Skip to content

Commit

Permalink
Merge pull request #16749 from PJB3005/18-02-16-project-manager-mono-…
Browse files Browse the repository at this point in the history
…debug-fix

Makes project manager never initialize mono debug.
  • Loading branch information
neikeq authored Feb 18, 2018
2 parents e380a98 + 1099838 commit dad47d8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 17 deletions.
7 changes: 6 additions & 1 deletion main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,18 @@ static bool force_lowdpi = false;
static int init_screen = -1;
static bool use_vsync = true;
static bool editor = false;
static bool project_manager = false;
static bool show_help = false;
static bool disable_render_loop = false;
static int fixed_fps = -1;

static OS::ProcessID allow_focus_steal_pid = 0;

static bool project_manager = false;

bool Main::is_project_manager() {
return project_manager;
}

void initialize_physics() {

/// 3D Physics Server
Expand Down
1 change: 1 addition & 0 deletions main/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class Main {
static bool iteration();
static void cleanup();
static void force_redraw();
static bool is_project_manager();
};

#endif
18 changes: 2 additions & 16 deletions modules/mono/mono_gd/gd_mono.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@

#ifdef TOOLS_ENABLED
#include "../editor/godotsharp_editor.h"
#include "main/main.h"
#endif

void gdmono_unhandled_exception_hook(MonoObject *exc, void *user_data) {
Expand Down Expand Up @@ -94,21 +95,6 @@ static bool _wait_for_debugger_msecs(uint32_t p_msecs) {
}
#endif

#ifdef TOOLS_ENABLED
// temporary workaround. should be provided from Main::setup/setup2 instead
bool _is_project_manager_requested() {

List<String> cmdline_args = OS::get_singleton()->get_cmdline_args();
for (List<String>::Element *E = cmdline_args.front(); E; E = E->next()) {
const String &arg = E->get();
if (arg == "-p" || arg == "--project-manager")
return true;
}

return false;
}
#endif

#ifdef DEBUG_ENABLED
void gdmono_debug_init() {

Expand All @@ -121,7 +107,7 @@ void gdmono_debug_init() {
#ifdef TOOLS_ENABLED
if (Engine::get_singleton()->is_editor_hint() ||
ProjectSettings::get_singleton()->get_resource_path().empty() ||
_is_project_manager_requested()) {
Main::is_project_manager()) {
return;
}
#endif
Expand Down

0 comments on commit dad47d8

Please sign in to comment.