diff options
Diffstat (limited to 'editor/plugins/path_2d_editor_plugin.cpp')
-rw-r--r-- | editor/plugins/path_2d_editor_plugin.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/editor/plugins/path_2d_editor_plugin.cpp b/editor/plugins/path_2d_editor_plugin.cpp index 4fff3bfb8a..f404dca88b 100644 --- a/editor/plugins/path_2d_editor_plugin.cpp +++ b/editor/plugins/path_2d_editor_plugin.cpp @@ -401,24 +401,24 @@ void Path2DEditor::forward_canvas_draw_over_viewport(Control *p_overlay) { bool smooth = false; if (i < len - 1) { - Vector2 pointout = xform.xform(curve->get_point_position(i) + curve->get_point_out(i)); - if (point != pointout) { + Vector2 point_out = xform.xform(curve->get_point_position(i) + curve->get_point_out(i)); + if (point != point_out) { smooth = true; // Draw the line with a dark and light color to be visible on all backgrounds - vpc->draw_line(point, pointout, Color(0, 0, 0, 0.5), Math::round(EDSCALE)); - vpc->draw_line(point, pointout, Color(1, 1, 1, 0.5), Math::round(EDSCALE)); - vpc->draw_texture_rect(curve_handle, Rect2(pointout - curve_handle_size * 0.5, curve_handle_size), false, Color(1, 1, 1, 0.75)); + vpc->draw_line(point, point_out, Color(0, 0, 0, 0.5), Math::round(EDSCALE)); + vpc->draw_line(point, point_out, Color(1, 1, 1, 0.5), Math::round(EDSCALE)); + vpc->draw_texture_rect(curve_handle, Rect2(point_out - curve_handle_size * 0.5, curve_handle_size), false, Color(1, 1, 1, 0.75)); } } if (i > 0) { - Vector2 pointin = xform.xform(curve->get_point_position(i) + curve->get_point_in(i)); - if (point != pointin) { + Vector2 point_in = xform.xform(curve->get_point_position(i) + curve->get_point_in(i)); + if (point != point_in) { smooth = true; // Draw the line with a dark and light color to be visible on all backgrounds - vpc->draw_line(point, pointin, Color(0, 0, 0, 0.5), Math::round(EDSCALE)); - vpc->draw_line(point, pointin, Color(1, 1, 1, 0.5), Math::round(EDSCALE)); - vpc->draw_texture_rect(curve_handle, Rect2(pointin - curve_handle_size * 0.5, curve_handle_size), false, Color(1, 1, 1, 0.75)); + vpc->draw_line(point, point_in, Color(0, 0, 0, 0.5), Math::round(EDSCALE)); + vpc->draw_line(point, point_in, Color(1, 1, 1, 0.5), Math::round(EDSCALE)); + vpc->draw_texture_rect(curve_handle, Rect2(point_in - curve_handle_size * 0.5, curve_handle_size), false, Color(1, 1, 1, 0.75)); } } @@ -450,13 +450,13 @@ void Path2DEditor::edit(Node *p_path2d) { if (p_path2d) { node = Object::cast_to<Path2D>(p_path2d); - if (!node->is_connected("visibility_changed", callable_mp(this, &Path2DEditor::_node_visibility_changed))) { - node->connect("visibility_changed", callable_mp(this, &Path2DEditor::_node_visibility_changed)); + if (!node->is_connected(SceneStringName(visibility_changed), callable_mp(this, &Path2DEditor::_node_visibility_changed))) { + node->connect(SceneStringName(visibility_changed), callable_mp(this, &Path2DEditor::_node_visibility_changed)); } } else { // The node may have been deleted at this point. - if (node && node->is_connected("visibility_changed", callable_mp(this, &Path2DEditor::_node_visibility_changed))) { - node->disconnect("visibility_changed", callable_mp(this, &Path2DEditor::_node_visibility_changed)); + if (node && node->is_connected(SceneStringName(visibility_changed), callable_mp(this, &Path2DEditor::_node_visibility_changed))) { + node->disconnect(SceneStringName(visibility_changed), callable_mp(this, &Path2DEditor::_node_visibility_changed)); } node = nullptr; } @@ -612,7 +612,7 @@ Path2DEditor::Path2DEditor() { curve_edit->set_pressed(true); curve_edit->set_focus_mode(Control::FOCUS_NONE); curve_edit->set_tooltip_text(TTR("Select Points") + "\n" + TTR("Shift+Drag: Select Control Points") + "\n" + keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL) + TTR("Click: Add Point") + "\n" + TTR("Left Click: Split Segment (in curve)") + "\n" + TTR("Right Click: Delete Point")); - curve_edit->connect("pressed", callable_mp(this, &Path2DEditor::_mode_selected).bind(MODE_EDIT)); + curve_edit->connect(SceneStringName(pressed), callable_mp(this, &Path2DEditor::_mode_selected).bind(MODE_EDIT)); add_child(curve_edit); curve_edit_curve = memnew(Button); @@ -620,7 +620,7 @@ Path2DEditor::Path2DEditor() { curve_edit_curve->set_toggle_mode(true); curve_edit_curve->set_focus_mode(Control::FOCUS_NONE); curve_edit_curve->set_tooltip_text(TTR("Select Control Points (Shift+Drag)")); - curve_edit_curve->connect("pressed", callable_mp(this, &Path2DEditor::_mode_selected).bind(MODE_EDIT_CURVE)); + curve_edit_curve->connect(SceneStringName(pressed), callable_mp(this, &Path2DEditor::_mode_selected).bind(MODE_EDIT_CURVE)); add_child(curve_edit_curve); curve_create = memnew(Button); @@ -628,7 +628,7 @@ Path2DEditor::Path2DEditor() { curve_create->set_toggle_mode(true); curve_create->set_focus_mode(Control::FOCUS_NONE); curve_create->set_tooltip_text(TTR("Add Point (in empty space)") + "\n" + TTR("Right Click: Delete Point")); - curve_create->connect("pressed", callable_mp(this, &Path2DEditor::_mode_selected).bind(MODE_CREATE)); + curve_create->connect(SceneStringName(pressed), callable_mp(this, &Path2DEditor::_mode_selected).bind(MODE_CREATE)); add_child(curve_create); curve_del = memnew(Button); @@ -636,21 +636,21 @@ Path2DEditor::Path2DEditor() { curve_del->set_toggle_mode(true); curve_del->set_focus_mode(Control::FOCUS_NONE); curve_del->set_tooltip_text(TTR("Delete Point")); - curve_del->connect("pressed", callable_mp(this, &Path2DEditor::_mode_selected).bind(MODE_DELETE)); + curve_del->connect(SceneStringName(pressed), callable_mp(this, &Path2DEditor::_mode_selected).bind(MODE_DELETE)); add_child(curve_del); curve_close = memnew(Button); curve_close->set_theme_type_variation("FlatButton"); curve_close->set_focus_mode(Control::FOCUS_NONE); curve_close->set_tooltip_text(TTR("Close Curve")); - curve_close->connect("pressed", callable_mp(this, &Path2DEditor::_mode_selected).bind(MODE_CLOSE)); + curve_close->connect(SceneStringName(pressed), callable_mp(this, &Path2DEditor::_mode_selected).bind(MODE_CLOSE)); add_child(curve_close); curve_clear_points = memnew(Button); curve_clear_points->set_theme_type_variation("FlatButton"); curve_clear_points->set_focus_mode(Control::FOCUS_NONE); curve_clear_points->set_tooltip_text(TTR("Clear Points")); - curve_clear_points->connect("pressed", callable_mp(this, &Path2DEditor::_confirm_clear_points)); + curve_clear_points->connect(SceneStringName(pressed), callable_mp(this, &Path2DEditor::_confirm_clear_points)); add_child(curve_clear_points); clear_points_dialog = memnew(ConfirmationDialog); |