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

Method set_edited_resource

editor/script/script_text_editor.cpp:163–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161}
162
163void ScriptTextEditor::set_edited_resource(const Ref<Resource> &p_res) {
164 ERR_FAIL_COND(script.is_valid());
165 ERR_FAIL_COND(p_res.is_null());
166
167 script = p_res;
168
169 code_editor->get_text_editor()->set_text(script->get_source_code());
170 code_editor->get_text_editor()->clear_undo_history();
171 code_editor->get_text_editor()->tag_saved_version();
172
173 emit_signal(SNAME("name_changed"));
174 code_editor->update_line_and_column();
175}
176
177void ScriptTextEditor::enable_editor(Control *p_shortcut_context) {
178 if (editor_enabled) {

Callers

nothing calls this directly

Calls 8

get_text_editorMethod · 0.80
clear_undo_historyMethod · 0.80
is_validMethod · 0.45
is_nullMethod · 0.45
set_textMethod · 0.45
get_source_codeMethod · 0.45
tag_saved_versionMethod · 0.45

Tested by

no test coverage detected