Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use human-readable unique names for GraphEdit's internal nodes #76563

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion scene/gui/graph_edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2851,6 +2851,7 @@ GraphEdit::GraphEdit() {
panner->set_callbacks(callable_mp(this, &GraphEdit::_pan_callback), callable_mp(this, &GraphEdit::_zoom_callback));

top_layer = memnew(Control);
top_layer->set_name("_top_layer");
add_child(top_layer, false, INTERNAL_MODE_BACK);
top_layer->set_mouse_filter(MOUSE_FILTER_IGNORE);
top_layer->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
Expand Down Expand Up @@ -2903,11 +2904,13 @@ GraphEdit::GraphEdit() {
menu_panel->set_position(Vector2(10, 10));

menu_hbox = memnew(HBoxContainer);
menu_hbox->set_name("_menu_hbox");
menu_panel->add_child(menu_hbox);

// Zoom label and controls.

zoom_label = memnew(Label);
zoom_label->set_name("_zoom_label");
zoom_label->set_visible(show_zoom_label);
zoom_label->set_v_size_flags(Control::SIZE_SHRINK_CENTER);
zoom_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER);
Expand All @@ -2916,6 +2919,7 @@ GraphEdit::GraphEdit() {
_update_zoom_label();

zoom_minus_button = memnew(Button);
zoom_minus_button->set_name("_zoom_minus_button");
zoom_minus_button->set_theme_type_variation(SceneStringName(FlatButton));
zoom_minus_button->set_visible(show_zoom_buttons);
zoom_minus_button->set_tooltip_text(ETR("Zoom Out"));
Expand All @@ -2924,6 +2928,7 @@ GraphEdit::GraphEdit() {
zoom_minus_button->connect(SceneStringName(pressed), callable_mp(this, &GraphEdit::_zoom_minus));

zoom_reset_button = memnew(Button);
zoom_reset_button->set_name("_zoom_reset_button");
zoom_reset_button->set_theme_type_variation(SceneStringName(FlatButton));
zoom_reset_button->set_visible(show_zoom_buttons);
zoom_reset_button->set_tooltip_text(ETR("Zoom Reset"));
Expand All @@ -2932,6 +2937,7 @@ GraphEdit::GraphEdit() {
zoom_reset_button->connect(SceneStringName(pressed), callable_mp(this, &GraphEdit::_zoom_reset));

zoom_plus_button = memnew(Button);
zoom_plus_button->set_name("_zoom_plus_button");
zoom_plus_button->set_theme_type_variation(SceneStringName(FlatButton));
zoom_plus_button->set_visible(show_zoom_buttons);
zoom_plus_button->set_tooltip_text(ETR("Zoom In"));
Expand All @@ -2942,6 +2948,7 @@ GraphEdit::GraphEdit() {
// Grid controls.

toggle_grid_button = memnew(Button);
toggle_grid_button->set_name("_toggle_grid_button");
toggle_grid_button->set_theme_type_variation(SceneStringName(FlatButton));
toggle_grid_button->set_visible(show_grid_buttons);
toggle_grid_button->set_toggle_mode(true);
Expand All @@ -2952,6 +2959,7 @@ GraphEdit::GraphEdit() {
toggle_grid_button->connect(SceneStringName(pressed), callable_mp(this, &GraphEdit::_show_grid_toggled));

toggle_snapping_button = memnew(Button);
toggle_snapping_button->set_name("_toggle_snapping_button");
toggle_snapping_button->set_theme_type_variation(SceneStringName(FlatButton));
toggle_snapping_button->set_visible(show_grid_buttons);
toggle_snapping_button->set_toggle_mode(true);
Expand All @@ -2962,6 +2970,7 @@ GraphEdit::GraphEdit() {
toggle_snapping_button->connect(SceneStringName(pressed), callable_mp(this, &GraphEdit::_snapping_toggled));

snapping_distance_spinbox = memnew(SpinBox);
snapping_distance_spinbox->set_name("_snapping_distance_spinbox");
snapping_distance_spinbox->set_visible(show_grid_buttons);
snapping_distance_spinbox->set_min(GRID_MIN_SNAPPING_DISTANCE);
snapping_distance_spinbox->set_max(GRID_MAX_SNAPPING_DISTANCE);
Expand All @@ -2974,6 +2983,7 @@ GraphEdit::GraphEdit() {
// Extra controls.

minimap_button = memnew(Button);
minimap_button->set_name("_minimap_button");
minimap_button->set_theme_type_variation(SceneStringName(FlatButton));
minimap_button->set_visible(show_minimap_button);
minimap_button->set_toggle_mode(true);
Expand All @@ -2984,6 +2994,7 @@ GraphEdit::GraphEdit() {
minimap_button->connect(SceneStringName(pressed), callable_mp(this, &GraphEdit::_minimap_toggled));

arrange_button = memnew(Button);
arrange_button->set_name("_arrange_button");
arrange_button->set_theme_type_variation(SceneStringName(FlatButton));
arrange_button->set_visible(show_arrange_button);
arrange_button->connect(SceneStringName(pressed), callable_mp(this, &GraphEdit::arrange_nodes));
Expand All @@ -2997,8 +3008,8 @@ GraphEdit::GraphEdit() {
const float minimap_opacity = 0.65;

minimap = memnew(GraphEditMinimap(this));
top_layer->add_child(minimap);
minimap->set_name("_minimap");
top_layer->add_child(minimap);
minimap->set_modulate(Color(1, 1, 1, minimap_opacity));
minimap->set_mouse_filter(MOUSE_FILTER_PASS);
minimap->set_custom_minimum_size(Vector2(50, 50));
Expand Down
Loading