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

Method _update_members_overview

editor/script/script_editor_plugin.cpp:2118–2161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2116}
2117
2118void ScriptEditor::_update_members_overview() {
2119 members_overview->clear();
2120
2121 ScriptEditorBase *se = _get_current_editor();
2122 if (!se) {
2123 return;
2124 }
2125
2126 Vector<String> functions = se->get_functions();
2127 if (EDITOR_GET("text_editor/script_list/sort_members_outline_alphabetically")) {
2128 functions.sort();
2129 }
2130
2131 String filter = filter_methods->get_text();
2132 if (filter.is_empty()) {
2133 for (int i = 0; i < functions.size(); i++) {
2134 String name = functions[i].get_slicec(':', 0);
2135 members_overview->add_item(name);
2136 members_overview->set_item_metadata(-1, functions[i].get_slicec(':', 1).to_int() - 1);
2137 }
2138 } else {
2139 PackedStringArray search_names;
2140 for (int i = 0; i < functions.size(); i++) {
2141 search_names.append(functions[i].get_slicec(':', 0));
2142 }
2143
2144 Vector<FuzzySearchResult> results;
2145 FuzzySearch fuzzy;
2146 fuzzy.set_query(filter, false);
2147 fuzzy.search_all(search_names, results);
2148
2149 for (const FuzzySearchResult &res : results) {
2150 String name = functions[res.original_index].get_slicec(':', 0);
2151 int line = functions[res.original_index].get_slicec(':', 1).to_int() - 1;
2152 members_overview->add_item(name);
2153 members_overview->set_item_metadata(-1, line);
2154 }
2155 }
2156
2157 String path = se->get_edited_resource()->get_path();
2158 bool built_in = !path.is_resource_file();
2159 String name = built_in ? path.get_file() : se->get_name();
2160 filename->set_text(name);
2161}
2162
2163void ScriptEditor::_update_help_overview_visibility() {
2164 int selected = tab_container->get_current_tab();

Callers

nothing calls this directly

Calls 15

get_slicecMethod · 0.80
to_intMethod · 0.80
set_queryMethod · 0.80
is_resource_fileMethod · 0.80
sizeMethod · 0.65
clearMethod · 0.45
get_functionsMethod · 0.45
sortMethod · 0.45
get_textMethod · 0.45
is_emptyMethod · 0.45
add_itemMethod · 0.45
set_item_metadataMethod · 0.45

Tested by

no test coverage detected