diff options
Diffstat (limited to 'tools/editor')
-rw-r--r-- | tools/editor/animation_editor.cpp | 16 | ||||
-rw-r--r-- | tools/editor/plugins/canvas_item_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | tools/editor/plugins/color_ramp_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | tools/editor/plugins/shader_graph_editor_plugin.cpp | 18 | ||||
-rw-r--r-- | tools/editor/plugins/sprite_frames_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | tools/editor/property_editor.cpp | 2 |
6 files changed, 23 insertions, 19 deletions
diff --git a/tools/editor/animation_editor.cpp b/tools/editor/animation_editor.cpp index aa0156b0c0..2f67df1fc3 100644 --- a/tools/editor/animation_editor.cpp +++ b/tools/editor/animation_editor.cpp @@ -316,7 +316,7 @@ public: int existing = animation->track_find_key(track,new_time,true); setting=true; - undo_redo->create_action(TTR("Move Add Key"),false); + undo_redo->create_action(TTR("Move Add Key"),UndoRedo::MERGE_ENDS); Variant val = animation->track_get_key_value(track,key); float trans = animation->track_get_key_transition(track,key); @@ -344,7 +344,7 @@ public: float val = p_value; float prev_val = animation->track_get_key_transition(track,key); setting=true; - undo_redo->create_action(TTR("Anim Change Transition"),true); + undo_redo->create_action(TTR("Anim Change Transition"),UndoRedo::MERGE_ENDS); undo_redo->add_do_method(animation.ptr(),"track_set_key_transition",track,key,val); undo_redo->add_undo_method(animation.ptr(),"track_set_key_transition",track,key,prev_val); undo_redo->add_do_method(this,"_update_obj",animation); @@ -387,7 +387,7 @@ public: } setting=true; - undo_redo->create_action(TTR("Anim Change Value"),true); + undo_redo->create_action(TTR("Anim Change Value"),UndoRedo::MERGE_ENDS); Variant prev = animation->track_get_key_value(track,key); undo_redo->add_do_method(animation.ptr(),"track_set_key_value",track,key,value); undo_redo->add_undo_method(animation.ptr(),"track_set_key_value",track,key,prev); @@ -463,7 +463,11 @@ public: } } - undo_redo->create_action(TTR("Anim Change Call"),mergeable); + if (mergeable) + undo_redo->create_action(TTR("Anim Change Call"),UndoRedo::MERGE_ENDS); + else + undo_redo->create_action(TTR("Anim Change Call")); + Variant prev = animation->track_get_key_value(track,key); setting=true; undo_redo->add_do_method(animation.ptr(),"track_set_key_value",track,key,d_new); @@ -1715,9 +1719,9 @@ void AnimationKeyEditor::_curve_transition_changed(float p_what) { if (selection.size()==0) return; if (selection.size()==1) - undo_redo->create_action(TTR("Edit Node Curve"),true); + undo_redo->create_action(TTR("Edit Node Curve"),UndoRedo::MERGE_ENDS); else - undo_redo->create_action(TTR("Edit Selection Curve"),true); + undo_redo->create_action(TTR("Edit Selection Curve"),UndoRedo::MERGE_ENDS); for(Map<SelectedKey,KeyInfo>::Element *E=selection.front();E;E=E->next()) { diff --git a/tools/editor/plugins/canvas_item_editor_plugin.cpp b/tools/editor/plugins/canvas_item_editor_plugin.cpp index 02a24f8ddb..ec6bdc91d1 100644 --- a/tools/editor/plugins/canvas_item_editor_plugin.cpp +++ b/tools/editor/plugins/canvas_item_editor_plugin.cpp @@ -648,7 +648,7 @@ void CanvasItemEditor::_key_move(const Vector2& p_dir, bool p_snap, KeyMoveMODE if (editor_selection->get_selected_node_list().empty()) return; - undo_redo->create_action(TTR("Move Action"),true); + undo_redo->create_action(TTR("Move Action"),UndoRedo::MERGE_ENDS); List<Node*> &selection = editor_selection->get_selected_node_list(); diff --git a/tools/editor/plugins/color_ramp_editor_plugin.cpp b/tools/editor/plugins/color_ramp_editor_plugin.cpp index cb7f6a1809..4e2045edc6 100644 --- a/tools/editor/plugins/color_ramp_editor_plugin.cpp +++ b/tools/editor/plugins/color_ramp_editor_plugin.cpp @@ -84,7 +84,7 @@ void ColorRampEditorPlugin::_ramp_changed() { if (old_offsets.size()!=new_offsets.size()) ur->create_action(TTR("Add/Remove Color Ramp Point")); else - ur->create_action(TTR("Modify Color Ramp"),true); + ur->create_action(TTR("Modify Color Ramp"),UndoRedo::MERGE_ENDS); ur->add_do_method(this,"undo_redo_color_ramp",new_offsets,new_colors); ur->add_undo_method(this,"undo_redo_color_ramp",old_offsets,old_colors); ur->commit_action(); diff --git a/tools/editor/plugins/shader_graph_editor_plugin.cpp b/tools/editor/plugins/shader_graph_editor_plugin.cpp index 375220051c..815da48e96 100644 --- a/tools/editor/plugins/shader_graph_editor_plugin.cpp +++ b/tools/editor/plugins/shader_graph_editor_plugin.cpp @@ -675,7 +675,7 @@ GraphCurveMapEdit::GraphCurveMapEdit(){ void ShaderGraphView::_scalar_const_changed(double p_value,int p_id) { UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo(); - ur->create_action(TTR("Change Scalar Constant"),true); + ur->create_action(TTR("Change Scalar Constant"),UndoRedo::MERGE_ENDS); ur->add_do_method(graph.ptr(),"scalar_const_node_set_value",type,p_id,p_value); ur->add_undo_method(graph.ptr(),"scalar_const_node_set_value",type,p_id,graph->scalar_const_node_get_value(type,p_id)); ur->add_do_method(this,"_update_graph"); @@ -693,7 +693,7 @@ void ShaderGraphView::_vec_const_changed(double p_value, int p_id,Array p_arr){ } UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo(); - ur->create_action(TTR("Change Vec Constant"),true); + ur->create_action(TTR("Change Vec Constant"),UndoRedo::MERGE_ENDS); ur->add_do_method(graph.ptr(),"vec_const_node_set_value",type,p_id,val); ur->add_undo_method(graph.ptr(),"vec_const_node_set_value",type,p_id,graph->vec_const_node_get_value(type,p_id)); ur->add_do_method(this,"_update_graph"); @@ -706,7 +706,7 @@ void ShaderGraphView::_vec_const_changed(double p_value, int p_id,Array p_arr){ void ShaderGraphView::_rgb_const_changed(const Color& p_color, int p_id){ UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo(); - ur->create_action(TTR("Change RGB Constant"),true); + ur->create_action(TTR("Change RGB Constant"),UndoRedo::MERGE_ENDS); ur->add_do_method(graph.ptr(),"rgb_const_node_set_value",type,p_id,p_color); ur->add_undo_method(graph.ptr(),"rgb_const_node_set_value",type,p_id,graph->rgb_const_node_get_value(type,p_id)); ur->add_do_method(this,"_update_graph"); @@ -807,7 +807,7 @@ void ShaderGraphView::_vec_func_changed(int p_func, int p_id){ void ShaderGraphView::_scalar_input_changed(double p_value,int p_id){ UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo(); - ur->create_action(TTR("Change Scalar Uniform"),true); + ur->create_action(TTR("Change Scalar Uniform"),UndoRedo::MERGE_ENDS); ur->add_do_method(graph.ptr(),"scalar_input_node_set_value",type,p_id,p_value); ur->add_undo_method(graph.ptr(),"scalar_input_node_set_value",type,p_id,graph->scalar_input_node_get_value(type,p_id)); ur->add_do_method(this,"_update_graph"); @@ -825,7 +825,7 @@ void ShaderGraphView::_vec_input_changed(double p_value, int p_id,Array p_arr){ } UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo(); - ur->create_action(TTR("Change Vec Uniform"),true); + ur->create_action(TTR("Change Vec Uniform"),UndoRedo::MERGE_ENDS); ur->add_do_method(graph.ptr(),"vec_input_node_set_value",type,p_id,val); ur->add_undo_method(graph.ptr(),"vec_input_node_set_value",type,p_id,graph->vec_input_node_get_value(type,p_id)); ur->add_do_method(this,"_update_graph"); @@ -863,7 +863,7 @@ void ShaderGraphView::_rgb_input_changed(const Color& p_color, int p_id){ UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo(); - ur->create_action(TTR("Change RGB Uniform"),true); + ur->create_action(TTR("Change RGB Uniform"),UndoRedo::MERGE_ENDS); ur->add_do_method(graph.ptr(),"rgb_input_node_set_value",type,p_id,p_color); ur->add_undo_method(graph.ptr(),"rgb_input_node_set_value",type,p_id,graph->rgb_input_node_get_value(type,p_id)); ur->add_do_method(this,"_update_graph"); @@ -963,7 +963,7 @@ void ShaderGraphView::_comment_edited(int p_id,Node* p_button) { UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo(); TextEdit *te=p_button->cast_to<TextEdit>(); - ur->create_action(TTR("Change Comment"),true); + ur->create_action(TTR("Change Comment"),UndoRedo::MERGE_ENDS); ur->add_do_method(graph.ptr(),"comment_node_set_text",type,p_id,te->get_text()); ur->add_undo_method(graph.ptr(),"comment_node_set_text",type,p_id,graph->comment_node_get_text(type,p_id)); ur->add_do_method(this,"_update_graph"); @@ -1005,7 +1005,7 @@ void ShaderGraphView::_color_ramp_changed(int p_id,Node* p_ramp) { if (old_offsets.size()!=new_offsets.size()) ur->create_action(TTR("Add/Remove to Color Ramp")); else - ur->create_action(TTR("Modify Color Ramp"),true); + ur->create_action(TTR("Modify Color Ramp"),UndoRedo::MERGE_ENDS); ur->add_do_method(graph.ptr(),"color_ramp_node_set_ramp",type,p_id,new_colors,new_offsets); ur->add_undo_method(graph.ptr(),"color_ramp_node_set_ramp",type,p_id,old_colors,old_offsets); @@ -1041,7 +1041,7 @@ void ShaderGraphView::_curve_changed(int p_id,Node* p_curve) { if (old_points.size()!=new_points.size()) ur->create_action(TTR("Add/Remove to Curve Map")); else - ur->create_action(TTR("Modify Curve Map"),true); + ur->create_action(TTR("Modify Curve Map"),UndoRedo::MERGE_ENDS); ur->add_do_method(graph.ptr(),"curve_map_node_set_points",type,p_id,new_points); ur->add_undo_method(graph.ptr(),"curve_map_node_set_points",type,p_id,old_points); diff --git a/tools/editor/plugins/sprite_frames_editor_plugin.cpp b/tools/editor/plugins/sprite_frames_editor_plugin.cpp index e29a0c8d52..41beaa96a1 100644 --- a/tools/editor/plugins/sprite_frames_editor_plugin.cpp +++ b/tools/editor/plugins/sprite_frames_editor_plugin.cpp @@ -524,7 +524,7 @@ void SpriteFramesEditor::_animation_fps_changed(double p_value) { if (updating) return; - undo_redo->create_action(TTR("Change Animation FPS"),true); + undo_redo->create_action(TTR("Change Animation FPS"),UndoRedo::MERGE_ENDS); undo_redo->add_do_method(frames,"set_animation_speed",edited_anim,p_value); undo_redo->add_undo_method(frames,"set_animation_speed",edited_anim,frames->get_animation_speed(edited_anim)); undo_redo->add_do_method(this,"_update_library",true); diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp index 0518018e5a..41820b5178 100644 --- a/tools/editor/property_editor.cpp +++ b/tools/editor/property_editor.cpp @@ -3564,7 +3564,7 @@ void PropertyEditor::_edit_set(const String& p_name, const Variant& p_value) { } else { - undo_redo->create_action(TTR("Set")+" "+p_name,true); + undo_redo->create_action(TTR("Set")+" "+p_name,UndoRedo::MERGE_ENDS); undo_redo->add_do_property(obj,p_name,p_value); undo_redo->add_undo_property(obj,p_name,obj->get(p_name)); undo_redo->add_do_method(this,"_changed_callback",obj,p_name); |