| 549 | } |
| 550 | |
| 551 | void GraphNode::_notification(int p_what) { |
| 552 | switch (p_what) { |
| 553 | case NOTIFICATION_ACCESSIBILITY_UPDATE: { |
| 554 | RID ae = get_accessibility_element(); |
| 555 | ERR_FAIL_COND(ae.is_null()); |
| 556 | |
| 557 | String name = get_accessibility_name(); |
| 558 | if (name.is_empty()) { |
| 559 | name = get_name(); |
| 560 | } |
| 561 | name = vformat(ETR("graph node %s (%s)"), name, get_title()); |
| 562 | |
| 563 | if (slot_table.has(selected_slot)) { |
| 564 | GraphEdit *graph = Object::cast_to<GraphEdit>(get_parent()); |
| 565 | Dictionary type_info; |
| 566 | if (graph) { |
| 567 | type_info = graph->get_type_names(); |
| 568 | } |
| 569 | const Slot &slot = slot_table[selected_slot]; |
| 570 | name += ", " + vformat(ETR("slot %d of %d"), selected_slot + 1, slot_count); |
| 571 | if (slot.enable_left) { |
| 572 | if (type_info.has(slot.type_left)) { |
| 573 | name += "," + vformat(ETR("input port, type: %s"), type_info[slot.type_left]); |
| 574 | } else { |
| 575 | name += "," + vformat(ETR("input port, type: %d"), slot.type_left); |
| 576 | } |
| 577 | if (graph) { |
| 578 | for (int i = 0; i < left_port_cache.size(); i++) { |
| 579 | if (left_port_cache[i].slot_index == selected_slot) { |
| 580 | String cd = graph->get_connections_description(get_name(), i); |
| 581 | if (cd.is_empty()) { |
| 582 | name += " " + ETR("no connections"); |
| 583 | } else { |
| 584 | name += " " + cd; |
| 585 | } |
| 586 | break; |
| 587 | } |
| 588 | } |
| 589 | } |
| 590 | } |
| 591 | if (slot.enable_left) { |
| 592 | if (type_info.has(slot.type_right)) { |
| 593 | name += "," + vformat(ETR("output port, type: %s"), type_info[slot.type_right]); |
| 594 | } else { |
| 595 | name += "," + vformat(ETR("output port, type: %d"), slot.type_right); |
| 596 | } |
| 597 | if (graph) { |
| 598 | for (int i = 0; i < right_port_cache.size(); i++) { |
| 599 | if (right_port_cache[i].slot_index == selected_slot) { |
| 600 | String cd = graph->get_connections_description(get_name(), i); |
| 601 | if (cd.is_empty()) { |
| 602 | name += " " + ETR("no connections"); |
| 603 | } else { |
| 604 | name += " " + cd; |
| 605 | } |
| 606 | break; |
| 607 | } |
| 608 | } |
nothing calls this directly
no test coverage detected