Merge pull request #37116 from neikeq/issue-12917

Sync csproj when files are changed from the Godot FileSystem dock
This commit is contained in:
Rémi Verschelde 2020-03-18 16:07:49 +01:00 committed by GitHub
commit 194d2ccb72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 197 additions and 40 deletions

View file

@ -3035,22 +3035,6 @@ void CSharpScript::initialize_for_managed_type(Ref<CSharpScript> p_script, GDMon
bool CSharpScript::can_instance() const {
#ifdef TOOLS_ENABLED
if (Engine::get_singleton()->is_editor_hint()) {
// Hack to lower the risk of attached scripts not being added to the C# project
if (!get_path().empty() && get_path().find("::") == -1) { // Ignore if built-in script. Can happen if the file is deleted...
if (_create_project_solution_if_needed()) {
CSharpProject::add_item(GodotSharpDirs::get_project_csproj_path(),
"Compile",
ProjectSettings::get_singleton()->globalize_path(get_path()));
} else {
ERR_PRINT("C# project could not be created; cannot add file: '" + get_path() + "'.");
}
}
}
#endif
#ifdef TOOLS_ENABLED
bool extra_cond = tool || ScriptServer::is_scripting_enabled();
#else