diff options
author | letheed <letheed@outlook.com> | 2017-09-10 15:37:49 +0200 |
---|---|---|
committer | letheed <letheed@outlook.com> | 2017-09-20 13:11:10 +0200 |
commit | 5ad9be4c24e9d7dc5672fdc42cea896622fe5685 (patch) | |
tree | a8811a50265edd940b00e12b9bd522e3e9b4694e /editor/plugins | |
parent | ecd226c6a751f8a20766363fd1f2e1e0e2da8fba (diff) |
Rename pos to position in user facing methods and variables
Rename user facing methods and variables as well as the corresponding
C++ methods according to the folloming changes:
* pos -> position
* rot -> rotation
* loc -> location
C++ variables are left as is.
Diffstat (limited to 'editor/plugins')
-rw-r--r-- | editor/plugins/animation_player_editor_plugin.cpp | 12 | ||||
-rw-r--r-- | editor/plugins/animation_tree_editor_plugin.cpp | 16 | ||||
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 10 | ||||
-rw-r--r-- | editor/plugins/curve_editor_plugin.cpp | 22 | ||||
-rw-r--r-- | editor/plugins/line_2d_editor_plugin.cpp | 16 | ||||
-rw-r--r-- | editor/plugins/path_2d_editor_plugin.cpp | 28 | ||||
-rw-r--r-- | editor/plugins/path_editor_plugin.cpp | 40 | ||||
-rw-r--r-- | editor/plugins/resource_preloader_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/script_text_editor.cpp | 8 | ||||
-rw-r--r-- | editor/plugins/shader_graph_editor_plugin.cpp | 16 | ||||
-rw-r--r-- | editor/plugins/spatial_editor_plugin.cpp | 16 | ||||
-rw-r--r-- | editor/plugins/spatial_editor_plugin.h | 2 | ||||
-rw-r--r-- | editor/plugins/sprite_frames_editor_plugin.cpp | 6 |
13 files changed, 97 insertions, 97 deletions
diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp index c8db1763ab..de905d80ef 100644 --- a/editor/plugins/animation_player_editor_plugin.cpp +++ b/editor/plugins/animation_player_editor_plugin.cpp @@ -76,14 +76,14 @@ void AnimationPlayerEditor::_notification(int p_what) { } } } - frame->set_value(player->get_current_animation_pos()); - key_editor->set_anim_pos(player->get_current_animation_pos()); + frame->set_value(player->get_current_animation_position()); + key_editor->set_anim_pos(player->get_current_animation_position()); EditorNode::get_singleton()->get_property_editor()->refresh(); } else if (last_active) { //need the last frame after it stopped - frame->set_value(player->get_current_animation_pos()); + frame->set_value(player->get_current_animation_position()); } last_active = player->is_playing(); @@ -197,7 +197,7 @@ void AnimationPlayerEditor::_play_from_pressed() { if (current != "") { - float time = player->get_current_animation_pos(); + float time = player->get_current_animation_position(); if (current == player->get_current_animation() && player->is_playing()) { @@ -245,7 +245,7 @@ void AnimationPlayerEditor::_play_bw_from_pressed() { if (current != "") { - float time = player->get_current_animation_pos(); + float time = player->get_current_animation_position(); if (current == player->get_current_animation()) player->stop(); //so it wont blend with itself @@ -944,7 +944,7 @@ void AnimationPlayerEditor::_seek_value_changed(float p_value, bool p_set) { } if (player->is_valid() && !p_set) { - float cpos = player->get_current_animation_pos(); + float cpos = player->get_current_animation_position(); player->seek_delta(pos, pos - cpos); } else { diff --git a/editor/plugins/animation_tree_editor_plugin.cpp b/editor/plugins/animation_tree_editor_plugin.cpp index 414b091475..4dd877a6ee 100644 --- a/editor/plugins/animation_tree_editor_plugin.cpp +++ b/editor/plugins/animation_tree_editor_plugin.cpp @@ -63,7 +63,7 @@ Size2 AnimationTreeEditor::_get_maximum_size() { for (List<StringName>::Element *E = order.front(); E; E = E->next()) { - Point2 pos = anim_tree->node_get_pos(E->get()); + Point2 pos = anim_tree->node_get_position(E->get()); if (click_type == CLICK_NODE && click_node == E->get()) { @@ -257,7 +257,7 @@ void AnimationTreeEditor::_popup_edit_dialog() { filter_button->hide(); edit_check->hide(); - Point2 pos = anim_tree->node_get_pos(edited_node) - Point2(h_scroll->get_value(), v_scroll->get_value()); + Point2 pos = anim_tree->node_get_position(edited_node) - Point2(h_scroll->get_value(), v_scroll->get_value()); Ref<StyleBox> style = get_stylebox("panel", "PopupMenu"); Size2 size = get_node_size(edited_node); Point2 popup_pos(pos.x + style->get_margin(MARGIN_LEFT), pos.y + size.y - style->get_margin(MARGIN_BOTTOM)); @@ -479,7 +479,7 @@ void AnimationTreeEditor::_draw_node(const StringName &p_node) { Ref<Texture> slot_icon = get_icon("VisualShaderPort", "EditorIcons"); Size2 size = get_node_size(p_node); - Point2 pos = anim_tree->node_get_pos(p_node); + Point2 pos = anim_tree->node_get_position(p_node); if (click_type == CLICK_NODE && click_node == p_node) { pos += click_motion - click_pos; @@ -618,7 +618,7 @@ AnimationTreeEditor::ClickType AnimationTreeEditor::_locate_click(const Point2 & AnimationTreePlayer::NodeType type = anim_tree->node_get_type(node); - Point2 pos = anim_tree->node_get_pos(node); + Point2 pos = anim_tree->node_get_position(node); Size2 size = get_node_size(node); pos -= Point2(h_scroll->get_value(), v_scroll->get_value()); @@ -674,7 +674,7 @@ Point2 AnimationTreeEditor::_get_slot_pos(const StringName &p_node_id, bool p_in Ref<Texture> slot_icon = get_icon("VisualShaderPort", "EditorIcons"); Size2 size = get_node_size(p_node_id); - Point2 pos = anim_tree->node_get_pos(p_node_id); + Point2 pos = anim_tree->node_get_position(p_node_id); if (click_type == CLICK_NODE && click_node == p_node_id) { @@ -806,12 +806,12 @@ void AnimationTreeEditor::_gui_input(Ref<InputEvent> p_event) { } break; case CLICK_NODE: { - Point2 new_pos = anim_tree->node_get_pos(click_node) + (click_motion - click_pos); + Point2 new_pos = anim_tree->node_get_position(click_node) + (click_motion - click_pos); if (new_pos.x < 5) new_pos.x = 5; if (new_pos.y < 5) new_pos.y = 5; - anim_tree->node_set_pos(click_node, new_pos); + anim_tree->node_set_position(click_node, new_pos); } break; default: {} @@ -1081,7 +1081,7 @@ StringName AnimationTreeEditor::_add_node(int p_item) { } anim_tree->add_node((AnimationTreePlayer::NodeType)p_item, name); - anim_tree->node_set_pos(name, Point2(last_x, last_y)); + anim_tree->node_set_position(name, Point2(last_x, last_y)); order.push_back(name); last_x += 10; last_y += 10; diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 27dad7756e..28de1ad940 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -368,7 +368,7 @@ void CanvasItemEditor::_unhandled_key_input(const Ref<InputEvent> &p_ev) { } else if (set_pivot_shortcut.is_valid() && set_pivot_shortcut->is_shortcut(p_ev) && drag == DRAG_NONE && can_move_pivot) { if (!Input::get_singleton()->is_mouse_button_pressed(0)) { List<Node *> &selection = editor_selection->get_selected_node_list(); - Vector2 mouse_pos = viewport->get_local_mouse_pos(); + Vector2 mouse_pos = viewport->get_local_mouse_position(); if (selection.size() && viewport->get_rect().has_point(mouse_pos)) { //just in case, make it work if over viewport mouse_pos = transform.affine_inverse().xform(mouse_pos); @@ -4188,13 +4188,13 @@ void CanvasItemEditorViewport::_create_nodes(Node *parent, Node *child, String & pos = parent->call("get_global_position"); } Transform2D trans = canvas->get_canvas_transform(); - Point2 target_pos = (p_point - trans.get_origin()) / trans.get_scale().x - pos; + Point2 target_position = (p_point - trans.get_origin()) / trans.get_scale().x - pos; if (default_type == "Polygon2D" || default_type == "TouchScreenButton" || default_type == "TextureRect" || default_type == "Patch9Rect") { - target_pos -= texture_size / 2; + target_position -= texture_size / 2; } // there's nothing to be used as source position so snapping will work as absolute if enabled - target_pos = canvas->snap_point(target_pos); - editor_data->get_undo_redo().add_do_method(child, "set_position", target_pos); + target_position = canvas->snap_point(target_position); + editor_data->get_undo_redo().add_do_method(child, "set_position", target_position); } bool CanvasItemEditorViewport::_create_instance(Node *parent, String &path, const Point2 &p_point) { diff --git a/editor/plugins/curve_editor_plugin.cpp b/editor/plugins/curve_editor_plugin.cpp index 615cf85aa4..70d771afc8 100644 --- a/editor/plugins/curve_editor_plugin.cpp +++ b/editor/plugins/curve_editor_plugin.cpp @@ -188,7 +188,7 @@ void CurveEditor::on_gui_input(const Ref<InputEvent> &p_event) { } else { // Drag tangent - Vector2 point_pos = curve.get_point_pos(_selected_point); + Vector2 point_pos = curve.get_point_position(_selected_point); Vector2 control_pos = get_world_pos(mpos); Vector2 dir = (control_pos - point_pos).normalized(); @@ -378,7 +378,7 @@ int CurveEditor::get_point_at(Vector2 pos) const { const float r = _hover_radius * _hover_radius; for (int i = 0; i < curve.get_point_count(); ++i) { - Vector2 p = get_view_pos(curve.get_point_pos(i)); + Vector2 p = get_view_pos(curve.get_point_position(i)); if (p.distance_squared_to(pos) <= r) { return i; } @@ -525,8 +525,8 @@ Vector2 CurveEditor::get_tangent_view_pos(int i, TangentIndex tangent) const { else dir = Vector2(1, _curve_ref->get_point_right_tangent(i)); - Vector2 point_pos = get_view_pos(_curve_ref->get_point_pos(i)); - Vector2 control_pos = get_view_pos(_curve_ref->get_point_pos(i) + dir); + Vector2 point_pos = get_view_pos(_curve_ref->get_point_position(i)); + Vector2 control_pos = get_view_pos(_curve_ref->get_point_position(i) + dir); return point_pos + _tangents_length * (control_pos - point_pos).normalized(); } @@ -549,8 +549,8 @@ static void plot_curve_accurate(const Curve &curve, float step, T plot_func) { plot_func(Vector2(0, y), Vector2(1.f, y), true); } else { - Vector2 first_point = curve.get_point_pos(0); - Vector2 last_point = curve.get_point_pos(curve.get_point_count() - 1); + Vector2 first_point = curve.get_point_position(0); + Vector2 last_point = curve.get_point_position(curve.get_point_count() - 1); // Edge lines plot_func(Vector2(0, first_point.y), first_point, false); @@ -559,8 +559,8 @@ static void plot_curve_accurate(const Curve &curve, float step, T plot_func) { // Draw section by section, so that we get maximum precision near points. // It's an accurate representation, but slower than using the baked one. for (int i = 1; i < curve.get_point_count(); ++i) { - Vector2 a = curve.get_point_pos(i - 1); - Vector2 b = curve.get_point_pos(i); + Vector2 a = curve.get_point_position(i - 1); + Vector2 b = curve.get_point_position(i); Vector2 pos = a; Vector2 prev_pos = a; @@ -667,7 +667,7 @@ void CurveEditor::_draw() { const Color tangent_color(0.5, 0.5, 1, 1); int i = _selected_point; - Vector2 pos = curve.get_point_pos(i); + Vector2 pos = curve.get_point_position(i); if (i != 0) { Vector2 control_pos = get_tangent_view_pos(i, TANGENT_LEFT); @@ -718,7 +718,7 @@ void CurveEditor::_draw() { const Color selected_point_color(1, 0.5, 0.5); for (int i = 0; i < curve.get_point_count(); ++i) { - Vector2 pos = curve.get_point_pos(i); + Vector2 pos = curve.get_point_position(i); draw_rect(Rect2(get_view_pos(pos), Vector2(1, 1)).grow(3), i == _selected_point ? selected_point_color : point_color); // TODO Circles are prettier. Needs a fix! Or a texture //draw_circle(pos, 2, point_color); @@ -728,7 +728,7 @@ void CurveEditor::_draw() { if (_hover_point != -1) { const Color hover_color = line_color; - Vector2 pos = curve.get_point_pos(_hover_point); + Vector2 pos = curve.get_point_position(_hover_point); stroke_rect(Rect2(get_view_pos(pos), Vector2(1, 1)).grow(_hover_radius), hover_color); } diff --git a/editor/plugins/line_2d_editor_plugin.cpp b/editor/plugins/line_2d_editor_plugin.cpp index 84620a75a5..ef3ee6a78f 100644 --- a/editor/plugins/line_2d_editor_plugin.cpp +++ b/editor/plugins/line_2d_editor_plugin.cpp @@ -66,7 +66,7 @@ int Line2DEditor::get_point_index_at(Vector2 gpos) { Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform(); for (int i = 0; i < node->get_point_count(); ++i) { - Point2 p = xform.xform(node->get_point_pos(i)); + Point2 p = xform.xform(node->get_point_position(i)); if (gpos.distance_to(p) < grab_threshold) { return i; } @@ -96,12 +96,12 @@ bool Line2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) { if (mb->get_button_index() == BUTTON_LEFT && !mb->get_shift() && mode == MODE_EDIT) { _dragging = true; action_point = i; - moving_from = node->get_point_pos(i); + moving_from = node->get_point_position(i); moving_screen_from = gpoint; } else if ((mb->get_button_index() == BUTTON_RIGHT && mode == MODE_EDIT) || (mb->get_button_index() == BUTTON_LEFT && mode == MODE_DELETE)) { undo_redo->create_action(TTR("Remove Point from Line2D")); undo_redo->add_do_method(node, "remove_point", i); - undo_redo->add_undo_method(node, "add_point", node->get_point_pos(i), i); + undo_redo->add_undo_method(node, "add_point", node->get_point_position(i), i); undo_redo->add_do_method(canvas_item_editor->get_viewport_control(), "update"); undo_redo->add_undo_method(canvas_item_editor->get_viewport_control(), "update"); undo_redo->commit_action(); @@ -121,7 +121,7 @@ bool Line2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) { _dragging = true; action_point = node->get_point_count() - 1; - moving_from = node->get_point_pos(action_point); + moving_from = node->get_point_position(action_point); moving_screen_from = gpoint; canvas_item_editor->get_viewport_control()->update(); @@ -131,8 +131,8 @@ bool Line2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) { if (!mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT && _dragging) { undo_redo->create_action(TTR("Move Point in Line2D")); - undo_redo->add_do_method(node, "set_point_pos", action_point, cpoint); - undo_redo->add_undo_method(node, "set_point_pos", action_point, moving_from); + undo_redo->add_do_method(node, "set_point_position", action_point, cpoint); + undo_redo->add_undo_method(node, "set_point_position", action_point, moving_from); undo_redo->add_do_method(canvas_item_editor->get_viewport_control(), "update"); undo_redo->add_undo_method(canvas_item_editor->get_viewport_control(), "update"); undo_redo->commit_action(); @@ -147,7 +147,7 @@ bool Line2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) { if (_dragging) { Vector2 cpoint = mouse_to_local_pos(mm->get_position(), mm->get_alt()); - node->set_point_pos(action_point, cpoint); + node->set_point_position(action_point, cpoint); canvas_item_editor->get_viewport_control()->update(); return true; } @@ -172,7 +172,7 @@ void Line2DEditor::_canvas_draw() { Control *vpc = canvas_item_editor->get_viewport_control(); for (int i = 0; i < len; ++i) { - Vector2 point = xform.xform(node->get_point_pos(i)); + Vector2 point = xform.xform(node->get_point_position(i)); vpc->draw_texture_rect(handle, Rect2(point - handle_size * 0.5, handle_size), false); } } diff --git a/editor/plugins/path_2d_editor_plugin.cpp b/editor/plugins/path_2d_editor_plugin.cpp index adc8d4f091..1160e90384 100644 --- a/editor/plugins/path_2d_editor_plugin.cpp +++ b/editor/plugins/path_2d_editor_plugin.cpp @@ -89,9 +89,9 @@ bool Path2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) { for (int i = 0; i < curve->get_point_count(); i++) { - real_t dist_to_p = gpoint.distance_to(xform.xform(curve->get_point_pos(i))); - real_t dist_to_p_out = gpoint.distance_to(xform.xform(curve->get_point_pos(i) + curve->get_point_out(i))); - real_t dist_to_p_in = gpoint.distance_to(xform.xform(curve->get_point_pos(i) + curve->get_point_in(i))); + real_t dist_to_p = gpoint.distance_to(xform.xform(curve->get_point_position(i))); + real_t dist_to_p_out = gpoint.distance_to(xform.xform(curve->get_point_position(i) + curve->get_point_out(i))); + real_t dist_to_p_in = gpoint.distance_to(xform.xform(curve->get_point_position(i) + curve->get_point_in(i))); // Check for point movement start (for point + in/out controls). if (mb->get_button_index() == BUTTON_LEFT) { @@ -100,7 +100,7 @@ bool Path2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) { action = ACTION_MOVING_POINT; action_point = i; - moving_from = curve->get_point_pos(i); + moving_from = curve->get_point_position(i); moving_screen_from = gpoint; return true; } else if (mode == MODE_EDIT || mode == MODE_EDIT_CURVE) { @@ -129,7 +129,7 @@ bool Path2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) { undo_redo->create_action(TTR("Remove Point from Curve")); undo_redo->add_do_method(curve.ptr(), "remove_point", i); - undo_redo->add_undo_method(curve.ptr(), "add_point", curve->get_point_pos(i), curve->get_point_in(i), curve->get_point_out(i), i); + undo_redo->add_undo_method(curve.ptr(), "add_point", curve->get_point_position(i), curve->get_point_in(i), curve->get_point_out(i), i); undo_redo->add_do_method(canvas_item_editor->get_viewport_control(), "update"); undo_redo->add_undo_method(canvas_item_editor->get_viewport_control(), "update"); undo_redo->commit_action(); @@ -171,7 +171,7 @@ bool Path2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) { action = ACTION_MOVING_POINT; action_point = curve->get_point_count() - 1; - moving_from = curve->get_point_pos(action_point); + moving_from = curve->get_point_position(action_point); moving_screen_from = gpoint; canvas_item_editor->get_viewport_control()->update(); @@ -194,8 +194,8 @@ bool Path2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) { case ACTION_MOVING_POINT: { undo_redo->create_action(TTR("Move Point in Curve")); - undo_redo->add_do_method(curve.ptr(), "set_point_pos", action_point, cpoint); - undo_redo->add_undo_method(curve.ptr(), "set_point_pos", action_point, moving_from); + undo_redo->add_do_method(curve.ptr(), "set_point_position", action_point, cpoint); + undo_redo->add_undo_method(curve.ptr(), "set_point_position", action_point, moving_from); undo_redo->add_do_method(canvas_item_editor->get_viewport_control(), "update"); undo_redo->add_undo_method(canvas_item_editor->get_viewport_control(), "update"); undo_redo->commit_action(); @@ -255,7 +255,7 @@ bool Path2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) { break; case ACTION_MOVING_POINT: { - curve->set_point_pos(action_point, cpoint); + curve->set_point_position(action_point, cpoint); } break; case ACTION_MOVING_IN: { @@ -296,17 +296,17 @@ void Path2DEditor::_canvas_draw() { for (int i = 0; i < len; i++) { - Vector2 point = xform.xform(curve->get_point_pos(i)); + Vector2 point = xform.xform(curve->get_point_position(i)); vpc->draw_texture_rect(handle, Rect2(point - handle_size * 0.5, handle_size), false, Color(1, 1, 1, 1)); if (i < len - 1) { - Vector2 pointout = xform.xform(curve->get_point_pos(i) + curve->get_point_out(i)); + Vector2 pointout = xform.xform(curve->get_point_position(i) + curve->get_point_out(i)); vpc->draw_line(point, pointout, Color(0.5, 0.5, 1.0, 0.8), 1.0); vpc->draw_texture_rect(handle, Rect2(pointout - handle_size * 0.5, handle_size), false, Color(1, 0.5, 1, 0.3)); } if (i > 0) { - Vector2 pointin = xform.xform(curve->get_point_pos(i) + curve->get_point_in(i)); + Vector2 pointin = xform.xform(curve->get_point_position(i) + curve->get_point_in(i)); vpc->draw_line(point, pointin, Color(0.5, 0.5, 1.0, 0.8), 1.0); vpc->draw_texture_rect(handle, Rect2(pointin - handle_size * 0.5, handle_size), false, Color(1, 0.5, 1, 0.3)); } @@ -389,8 +389,8 @@ void Path2DEditor::_mode_selected(int p_mode) { if (node->get_curve()->get_point_count() < 3) return; - Vector2 begin = node->get_curve()->get_point_pos(0); - Vector2 end = node->get_curve()->get_point_pos(node->get_curve()->get_point_count() - 1); + Vector2 begin = node->get_curve()->get_point_position(0); + Vector2 end = node->get_curve()->get_point_position(node->get_curve()->get_point_count() - 1); if (begin.distance_to(end) < CMP_EPSILON) return; diff --git a/editor/plugins/path_editor_plugin.cpp b/editor/plugins/path_editor_plugin.cpp index d0f2b19ed3..fa97c96614 100644 --- a/editor/plugins/path_editor_plugin.cpp +++ b/editor/plugins/path_editor_plugin.cpp @@ -64,7 +64,7 @@ Variant PathSpatialGizmo::get_handle_value(int p_idx) const { if (p_idx < c->get_point_count()) { - original = c->get_point_pos(p_idx); + original = c->get_point_position(p_idx); return original; } @@ -79,7 +79,7 @@ Variant PathSpatialGizmo::get_handle_value(int p_idx) const { else ofs = c->get_point_out(idx); - original = ofs + c->get_point_pos(idx); + original = ofs + c->get_point_position(idx); return ofs; } @@ -108,7 +108,7 @@ void PathSpatialGizmo::set_handle(int p_idx, Camera *p_camera, const Point2 &p_p } Vector3 local = gi.xform(inters); - c->set_point_pos(p_idx, local); + c->set_point_position(p_idx, local); } return; @@ -119,7 +119,7 @@ void PathSpatialGizmo::set_handle(int p_idx, Camera *p_camera, const Point2 &p_p int idx = p_idx / 2; int t = p_idx % 2; - Vector3 base = c->get_point_pos(idx); + Vector3 base = c->get_point_position(idx); Plane p(gt.xform(original), p_camera->get_transform().basis.get_axis(2)); @@ -148,12 +148,12 @@ void PathSpatialGizmo::commit_handle(int p_idx, const Variant &p_restore, bool p if (p_cancel) { - c->set_point_pos(p_idx, p_restore); + c->set_point_position(p_idx, p_restore); return; } - ur->create_action(TTR("Set Curve Point Pos")); - ur->add_do_method(c.ptr(), "set_point_pos", p_idx, c->get_point_pos(p_idx)); - ur->add_undo_method(c.ptr(), "set_point_pos", p_idx, p_restore); + ur->create_action(TTR("Set Curve Point Position")); + ur->add_do_method(c.ptr(), "set_point_position", p_idx, c->get_point_position(p_idx)); + ur->add_undo_method(c.ptr(), "set_point_position", p_idx, p_restore); ur->commit_action(); return; @@ -178,7 +178,7 @@ void PathSpatialGizmo::commit_handle(int p_idx, const Variant &p_restore, bool p c->set_point_in(p_idx, p_restore); return; } - ur->create_action(TTR("Set Curve In Pos")); + ur->create_action(TTR("Set Curve In Position")); ur->add_do_method(c.ptr(), "set_point_in", idx, c->get_point_in(idx)); ur->add_undo_method(c.ptr(), "set_point_in", idx, p_restore); ur->commit_action(); @@ -189,7 +189,7 @@ void PathSpatialGizmo::commit_handle(int p_idx, const Variant &p_restore, bool p c->set_point_out(idx, p_restore); return; } - ur->create_action(TTR("Set Curve Out Pos")); + ur->create_action(TTR("Set Curve Out Position")); ur->add_do_method(c.ptr(), "set_point_out", idx, c->get_point_out(idx)); ur->add_undo_method(c.ptr(), "set_point_out", idx, p_restore); ur->commit_action(); @@ -234,7 +234,7 @@ void PathSpatialGizmo::redraw() { for (int i = 0; i < c->get_point_count(); i++) { - Vector3 p = c->get_point_pos(i); + Vector3 p = c->get_point_position(i); handles.push_back(p); if (i > 0) { v3p.push_back(p); @@ -307,16 +307,16 @@ bool PathEditorPlugin::forward_spatial_gui_input(Camera *p_camera, const Ref<Inp if (rc >= 2) { PoolVector<Vector3>::Read r = v3a.read(); - if (p_camera->unproject_position(gt.xform(c->get_point_pos(0))).distance_to(mbpos) < click_dist) + if (p_camera->unproject_position(gt.xform(c->get_point_position(0))).distance_to(mbpos) < click_dist) return false; //nope, existing for (int i = 0; i < c->get_point_count() - 1; i++) { //find the offset and point index of the place to break up int j = idx; - if (p_camera->unproject_position(gt.xform(c->get_point_pos(i + 1))).distance_to(mbpos) < click_dist) + if (p_camera->unproject_position(gt.xform(c->get_point_position(i + 1))).distance_to(mbpos) < click_dist) return false; //nope, existing - while (j < rc && c->get_point_pos(i + 1) != r[j]) { + while (j < rc && c->get_point_position(i + 1) != r[j]) { Vector3 from = r[j]; Vector3 to = r[j + 1]; @@ -371,7 +371,7 @@ bool PathEditorPlugin::forward_spatial_gui_input(Camera *p_camera, const Ref<Inp if (c->get_point_count() == 0) org = path->get_transform().get_origin(); else - org = gt.xform(c->get_point_pos(c->get_point_count() - 1)); + org = gt.xform(c->get_point_position(c->get_point_count() - 1)); Plane p(org, p_camera->get_transform().basis.get_axis(2)); Vector3 ray_from = p_camera->project_ray_origin(mbpos); Vector3 ray_dir = p_camera->project_ray_normal(mbpos); @@ -392,9 +392,9 @@ bool PathEditorPlugin::forward_spatial_gui_input(Camera *p_camera, const Ref<Inp } else if (mb->is_pressed() && ((mb->get_button_index() == BUTTON_LEFT && curve_del->is_pressed()) || (mb->get_button_index() == BUTTON_RIGHT && curve_edit->is_pressed()))) { for (int i = 0; i < c->get_point_count(); i++) { - real_t dist_to_p = p_camera->unproject_position(gt.xform(c->get_point_pos(i))).distance_to(mbpos); - real_t dist_to_p_out = p_camera->unproject_position(gt.xform(c->get_point_pos(i) + c->get_point_out(i))).distance_to(mbpos); - real_t dist_to_p_in = p_camera->unproject_position(gt.xform(c->get_point_pos(i) + c->get_point_in(i))).distance_to(mbpos); + real_t dist_to_p = p_camera->unproject_position(gt.xform(c->get_point_position(i))).distance_to(mbpos); + real_t dist_to_p_out = p_camera->unproject_position(gt.xform(c->get_point_position(i) + c->get_point_out(i))).distance_to(mbpos); + real_t dist_to_p_in = p_camera->unproject_position(gt.xform(c->get_point_position(i) + c->get_point_in(i))).distance_to(mbpos); // Find the offset and point index of the place to break up. // Also check for the control points. @@ -403,7 +403,7 @@ bool PathEditorPlugin::forward_spatial_gui_input(Camera *p_camera, const Ref<Inp UndoRedo *ur = editor->get_undo_redo(); ur->create_action(TTR("Remove Path Point")); ur->add_do_method(c.ptr(), "remove_point", i); - ur->add_undo_method(c.ptr(), "add_point", c->get_point_pos(i), c->get_point_in(i), c->get_point_out(i), i); + ur->add_undo_method(c.ptr(), "add_point", c->get_point_position(i), c->get_point_in(i), c->get_point_out(i), i); ur->commit_action(); return true; } else if (dist_to_p_out < click_dist) { @@ -496,7 +496,7 @@ void PathEditorPlugin::_close_curve() { return; if (c->get_point_count() < 2) return; - c->add_point(c->get_point_pos(0), c->get_point_in(0), c->get_point_out(0)); + c->add_point(c->get_point_position(0), c->get_point_in(0), c->get_point_out(0)); } void PathEditorPlugin::_notification(int p_what) { diff --git a/editor/plugins/resource_preloader_editor_plugin.cpp b/editor/plugins/resource_preloader_editor_plugin.cpp index e157ddbf90..da4a3f84d6 100644 --- a/editor/plugins/resource_preloader_editor_plugin.cpp +++ b/editor/plugins/resource_preloader_editor_plugin.cpp @@ -254,7 +254,7 @@ void ResourcePreloaderEditor::edit(ResourcePreloader *p_preloader) { Variant ResourcePreloaderEditor::get_drag_data_fw(const Point2 &p_point, Control *p_from) { - TreeItem *ti = tree->get_item_at_pos(p_point); + TreeItem *ti = tree->get_item_at_position(p_point); if (!ti) return Variant(); diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index c875ee7011..d3c75d1c42 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -306,7 +306,7 @@ Variant ScriptTextEditor::get_edit_state() { Dictionary state; - state["scroll_pos"] = code_editor->get_text_edit()->get_v_scroll(); + state["scroll_position"] = code_editor->get_text_edit()->get_v_scroll(); state["column"] = code_editor->get_text_edit()->cursor_get_column(); state["row"] = code_editor->get_text_edit()->cursor_get_line(); @@ -509,7 +509,7 @@ void ScriptTextEditor::ensure_focus() { void ScriptTextEditor::set_edit_state(const Variant &p_state) { Dictionary state = p_state; - code_editor->get_text_edit()->set_v_scroll(state["scroll_pos"]); + code_editor->get_text_edit()->set_v_scroll(state["scroll_position"]); code_editor->get_text_edit()->cursor_set_column(state["column"]); code_editor->get_text_edit()->cursor_set_line(state["row"]); code_editor->get_text_edit()->grab_focus(); @@ -1397,7 +1397,7 @@ void ScriptTextEditor::_text_edit_gui_input(const Ref<InputEvent> &ev) { float alpha = color.size() > 3 ? color[3] : 1.0f; color_picker->set_pick_color(Color(color[0], color[1], color[2], alpha)); } - color_panel->set_position(get_global_transform().xform(get_local_mouse_pos())); + color_panel->set_position(get_global_transform().xform(get_local_mouse_position())); } else { have_color = false; } @@ -1445,7 +1445,7 @@ void ScriptTextEditor::_make_context_menu(bool p_selection, bool p_color) { context_menu->add_separator(); context_menu->add_item(TTR("Pick Color"), EDIT_PICK_COLOR); } - context_menu->set_position(get_global_transform().xform(get_local_mouse_pos())); + context_menu->set_position(get_global_transform().xform(get_local_mouse_position())); context_menu->set_size(Vector2(1, 1)); context_menu->popup(); } diff --git a/editor/plugins/shader_graph_editor_plugin.cpp b/editor/plugins/shader_graph_editor_plugin.cpp index 732344cb78..f1863c3ca4 100644 --- a/editor/plugins/shader_graph_editor_plugin.cpp +++ b/editor/plugins/shader_graph_editor_plugin.cpp @@ -54,7 +54,7 @@ void GraphColorRampEdit::_gui_input(const InputEvent& p_event) { if (p_event.type==InputEvent::MOUSE_BUTTON && p_event->get_button_index()==1 && p_event->is_pressed()) { update(); - int x = p_event->get_pos().x; + int x = p_event->get_position().x; int total_w = get_size().width-get_size().height-3; if (x>total_w+3) { @@ -333,7 +333,7 @@ void GraphCurveMapEdit::_gui_input(const InputEvent& p_event) { if (p_event.type==InputEvent::MOUSE_BUTTON && p_event->get_button_index()==1 && p_event->is_pressed()) { update(); - Point2 p = Vector2(p_event->get_pos().x,p_event->get_pos().y)/get_size(); + Point2 p = Vector2(p_event->get_position().x,p_event->get_position().y)/get_size(); p.y=1.0-p.y; grabbed=-1; grabbing=true; @@ -384,7 +384,7 @@ void GraphCurveMapEdit::_gui_input(const InputEvent& p_event) { if (p_event.type==InputEvent::MOUSE_MOTION && grabbing && grabbed != -1) { - Point2 p = Vector2(p_event->get_pos().x,p_event->get_pos().y)/get_size(); + Point2 p = Vector2(p_event->get_position().x,p_event->get_position().y)/get_size(); p.y=1.0-p.y; p.x = CLAMP(p.x,0.0,1.0); @@ -1205,7 +1205,7 @@ void ShaderGraphView::_move_node(int p_id,const Vector2& p_to) { ERR_FAIL_COND(!node_map.has(p_id)); node_map[p_id]->set_offset(p_to); - graph->node_set_pos(type,p_id,p_to); + graph->node_set_position(type,p_id,p_to); } void ShaderGraphView::_duplicate_nodes_request() @@ -2463,7 +2463,7 @@ void ShaderGraphView::_create_node(int p_id) { gn->connect("close_request",this,"_node_removed",varray(p_id),CONNECT_DEFERRED); graph_edit->add_child(gn); node_map[p_id]=gn; - gn->set_offset(graph->node_get_pos(type,p_id)); + gn->set_offset(graph->node_get_position(type,p_id)); } @@ -2657,7 +2657,7 @@ void ShaderGraphView::add_node(int p_type, const Vector2 &location) { while(true) { bool valid=true; for(List<int>::Element *E=existing.front();E;E=E->next()) { - Vector2 pos = graph->node_get_pos(type,E->get()); + Vector2 pos = graph->node_get_position(type,E->get()); if (init_ofs==pos) { init_ofs+=Vector2(20,20); valid=false; @@ -2672,7 +2672,7 @@ void ShaderGraphView::add_node(int p_type, const Vector2 &location) { UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo(); ur->create_action(TTR("Add Shader Graph Node")); ur->add_do_method(graph.ptr(),"node_add",type,p_type,newid); - ur->add_do_method(graph.ptr(),"node_set_pos",type,newid,init_ofs); + ur->add_do_method(graph.ptr(),"node_set_position",type,newid,init_ofs); ur->add_undo_method(graph.ptr(),"node_remove",type,newid); ur->add_do_method(this,"_update_graph"); ur->add_undo_method(this,"_update_graph"); @@ -2765,7 +2765,7 @@ void ShaderGraphEditor::_add_node(int p_type) { void ShaderGraphEditor::_popup_requested(const Vector2 &p_position) { Vector2 scroll_ofs=graph_edits[tabs->get_current_tab()]->get_graph_edit()->get_scroll_ofs(); - next_location = get_local_mouse_pos() + scroll_ofs; + next_location = get_local_mouse_position() + scroll_ofs; popup->set_global_position(p_position); popup->set_size( Size2( 200, 0) ); popup->popup(); diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index c1b0fdb5d6..6b485aab7c 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -217,7 +217,7 @@ Transform SpatialEditorViewport::_get_camera_transform() const { return camera->get_global_transform(); } -Vector3 SpatialEditorViewport::_get_camera_pos() const { +Vector3 SpatialEditorViewport::_get_camera_position() const { return _get_camera_transform().origin; } @@ -464,7 +464,7 @@ void SpatialEditorViewport::_select_region() { Vector<Plane> frustum; - Vector3 cam_pos = _get_camera_pos(); + Vector3 cam_pos = _get_camera_position(); Set<Ref<SpatialEditorGizmo> > found_gizmos; for (int i = 0; i < 4; i++) { @@ -2366,9 +2366,9 @@ void SpatialEditorViewport::update_transform_gizmo_view() { void SpatialEditorViewport::set_state(const Dictionary &p_state) { - cursor.pos = p_state["pos"]; - cursor.x_rot = p_state["x_rot"]; - cursor.y_rot = p_state["y_rot"]; + cursor.pos = p_state["position"]; + cursor.x_rot = p_state["x_rotation"]; + cursor.y_rot = p_state["y_rotation"]; cursor.distance = p_state["distance"]; bool env = p_state["use_environment"]; bool orth = p_state["use_orthogonal"]; @@ -2410,9 +2410,9 @@ void SpatialEditorViewport::set_state(const Dictionary &p_state) { Dictionary SpatialEditorViewport::get_state() const { Dictionary d; - d["pos"] = cursor.pos; - d["x_rot"] = cursor.x_rot; - d["y_rot"] = cursor.y_rot; + d["position"] = cursor.pos; + d["x_rotation"] = cursor.x_rot; + d["y_rotation"] = cursor.y_rot; d["distance"] = cursor.distance; d["use_environment"] = camera->get_environment().is_valid(); d["use_orthogonal"] = camera->get_projection() == Camera::PROJECTION_ORTHOGONAL; diff --git a/editor/plugins/spatial_editor_plugin.h b/editor/plugins/spatial_editor_plugin.h index 5f3ef2dbee..e0ded6e646 100644 --- a/editor/plugins/spatial_editor_plugin.h +++ b/editor/plugins/spatial_editor_plugin.h @@ -157,7 +157,7 @@ private: Transform _get_camera_transform() const; int get_selected_count() const; - Vector3 _get_camera_pos() const; + Vector3 _get_camera_position() const; Vector3 _get_camera_normal() const; Vector3 _get_screen_to_space(const Vector3 &p_vector3); diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp index 7b40f69082..b9cb1788f0 100644 --- a/editor/plugins/sprite_frames_editor_plugin.cpp +++ b/editor/plugins/sprite_frames_editor_plugin.cpp @@ -544,7 +544,7 @@ Variant SpriteFramesEditor::get_drag_data_fw(const Point2 &p_point, Control *p_f if (!frames->has_animation(edited_anim)) return false; - int idx = tree->get_item_at_pos(p_point, true); + int idx = tree->get_item_at_position(p_point, true); if (idx < 0 || idx >= frames->get_frame_count(edited_anim)) return Variant(); @@ -609,7 +609,7 @@ void SpriteFramesEditor::drop_data_fw(const Point2 &p_point, const Variant &p_da if (!d.has("type")) return; - int at_pos = tree->get_item_at_pos(p_point, true); + int at_pos = tree->get_item_at_position(p_point, true); if (String(d["type"]) == "resource" && d.has("resource")) { RES r = d["resource"]; @@ -643,7 +643,7 @@ void SpriteFramesEditor::_bind_methods() { ClassDB::bind_method(D_METHOD("_empty2_pressed"), &SpriteFramesEditor::_empty2_pressed); ClassDB::bind_method(D_METHOD("_delete_pressed"), &SpriteFramesEditor::_delete_pressed); ClassDB::bind_method(D_METHOD("_paste_pressed"), &SpriteFramesEditor::_paste_pressed); - ClassDB::bind_method(D_METHOD("_file_load_request", "files", "atpos"), &SpriteFramesEditor::_file_load_request, DEFVAL(-1)); + ClassDB::bind_method(D_METHOD("_file_load_request", "files", "at_position"), &SpriteFramesEditor::_file_load_request, DEFVAL(-1)); ClassDB::bind_method(D_METHOD("_update_library", "skipsel"), &SpriteFramesEditor::_update_library, DEFVAL(false)); ClassDB::bind_method(D_METHOD("_up_pressed"), &SpriteFramesEditor::_up_pressed); ClassDB::bind_method(D_METHOD("_down_pressed"), &SpriteFramesEditor::_down_pressed); |