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

Method select

editor/editor_main_screen.cpp:176–213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174}
175
176void EditorMainScreen::select(int p_index) {
177 if (EditorNode::get_singleton()->is_changing_scene()) {
178 return;
179 }
180
181 ERR_FAIL_INDEX(p_index, editor_table.size());
182
183 if (!buttons[p_index]->is_visible()) { // Button hidden, no editor.
184 return;
185 }
186
187 for (int i = 0; i < buttons.size(); i++) {
188 buttons[i]->set_pressed_no_signal(i == p_index);
189 }
190
191 EditorPlugin *new_editor = editor_table[p_index];
192 ERR_FAIL_NULL(new_editor);
193
194 if (selected_plugin == new_editor) {
195 return;
196 }
197
198 if (selected_plugin) {
199 selected_plugin->make_visible(false);
200 }
201
202 selected_plugin = new_editor;
203 selected_plugin->make_visible(true);
204 selected_plugin->selected_notify();
205
206 EditorData &editor_data = EditorNode::get_editor_data();
207 int plugin_count = editor_data.get_editor_plugin_count();
208 for (int i = 0; i < plugin_count; i++) {
209 editor_data.get_editor_plugin(i)->notify_main_screen_changed(selected_plugin->get_plugin_name());
210 }
211
212 EditorNode::get_singleton()->update_distraction_free_mode();
213}
214
215int EditorMainScreen::get_selected_index() const {
216 for (int i = 0; i < editor_table.size(); i++) {

Callers 5

shortcut_inputMethod · 0.45
_edit_currentMethod · 0.45
_set_main_scene_stateMethod · 0.45
_renderer_selectedMethod · 0.45
EditorNodeMethod · 0.45

Calls 11

is_changing_sceneMethod · 0.80
set_pressed_no_signalMethod · 0.80
get_editor_pluginMethod · 0.80
sizeMethod · 0.65
is_visibleMethod · 0.45
make_visibleMethod · 0.45
selected_notifyMethod · 0.45
get_plugin_nameMethod · 0.45

Tested by

no test coverage detected