MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / _open_script_request

Method _open_script_request

editor/script/script_editor_plugin.cpp:3995–4014  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3993}
3994
3995void ScriptEditor::_open_script_request(const String &p_path) {
3996 Ref<Script> scr = ResourceLoader::load(p_path);
3997 if (scr.is_valid()) {
3998 script_editor->edit(scr, false);
3999 return;
4000 }
4001
4002 Ref<JSON> json = ResourceLoader::load(p_path);
4003 if (json.is_valid()) {
4004 script_editor->edit(json, false);
4005 return;
4006 }
4007
4008 Error err;
4009 Ref<TextFile> text_file = script_editor->_load_text_file(p_path, &err);
4010 if (text_file.is_valid()) {
4011 script_editor->edit(text_file, false);
4012 return;
4013 }
4014}
4015
4016void ScriptEditor::register_syntax_highlighter(const Ref<EditorSyntaxHighlighter> &p_syntax_highlighter) {
4017 ERR_FAIL_COND(p_syntax_highlighter.is_null());

Callers

nothing calls this directly

Calls 3

_load_text_fileMethod · 0.80
is_validMethod · 0.45
editMethod · 0.45

Tested by

no test coverage detected