| 30 | } |
| 31 | |
| 32 | Error FakeCSharpScript::_reload_from_file() { |
| 33 | error_message.clear(); |
| 34 | script_info.clear(); |
| 35 | source.clear(); |
| 36 | valid = false; |
| 37 | loaded = false; |
| 38 | if (!GDRESettings::get_singleton()->has_loaded_dotnet_assembly()) { |
| 39 | error_message = "No dotnet assembly loaded"; |
| 40 | return ERR_CANT_RESOLVE; |
| 41 | } |
| 42 | auto decompiler = GDRESettings::get_singleton()->get_dotnet_decompiler(); |
| 43 | if (decompiler.is_null()) { |
| 44 | error_message = "No dotnet decompiler loaded"; |
| 45 | return ERR_CANT_RESOLVE; |
| 46 | } |
| 47 | script_info = decompiler->get_script_info(script_path); |
| 48 | if (script_info.is_empty()) { |
| 49 | error_message = "No script info found"; |
| 50 | return ERR_CANT_ACQUIRE_RESOURCE; |
| 51 | } |
| 52 | source = script_info.get("script_text", ""); |
| 53 | if (source.is_empty()) { |
| 54 | error_message = "Failed to decompile script"; |
| 55 | return ERR_CANT_ACQUIRE_RESOURCE; |
| 56 | } |
| 57 | |
| 58 | return reload(false); |
| 59 | } |
| 60 | |
| 61 | void FakeCSharpScript::reload_from_file() { |
| 62 | Error err = _reload_from_file(); |
nothing calls this directly
no test coverage detected