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

Method create_from_json

bytecode/bytecode_custom.cpp:169–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167}
168
169Ref<GDScriptDecomp_custom> GDScriptDecomp_custom::create_from_json(Dictionary p_custom_def) {
170 if ((int)p_custom_def.get("bytecode_version", 0) == 0) {
171 ERR_FAIL_V_MSG(nullptr, "Bytecode version is required");
172 }
173 if ((int)p_custom_def.get("engine_ver_major", 0) == 0) {
174 ERR_FAIL_V_MSG(nullptr, "Engine version major is required");
175 }
176 if ((int)p_custom_def.get("variant_ver_major", 0) == 0) {
177 ERR_FAIL_V_MSG(nullptr, "Variant version major is required");
178 }
179 if ((int)p_custom_def.get("bytecode_rev", "").operator String().hex_to_int() == 0) {
180 ERR_FAIL_V_MSG(nullptr, "Bytecode revision is required");
181 }
182 if (p_custom_def.get("engine_version", "") == "") {
183 ERR_FAIL_V_MSG(nullptr, "Engine version is required");
184 }
185 // if ((int)p_custom_def.get("parent", 0) == 0) {
186 // return nullptr;
187 // }
188 if (p_custom_def.get("tk_names", Vector<String>()) == Vector<String>()) {
189 ERR_FAIL_V_MSG(nullptr, "Tokens are required");
190 }
191 // if (!p_custom_def.has("func_names")) {
192 // ERR_FAIL_V_MSG(nullptr, "Functions are required");
193 // }
194 // if (p_custom_def.get("date", "") == "") {
195 // return nullptr;
196 // }
197 return Ref<GDScriptDecomp_custom>(memnew(GDScriptDecomp_custom(p_custom_def)));
198}

Callers

nothing calls this directly

Calls 2

getMethod · 0.45

Tested by

no test coverage detected