diff options
Diffstat (limited to 'modules/mono/editor')
| -rw-r--r-- | modules/mono/editor/bindings_generator.cpp | 6 | ||||
| -rw-r--r-- | modules/mono/editor/godotsharp_editor.cpp | 15 | ||||
| -rw-r--r-- | modules/mono/editor/godotsharp_export.cpp | 13 |
3 files changed, 18 insertions, 16 deletions
diff --git a/modules/mono/editor/bindings_generator.cpp b/modules/mono/editor/bindings_generator.cpp index 2d618f7891..5e0ce3554a 100644 --- a/modules/mono/editor/bindings_generator.cpp +++ b/modules/mono/editor/bindings_generator.cpp @@ -914,12 +914,12 @@ Error BindingsGenerator::generate_cs_core_project(const String &p_solution_dir, // Generate sources from compressed files - Map<String, CompressedFile> compressed_files; + Map<String, GodotCsCompressedFile> compressed_files; get_compressed_files(compressed_files); - for (Map<String, CompressedFile>::Element *E = compressed_files.front(); E; E = E->next()) { + for (Map<String, GodotCsCompressedFile>::Element *E = compressed_files.front(); E; E = E->next()) { const String &file_name = E->key(); - const CompressedFile &file_data = E->value(); + const GodotCsCompressedFile &file_data = E->value(); String output_file = path_join(core_dir, file_name); diff --git a/modules/mono/editor/godotsharp_editor.cpp b/modules/mono/editor/godotsharp_editor.cpp index 9d42528927..8dc5ced29f 100644 --- a/modules/mono/editor/godotsharp_editor.cpp +++ b/modules/mono/editor/godotsharp_editor.cpp @@ -63,16 +63,17 @@ bool GodotSharpEditor::_create_project_solution() { pr.step(TTR("Generating C# project...")); String path = OS::get_singleton()->get_resource_dir(); - String name = ProjectSettings::get_singleton()->get("application/config/name"); - if (name.empty()) { - name = "UnnamedProject"; + String appname = ProjectSettings::get_singleton()->get("application/config/name"); + String appname_safe = OS::get_singleton()->get_safe_dir_name(appname); + if (appname_safe.empty()) { + appname_safe = "UnnamedProject"; } - String guid = CSharpProject::generate_game_project(path, name); + String guid = CSharpProject::generate_game_project(path, appname_safe); if (guid.length()) { - DotNetSolution solution(name); + DotNetSolution solution(appname_safe); if (!solution.set_path(path)) { show_error_dialog(TTR("Failed to create solution.")); @@ -81,12 +82,12 @@ bool GodotSharpEditor::_create_project_solution() { DotNetSolution::ProjectInfo proj_info; proj_info.guid = guid; - proj_info.relpath = name + ".csproj"; + proj_info.relpath = appname_safe + ".csproj"; proj_info.configs.push_back("Debug"); proj_info.configs.push_back("Release"); proj_info.configs.push_back("Tools"); - solution.add_new_project(name, proj_info); + solution.add_new_project(appname_safe, proj_info); Error sln_error = solution.save(); diff --git a/modules/mono/editor/godotsharp_export.cpp b/modules/mono/editor/godotsharp_export.cpp index 126178125f..590ec007ad 100644 --- a/modules/mono/editor/godotsharp_export.cpp +++ b/modules/mono/editor/godotsharp_export.cpp @@ -106,13 +106,14 @@ void GodotSharpExport::_export_begin(const Set<String> &p_features, bool p_debug Map<String, String> dependencies; String project_dll_name = ProjectSettings::get_singleton()->get("application/config/name"); - if (project_dll_name.empty()) { - project_dll_name = "UnnamedProject"; + String project_dll_name_safe = OS::get_singleton()->get_safe_dir_name(project_dll_name); + if (project_dll_name_safe.empty()) { + project_dll_name_safe = "UnnamedProject"; } String project_dll_src_dir = GodotSharpDirs::get_res_temp_assemblies_base_dir().plus_file(build_config); - String project_dll_src_path = project_dll_src_dir.plus_file(project_dll_name + ".dll"); - dependencies.insert(project_dll_name, project_dll_src_path); + String project_dll_src_path = project_dll_src_dir.plus_file(project_dll_name_safe + ".dll"); + dependencies.insert(project_dll_name_safe, project_dll_src_path); { MonoDomain *export_domain = GDMonoUtils::create_domain("GodotEngine.ProjectExportDomain"); @@ -122,10 +123,10 @@ void GodotSharpExport::_export_begin(const Set<String> &p_features, bool p_debug _GDMONO_SCOPE_DOMAIN_(export_domain); GDMonoAssembly *scripts_assembly = NULL; - bool load_success = GDMono::get_singleton()->load_assembly_from(project_dll_name, + bool load_success = GDMono::get_singleton()->load_assembly_from(project_dll_name_safe, project_dll_src_path, &scripts_assembly, /* refonly: */ true); - ERR_EXPLAIN("Cannot load assembly (refonly): " + project_dll_name); + ERR_EXPLAIN("Cannot load assembly (refonly): " + project_dll_name_safe); ERR_FAIL_COND(!load_success); Vector<String> search_dirs; |