diff options
author | Ignacio Etcheverry <neikeq@users.noreply.github.com> | 2018-11-30 21:39:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-30 21:39:13 +0100 |
commit | 989b93d6a406d439367bf34fb39b422c0f639f17 (patch) | |
tree | f007e28300c91e329e615dea88022b43c2c3d932 /modules/mono/editor | |
parent | 5b8dde4b4a5a930e08da51e07ec87f43e5bd7b36 (diff) | |
parent | b9b7dcdf001e1705ec45deab56d31eb74dcaaa4d (diff) |
Merge pull request #24091 from neikeq/ii
C#: Improve tool script support and fix reloading issues
Diffstat (limited to 'modules/mono/editor')
-rw-r--r-- | modules/mono/editor/godotsharp_editor.cpp | 8 | ||||
-rw-r--r-- | modules/mono/editor/mono_bottom_panel.cpp | 10 |
2 files changed, 13 insertions, 5 deletions
diff --git a/modules/mono/editor/godotsharp_editor.cpp b/modules/mono/editor/godotsharp_editor.cpp index f27511ad5e..cce86efbf5 100644 --- a/modules/mono/editor/godotsharp_editor.cpp +++ b/modules/mono/editor/godotsharp_editor.cpp @@ -475,7 +475,9 @@ MonoReloadNode *MonoReloadNode::singleton = NULL; void MonoReloadNode::_reload_timer_timeout() { - CSharpLanguage::get_singleton()->reload_assemblies_if_needed(false); + if (CSharpLanguage::get_singleton()->is_assembly_reloading_needed()) { + CSharpLanguage::get_singleton()->reload_assemblies(false); + } } void MonoReloadNode::restart_reload_timer() { @@ -493,7 +495,9 @@ void MonoReloadNode::_notification(int p_what) { switch (p_what) { case MainLoop::NOTIFICATION_WM_FOCUS_IN: { restart_reload_timer(); - CSharpLanguage::get_singleton()->reload_assemblies_if_needed(true); + if (CSharpLanguage::get_singleton()->is_assembly_reloading_needed()) { + CSharpLanguage::get_singleton()->reload_assemblies(false); + } } break; default: { } break; diff --git a/modules/mono/editor/mono_bottom_panel.cpp b/modules/mono/editor/mono_bottom_panel.cpp index d7bfa54aba..e89d21d92d 100644 --- a/modules/mono/editor/mono_bottom_panel.cpp +++ b/modules/mono/editor/mono_bottom_panel.cpp @@ -154,10 +154,14 @@ void MonoBottomPanel::_build_project_pressed() { Error metadata_err = CSharpProject::generate_scripts_metadata(GodotSharpDirs::get_project_csproj_path(), scripts_metadata_path); ERR_FAIL_COND(metadata_err != OK); - GodotSharpBuilds::get_singleton()->build_project_blocking("Tools"); + bool build_success = GodotSharpBuilds::get_singleton()->build_project_blocking("Tools"); - MonoReloadNode::get_singleton()->restart_reload_timer(); - CSharpLanguage::get_singleton()->reload_assemblies_if_needed(true); + if (build_success) { + MonoReloadNode::get_singleton()->restart_reload_timer(); + if (CSharpLanguage::get_singleton()->is_assembly_reloading_needed()) { + CSharpLanguage::get_singleton()->reload_assemblies(false); + } + } } void MonoBottomPanel::_view_log_pressed() { |