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

Method get_scene_root_script

editor/editor_data.cpp:842–856  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

840}
841
842Ref<Script> EditorData::get_scene_root_script(int p_idx) const {
843 ERR_FAIL_INDEX_V(p_idx, edited_scene.size(), Ref<Script>());
844 if (!edited_scene[p_idx].root) {
845 return Ref<Script>();
846 }
847 Ref<Script> s = edited_scene[p_idx].root->get_script();
848 if (s.is_null() && edited_scene[p_idx].root->get_child_count()) {
849 Node *n = edited_scene[p_idx].root->get_child(0);
850 while (s.is_null() && n && n->get_scene_file_path().is_empty()) {
851 s = n->get_script();
852 n = n->get_parent();
853 }
854 }
855 return s;
856}
857
858String EditorData::get_scene_title(int p_idx, bool p_always_strip_extension) const {
859 ERR_FAIL_INDEX_V(p_idx, edited_scene.size(), String());

Callers 3

_set_main_scene_stateMethod · 0.80
_update_tab_titlesMethod · 0.80

Calls 8

get_scene_file_pathMethod · 0.80
sizeMethod · 0.65
get_scriptMethod · 0.45
is_nullMethod · 0.45
get_child_countMethod · 0.45
get_childMethod · 0.45
is_emptyMethod · 0.45
get_parentMethod · 0.45

Tested by

no test coverage detected