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 /modules/visual_script | |
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 'modules/visual_script')
-rw-r--r-- | modules/visual_script/visual_script.cpp | 10 | ||||
-rw-r--r-- | modules/visual_script/visual_script.h | 4 | ||||
-rw-r--r-- | modules/visual_script/visual_script_editor.cpp | 22 |
3 files changed, 18 insertions, 18 deletions
diff --git a/modules/visual_script/visual_script.cpp b/modules/visual_script/visual_script.cpp index 88012d2031..c665fa12cf 100644 --- a/modules/visual_script/visual_script.cpp +++ b/modules/visual_script/visual_script.cpp @@ -423,7 +423,7 @@ Ref<VisualScriptNode> VisualScript::get_node(const StringName &p_func, int p_id) return func.nodes[p_id].node; } -void VisualScript::set_node_pos(const StringName &p_func, int p_id, const Point2 &p_pos) { +void VisualScript::set_node_position(const StringName &p_func, int p_id, const Point2 &p_pos) { ERR_FAIL_COND(instances.size()); ERR_FAIL_COND(!functions.has(p_func)); @@ -433,7 +433,7 @@ void VisualScript::set_node_pos(const StringName &p_func, int p_id, const Point2 func.nodes[p_id].pos = p_pos; } -Point2 VisualScript::get_node_pos(const StringName &p_func, int p_id) const { +Point2 VisualScript::get_node_position(const StringName &p_func, int p_id) const { ERR_FAIL_COND_V(!functions.has(p_func), Point2()); const Function &func = functions[p_func]; @@ -1273,14 +1273,14 @@ void VisualScript::_bind_methods() { ClassDB::bind_method(D_METHOD("set_function_scroll", "name", "ofs"), &VisualScript::set_function_scroll); ClassDB::bind_method(D_METHOD("get_function_scroll", "name"), &VisualScript::get_function_scroll); - ClassDB::bind_method(D_METHOD("add_node", "func", "id", "node", "pos"), &VisualScript::add_node, DEFVAL(Point2())); + ClassDB::bind_method(D_METHOD("add_node", "func", "id", "node", "position"), &VisualScript::add_node, DEFVAL(Point2())); ClassDB::bind_method(D_METHOD("remove_node", "func", "id"), &VisualScript::remove_node); ClassDB::bind_method(D_METHOD("get_function_node_id", "name"), &VisualScript::get_function_node_id); ClassDB::bind_method(D_METHOD("get_node", "func", "id"), &VisualScript::get_node); ClassDB::bind_method(D_METHOD("has_node", "func", "id"), &VisualScript::has_node); - ClassDB::bind_method(D_METHOD("set_node_pos", "func", "id", "pos"), &VisualScript::set_node_pos); - ClassDB::bind_method(D_METHOD("get_node_pos", "func", "id"), &VisualScript::get_node_pos); + ClassDB::bind_method(D_METHOD("set_node_position", "func", "id", "position"), &VisualScript::set_node_position); + ClassDB::bind_method(D_METHOD("get_node_position", "func", "id"), &VisualScript::get_node_position); ClassDB::bind_method(D_METHOD("sequence_connect", "func", "from_node", "from_output", "to_node"), &VisualScript::sequence_connect); ClassDB::bind_method(D_METHOD("sequence_disconnect", "func", "from_node", "from_output", "to_node"), &VisualScript::sequence_disconnect); diff --git a/modules/visual_script/visual_script.h b/modules/visual_script/visual_script.h index 297e9e510f..4ae50ee829 100644 --- a/modules/visual_script/visual_script.h +++ b/modules/visual_script/visual_script.h @@ -278,8 +278,8 @@ public: void remove_node(const StringName &p_func, int p_id); bool has_node(const StringName &p_func, int p_id) const; Ref<VisualScriptNode> get_node(const StringName &p_func, int p_id) const; - void set_node_pos(const StringName &p_func, int p_id, const Point2 &p_pos); - Point2 get_node_pos(const StringName &p_func, int p_id) const; + void set_node_position(const StringName &p_func, int p_id, const Point2 &p_pos); + Point2 get_node_position(const StringName &p_func, int p_id) const; void get_node_list(const StringName &p_func, List<int> *r_nodes) const; void sequence_connect(const StringName &p_func, int p_from_node, int p_from_output, int p_to_node); diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index ee83c44793..d0ab29f184 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -481,7 +481,7 @@ void VisualScriptEditor::_update_graph(int p_only_id) { continue; Ref<VisualScriptNode> node = script->get_node(edited_func, E->get()); - Vector2 pos = script->get_node_pos(edited_func, E->get()); + Vector2 pos = script->get_node_position(edited_func, E->get()); GraphNode *gnode = memnew(GraphNode); gnode->set_title(node->get_caption()); @@ -1065,7 +1065,7 @@ void VisualScriptEditor::_available_node_doubleclicked() { List<int> existing; script->get_node_list(edited_func, &existing); for (List<int>::Element *E = existing.front(); E; E = E->next()) { - Point2 pos = script->get_node_pos(edited_func, E->get()); + Point2 pos = script->get_node_position(edited_func, E->get()); if (pos.distance_to(ofs) < 15) { ofs += Vector2(graph->get_snap(), graph->get_snap()); exists = true; @@ -1186,7 +1186,7 @@ void VisualScriptEditor::_on_nodes_delete() { for (List<int>::Element *F = to_erase.front(); F; F = F->next()) { undo_redo->add_do_method(script.ptr(), "remove_node", edited_func, F->get()); - undo_redo->add_undo_method(script.ptr(), "add_node", edited_func, F->get(), script->get_node(edited_func, F->get()), script->get_node_pos(edited_func, F->get())); + undo_redo->add_undo_method(script.ptr(), "add_node", edited_func, F->get(), script->get_node(edited_func, F->get()), script->get_node_position(edited_func, F->get())); List<VisualScript::SequenceConnection> sequence_conns; script->get_sequence_connection_list(edited_func, &sequence_conns); @@ -1243,7 +1243,7 @@ void VisualScriptEditor::_on_nodes_duplicate() { int new_id = idc++; to_select.insert(new_id); - undo_redo->add_do_method(script.ptr(), "add_node", edited_func, new_id, dupe, script->get_node_pos(edited_func, F->get()) + Vector2(20, 20)); + undo_redo->add_do_method(script.ptr(), "add_node", edited_func, new_id, dupe, script->get_node_position(edited_func, F->get()) + Vector2(20, 20)); undo_redo->add_undo_method(script.ptr(), "remove_node", edited_func, new_id); } undo_redo->add_do_method(this, "_update_graph"); @@ -1277,7 +1277,7 @@ Variant VisualScriptEditor::get_drag_data_fw(const Point2 &p_point, Control *p_f if (p_from == nodes) { - TreeItem *it = nodes->get_item_at_pos(p_point); + TreeItem *it = nodes->get_item_at_position(p_point); if (!it) return Variant(); String type = it->get_metadata(0); @@ -1296,7 +1296,7 @@ Variant VisualScriptEditor::get_drag_data_fw(const Point2 &p_point, Control *p_f if (p_from == members) { - TreeItem *it = members->get_item_at_pos(p_point); + TreeItem *it = members->get_item_at_position(p_point); if (!it) return Variant(); @@ -2197,7 +2197,7 @@ void VisualScriptEditor::_move_node(String func, int p_id, const Vector2 &p_to) if (Object::cast_to<GraphNode>(node)) Object::cast_to<GraphNode>(node)->set_offset(p_to); } - script->set_node_pos(edited_func, p_id, p_to / EDSCALE); + script->set_node_position(edited_func, p_id, p_to / EDSCALE); } void VisualScriptEditor::_node_moved(Vector2 p_from, Vector2 p_to, int p_id) { @@ -2211,7 +2211,7 @@ void VisualScriptEditor::_remove_node(int p_id) { undo_redo->create_action(TTR("Remove VisualScript Node")); undo_redo->add_do_method(script.ptr(), "remove_node", edited_func, p_id); - undo_redo->add_undo_method(script.ptr(), "add_node", edited_func, p_id, script->get_node(edited_func, p_id), script->get_node_pos(edited_func, p_id)); + undo_redo->add_undo_method(script.ptr(), "add_node", edited_func, p_id, script->get_node(edited_func, p_id), script->get_node_position(edited_func, p_id)); List<VisualScript::SequenceConnection> sequence_conns; script->get_sequence_connection_list(edited_func, &sequence_conns); @@ -2895,7 +2895,7 @@ void VisualScriptEditor::_menu_option(int p_what) { } if (node.is_valid()) { clipboard->nodes[id] = node->duplicate(); - clipboard->nodes_positions[id] = script->get_node_pos(edited_func, id); + clipboard->nodes_positions[id] = script->get_node_position(edited_func, id); } } } @@ -2955,7 +2955,7 @@ void VisualScriptEditor::_menu_option(int p_what) { List<int> nodes; script->get_node_list(edited_func, &nodes); for (List<int>::Element *E = nodes.front(); E; E = E->next()) { - Vector2 pos = script->get_node_pos(edited_func, E->get()).snapped(Vector2(2, 2)); + Vector2 pos = script->get_node_position(edited_func, E->get()).snapped(Vector2(2, 2)); existing_positions.insert(pos); } } @@ -3069,7 +3069,7 @@ void VisualScriptEditor::_member_option(int p_option) { List<int> nodes; script->get_node_list(name, &nodes); for (List<int>::Element *E = nodes.front(); E; E = E->next()) { - undo_redo->add_undo_method(script.ptr(), "add_node", name, E->get(), script->get_node(name, E->get()), script->get_node_pos(name, E->get())); + undo_redo->add_undo_method(script.ptr(), "add_node", name, E->get(), script->get_node(name, E->get()), script->get_node_position(name, E->get())); } List<VisualScript::SequenceConnection> seq_connections; |