MCPcopy Create free account
hub / github.com/GDRETools/gdsdecomp / _reload_from_file

Method _reload_from_file

compat/fake_csharp_script.cpp:32–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30 }
31
32Error 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
61void FakeCSharpScript::reload_from_file() {
62 Error err = _reload_from_file();

Callers

nothing calls this directly

Calls 5

get_dotnet_decompilerMethod · 0.80
get_script_infoMethod · 0.80
clearMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected