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

Method _notification

editor/docks/filesystem_dock.cpp:529–664  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

527}
528
529void FileSystemDock::_notification(int p_what) {
530 switch (p_what) {
531 case NOTIFICATION_READY: {
532 EditorFeatureProfileManager::get_singleton()->connect("current_feature_profile_changed", callable_mp(this, &FileSystemDock::_feature_profile_changed));
533 EditorFileSystem::get_singleton()->connect("filesystem_changed", callable_mp(this, &FileSystemDock::_fs_changed));
534 EditorResourcePreview::get_singleton()->connect("preview_invalidated", callable_mp(this, &FileSystemDock::_preview_invalidated));
535
536 button_file_list_display_mode->connect(SceneStringName(pressed), callable_mp(this, &FileSystemDock::_toggle_file_display));
537 files->connect("item_activated", callable_mp(this, &FileSystemDock::_file_list_activate_file));
538 button_hist_next->connect(SceneStringName(pressed), callable_mp(this, &FileSystemDock::_fw_history));
539 button_hist_prev->connect(SceneStringName(pressed), callable_mp(this, &FileSystemDock::_bw_history));
540 file_list_popup->connect(SceneStringName(id_pressed), callable_mp(this, &FileSystemDock::_file_list_rmb_option));
541 tree_popup->connect(SceneStringName(id_pressed), callable_mp(this, &FileSystemDock::_tree_rmb_option));
542 current_path_line_edit->connect(SceneStringName(text_submitted), callable_mp(this, &FileSystemDock::_navigate_to_path).bind(false, true));
543
544 always_show_folders = bool(EDITOR_GET("docks/filesystem/always_show_folders"));
545 thumbnail_size_setting = EDITOR_GET("docks/filesystem/thumbnail_size");
546
547 set_file_list_display_mode(FileSystemDock::FILE_LIST_DISPLAY_LIST);
548
549 _update_display_mode();
550
551 if (EditorFileSystem::get_singleton()->is_scanning()) {
552 _set_scanning_mode();
553 } else {
554 _update_tree(Vector<String>(), true);
555 }
556 } break;
557
558 case NOTIFICATION_PROCESS: {
559 if (EditorFileSystem::get_singleton()->is_scanning()) {
560 scanning_progress->set_value(EditorFileSystem::get_singleton()->get_scanning_progress() * 100.0f);
561 }
562 } break;
563
564 case NOTIFICATION_DRAG_BEGIN: {
565 Dictionary dd = get_viewport()->gui_get_drag_data();
566 if (tree->is_visible_in_tree() && dd.has("type")) {
567 if (dd.has("favorite")) {
568 if ((String(dd["favorite"]) == "all")) {
569 tree->set_drop_mode_flags(Tree::DROP_MODE_INBETWEEN);
570 }
571 } else if ((String(dd["type"]) == "files") || (String(dd["type"]) == "files_and_dirs")) {
572 tree->set_drop_mode_flags(Tree::DROP_MODE_ON_ITEM | Tree::DROP_MODE_INBETWEEN);
573 } else if ((String(dd["type"]) == "nodes") || (String(dd["type"]) == "resource")) {
574 holding_branch = true;
575 TreeItem *item = tree->get_next_selected(tree->get_root());
576 while (item) {
577 tree_items_selected_on_drag_begin.push_back(item);
578 item = tree->get_next_selected(item);
579 }
580 list_items_selected_on_drag_begin = files->get_selected_items();
581 }
582 }
583 } break;
584
585 case NOTIFICATION_DRAG_END: {
586 tree->set_drop_mode_flags(0);

Callers

nothing calls this directly

Calls 15

is_scanningMethod · 0.80
get_scanning_progressMethod · 0.80
gui_get_drag_dataMethod · 0.80
set_drop_mode_flagsMethod · 0.80
get_next_selectedMethod · 0.80
get_selected_itemsMethod · 0.80
set_button_iconMethod · 0.80
set_right_iconMethod · 0.80
connectMethod · 0.65
StringClass · 0.50
bindMethod · 0.45
set_valueMethod · 0.45

Tested by

no test coverage detected