You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-09 12:50:35 +00:00
Make translatable some undo/redo operations in the editor
This commit is contained in:
@@ -200,7 +200,7 @@ void AnimationNodeBlendSpace2DEditor::_blend_space_gui_input(const Ref<InputEven
|
||||
}
|
||||
|
||||
updating = true;
|
||||
undo_redo->create_action("Add Triangle");
|
||||
undo_redo->create_action(TTR("Add Triangle"));
|
||||
undo_redo->add_do_method(blend_space.ptr(), "add_triangle", making_triangle[0], making_triangle[1], making_triangle[2]);
|
||||
undo_redo->add_undo_method(blend_space.ptr(), "remove_triangle", blend_space->get_triangle_count());
|
||||
undo_redo->add_do_method(this, "_update_space");
|
||||
@@ -225,7 +225,7 @@ void AnimationNodeBlendSpace2DEditor::_blend_space_gui_input(const Ref<InputEven
|
||||
}
|
||||
|
||||
updating = true;
|
||||
undo_redo->create_action("Move Node Point");
|
||||
undo_redo->create_action(TTR("Move Node Point"));
|
||||
undo_redo->add_do_method(blend_space.ptr(), "set_blend_point_position", selected_point, point);
|
||||
undo_redo->add_undo_method(blend_space.ptr(), "set_blend_point_position", selected_point, blend_space->get_blend_point_position(selected_point));
|
||||
undo_redo->add_do_method(this, "_update_space");
|
||||
@@ -333,7 +333,7 @@ void AnimationNodeBlendSpace2DEditor::_add_menu_type(int p_index) {
|
||||
}
|
||||
|
||||
updating = true;
|
||||
undo_redo->create_action("Add Node Point");
|
||||
undo_redo->create_action(TTR("Add Node Point"));
|
||||
undo_redo->add_do_method(blend_space.ptr(), "add_blend_point", node, add_point_pos);
|
||||
undo_redo->add_undo_method(blend_space.ptr(), "remove_blend_point", blend_space->get_blend_point_count());
|
||||
undo_redo->add_do_method(this, "_update_space");
|
||||
@@ -352,7 +352,7 @@ void AnimationNodeBlendSpace2DEditor::_add_animation_type(int p_index) {
|
||||
anim->set_animation(animations_to_add[p_index]);
|
||||
|
||||
updating = true;
|
||||
undo_redo->create_action("Add Animation Point");
|
||||
undo_redo->create_action(TTR("Add Animation Point"));
|
||||
undo_redo->add_do_method(blend_space.ptr(), "add_blend_point", anim, add_point_pos);
|
||||
undo_redo->add_undo_method(blend_space.ptr(), "remove_blend_point", blend_space->get_blend_point_count());
|
||||
undo_redo->add_do_method(this, "_update_space");
|
||||
@@ -639,7 +639,7 @@ void AnimationNodeBlendSpace2DEditor::_config_changed(double) {
|
||||
return;
|
||||
|
||||
updating = true;
|
||||
undo_redo->create_action("Change BlendSpace2D Limits");
|
||||
undo_redo->create_action(TTR("Change BlendSpace2D Limits"));
|
||||
undo_redo->add_do_method(blend_space.ptr(), "set_max_space", Vector2(max_x_value->get_value(), max_y_value->get_value()));
|
||||
undo_redo->add_undo_method(blend_space.ptr(), "set_max_space", blend_space->get_max_space());
|
||||
undo_redo->add_do_method(blend_space.ptr(), "set_min_space", Vector2(min_x_value->get_value(), min_y_value->get_value()));
|
||||
@@ -661,7 +661,7 @@ void AnimationNodeBlendSpace2DEditor::_labels_changed(String) {
|
||||
return;
|
||||
|
||||
updating = true;
|
||||
undo_redo->create_action("Change BlendSpace2D Labels", UndoRedo::MERGE_ENDS);
|
||||
undo_redo->create_action(TTR("Change BlendSpace2D Labels"), UndoRedo::MERGE_ENDS);
|
||||
undo_redo->add_do_method(blend_space.ptr(), "set_x_label", label_x->get_text());
|
||||
undo_redo->add_undo_method(blend_space.ptr(), "set_x_label", blend_space->get_x_label());
|
||||
undo_redo->add_do_method(blend_space.ptr(), "set_y_label", label_y->get_text());
|
||||
@@ -677,7 +677,7 @@ void AnimationNodeBlendSpace2DEditor::_erase_selected() {
|
||||
if (selected_point != -1) {
|
||||
|
||||
updating = true;
|
||||
undo_redo->create_action("Remove BlendSpace2D Point");
|
||||
undo_redo->create_action(TTR("Remove BlendSpace2D Point"));
|
||||
undo_redo->add_do_method(blend_space.ptr(), "remove_blend_point", selected_point);
|
||||
undo_redo->add_undo_method(blend_space.ptr(), "add_blend_point", blend_space->get_blend_point_node(selected_point), blend_space->get_blend_point_position(selected_point), selected_point);
|
||||
|
||||
@@ -700,7 +700,7 @@ void AnimationNodeBlendSpace2DEditor::_erase_selected() {
|
||||
} else if (selected_triangle != -1) {
|
||||
|
||||
updating = true;
|
||||
undo_redo->create_action("Remove BlendSpace2D Triangle");
|
||||
undo_redo->create_action(TTR("Remove BlendSpace2D Triangle"));
|
||||
undo_redo->add_do_method(blend_space.ptr(), "remove_triangle", selected_triangle);
|
||||
undo_redo->add_undo_method(blend_space.ptr(), "add_triangle", blend_space->get_triangle_point(selected_triangle, 0), blend_space->get_triangle_point(selected_triangle, 1), blend_space->get_triangle_point(selected_triangle, 2), selected_triangle);
|
||||
|
||||
@@ -737,7 +737,7 @@ void AnimationNodeBlendSpace2DEditor::_edit_point_pos(double) {
|
||||
if (updating)
|
||||
return;
|
||||
updating = true;
|
||||
undo_redo->create_action("Move Node Point");
|
||||
undo_redo->create_action(TTR("Move Node Point"));
|
||||
undo_redo->add_do_method(blend_space.ptr(), "set_blend_point_position", selected_point, Vector2(edit_x->get_value(), edit_y->get_value()));
|
||||
undo_redo->add_undo_method(blend_space.ptr(), "set_blend_point_position", selected_point, blend_space->get_blend_point_position(selected_point));
|
||||
undo_redo->add_do_method(this, "_update_space");
|
||||
@@ -814,7 +814,7 @@ void AnimationNodeBlendSpace2DEditor::_removed_from_graph() {
|
||||
|
||||
void AnimationNodeBlendSpace2DEditor::_auto_triangles_toggled() {
|
||||
|
||||
undo_redo->create_action("Toggle Auto Triangles");
|
||||
undo_redo->create_action(TTR("Toggle Auto Triangles"));
|
||||
undo_redo->add_do_method(blend_space.ptr(), "set_auto_triangles", auto_triangles->is_pressed());
|
||||
undo_redo->add_undo_method(blend_space.ptr(), "set_auto_triangles", blend_space->get_auto_triangles());
|
||||
undo_redo->add_do_method(this, "_update_space");
|
||||
|
||||
Reference in New Issue
Block a user