summaryrefslogtreecommitdiff
path: root/tools/editor/plugins
diff options
context:
space:
mode:
authorFranklin Sobrinho <franklin_gs@hotmail.com>2016-08-17 17:14:51 -0300
committerFranklin Sobrinho <franklin_gs@hotmail.com>2016-08-17 17:14:51 -0300
commitdebf574df35caf8e0880b65120e3c79c45e1c92a (patch)
tree10e512fc5bca08cc20ad593ef70c9c6d85fba125 /tools/editor/plugins
parent56fa741b7a729bd5a00cff17e4382af547de92ad (diff)
Implemented UndoRedo mergeable modes
Diffstat (limited to 'tools/editor/plugins')
-rw-r--r--tools/editor/plugins/canvas_item_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/color_ramp_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/shader_graph_editor_plugin.cpp18
-rw-r--r--tools/editor/plugins/sprite_frames_editor_plugin.cpp2
4 files changed, 12 insertions, 12 deletions
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);