You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Add per-scene UndoRedo
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
#include "editor/editor_node.h"
|
||||
#include "editor/editor_properties.h"
|
||||
#include "editor/editor_scale.h"
|
||||
#include "editor/editor_undo_redo_manager.h"
|
||||
#include "editor/plugins/curve_editor_plugin.h"
|
||||
#include "editor/plugins/shader_editor_plugin.h"
|
||||
#include "scene/animation/animation_player.h"
|
||||
@@ -4063,7 +4064,7 @@ void VisualShaderEditor::_input_select_item(Ref<VisualShaderNodeInput> p_input,
|
||||
|
||||
bool type_changed = next_input_type != prev_input_type;
|
||||
|
||||
UndoRedo *undo_redo = EditorNode::get_singleton()->get_undo_redo();
|
||||
Ref<EditorUndoRedoManager> undo_redo = EditorNode::get_undo_redo();
|
||||
undo_redo->create_action(TTR("Visual Shader Input Type Changed"));
|
||||
|
||||
undo_redo->add_do_method(p_input.ptr(), "set_input_name", p_name);
|
||||
@@ -4132,7 +4133,7 @@ void VisualShaderEditor::_uniform_select_item(Ref<VisualShaderNodeUniformRef> p_
|
||||
|
||||
bool type_changed = p_uniform_ref->get_uniform_type_by_name(p_name) != p_uniform_ref->get_uniform_type_by_name(prev_name);
|
||||
|
||||
UndoRedo *undo_redo = EditorNode::get_singleton()->get_undo_redo();
|
||||
Ref<EditorUndoRedoManager> undo_redo = EditorNode::get_undo_redo();
|
||||
undo_redo->create_action(TTR("UniformRef Name Changed"));
|
||||
|
||||
undo_redo->add_do_method(p_uniform_ref.ptr(), "set_uniform_name", p_name);
|
||||
@@ -4176,7 +4177,7 @@ void VisualShaderEditor::_varying_select_item(Ref<VisualShaderNodeVarying> p_var
|
||||
|
||||
bool is_getter = Ref<VisualShaderNodeVaryingGetter>(p_varying.ptr()).is_valid();
|
||||
|
||||
UndoRedo *undo_redo = EditorNode::get_singleton()->get_undo_redo();
|
||||
Ref<EditorUndoRedoManager> undo_redo = EditorNode::get_undo_redo();
|
||||
undo_redo->create_action(TTR("Varying Name Changed"));
|
||||
|
||||
undo_redo->add_do_method(p_varying.ptr(), "set_varying_name", p_name);
|
||||
@@ -5668,7 +5669,7 @@ VisualShaderEditor::VisualShaderEditor() {
|
||||
|
||||
_update_options_menu();
|
||||
|
||||
undo_redo = EditorNode::get_singleton()->get_undo_redo();
|
||||
undo_redo = EditorNode::get_undo_redo();
|
||||
|
||||
Ref<VisualShaderNodePluginDefault> default_plugin;
|
||||
default_plugin.instantiate();
|
||||
@@ -5876,7 +5877,7 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
UndoRedo *undo_redo = EditorNode::get_singleton()->get_undo_redo();
|
||||
Ref<EditorUndoRedoManager> undo_redo = EditorNode::get_undo_redo();
|
||||
|
||||
updating = true;
|
||||
undo_redo->create_action(TTR("Edit Visual Property:") + " " + p_property, UndoRedo::MERGE_ENDS);
|
||||
@@ -6078,7 +6079,7 @@ void EditorPropertyVisualShaderMode::_option_selected(int p_which) {
|
||||
return;
|
||||
}
|
||||
|
||||
UndoRedo *undo_redo = EditorNode::get_singleton()->get_undo_redo();
|
||||
Ref<EditorUndoRedoManager> undo_redo = EditorNode::get_undo_redo();
|
||||
undo_redo->create_action(TTR("Visual Shader Mode Changed"));
|
||||
//do is easy
|
||||
undo_redo->add_do_method(visual_shader.ptr(), "set_mode", p_which);
|
||||
|
||||
Reference in New Issue
Block a user