Merge pull request #59564 from KoBeWi/FINALLY,_ULTIMATE_UNDO_REDO
This commit is contained in:
commit
b8a64313f0
122 changed files with 1498 additions and 642 deletions
|
|
@ -32,7 +32,9 @@
|
|||
|
||||
#ifdef TOOLS_ENABLED
|
||||
|
||||
#include "editor/editor_node.h"
|
||||
#include "editor/editor_settings.h"
|
||||
#include "editor/editor_undo_redo_manager.h"
|
||||
#include "editor/plugins/node_3d_editor_plugin.h"
|
||||
#include "scene/3d/camera_3d.h"
|
||||
|
||||
|
|
@ -215,7 +217,7 @@ void CSGShape3DGizmoPlugin::commit_handle(const EditorNode3DGizmo *p_gizmo, int
|
|||
return;
|
||||
}
|
||||
|
||||
UndoRedo *ur = Node3DEditor::get_singleton()->get_undo_redo();
|
||||
Ref<EditorUndoRedoManager> &ur = EditorNode::get_undo_redo();
|
||||
ur->create_action(TTR("Change Sphere Shape Radius"));
|
||||
ur->add_do_method(s, "set_radius", s->get_radius());
|
||||
ur->add_undo_method(s, "set_radius", p_restore);
|
||||
|
|
@ -229,7 +231,7 @@ void CSGShape3DGizmoPlugin::commit_handle(const EditorNode3DGizmo *p_gizmo, int
|
|||
return;
|
||||
}
|
||||
|
||||
UndoRedo *ur = Node3DEditor::get_singleton()->get_undo_redo();
|
||||
Ref<EditorUndoRedoManager> &ur = EditorNode::get_undo_redo();
|
||||
ur->create_action(TTR("Change Box Shape Size"));
|
||||
ur->add_do_method(s, "set_size", s->get_size());
|
||||
ur->add_undo_method(s, "set_size", p_restore);
|
||||
|
|
@ -247,7 +249,7 @@ void CSGShape3DGizmoPlugin::commit_handle(const EditorNode3DGizmo *p_gizmo, int
|
|||
return;
|
||||
}
|
||||
|
||||
UndoRedo *ur = Node3DEditor::get_singleton()->get_undo_redo();
|
||||
Ref<EditorUndoRedoManager> &ur = EditorNode::get_undo_redo();
|
||||
if (p_id == 0) {
|
||||
ur->create_action(TTR("Change Cylinder Radius"));
|
||||
ur->add_do_method(s, "set_radius", s->get_radius());
|
||||
|
|
@ -272,7 +274,7 @@ void CSGShape3DGizmoPlugin::commit_handle(const EditorNode3DGizmo *p_gizmo, int
|
|||
return;
|
||||
}
|
||||
|
||||
UndoRedo *ur = Node3DEditor::get_singleton()->get_undo_redo();
|
||||
Ref<EditorUndoRedoManager> &ur = EditorNode::get_undo_redo();
|
||||
if (p_id == 0) {
|
||||
ur->create_action(TTR("Change Torus Inner Radius"));
|
||||
ur->add_do_method(s, "set_inner_radius", s->get_inner_radius());
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@
|
|||
#include "editor/editor_node.h"
|
||||
#include "editor/editor_scale.h"
|
||||
#include "editor/editor_settings.h"
|
||||
#include "editor/editor_undo_redo_manager.h"
|
||||
#include "editor/plugins/node_3d_editor_plugin.h"
|
||||
#include "scene/3d/camera_3d.h"
|
||||
#include "scene/main/window.h"
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@
|
|||
#include "scene/gui/slider.h"
|
||||
#include "scene/gui/spin_box.h"
|
||||
|
||||
class EditorUndoRedoManager;
|
||||
class Node3DEditorPlugin;
|
||||
|
||||
class GridMapEditor : public VBoxContainer {
|
||||
|
|
@ -62,7 +63,7 @@ class GridMapEditor : public VBoxContainer {
|
|||
DISPLAY_LIST
|
||||
};
|
||||
|
||||
UndoRedo *undo_redo = nullptr;
|
||||
Ref<EditorUndoRedoManager> undo_redo;
|
||||
InputAction input_action = INPUT_NONE;
|
||||
Panel *panel = nullptr;
|
||||
MenuButton *options = nullptr;
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
#include "editor/editor_node.h"
|
||||
#include "editor/editor_scale.h"
|
||||
#include "editor/editor_settings.h"
|
||||
#include "editor/editor_undo_redo_manager.h"
|
||||
#include "editor/inspector_dock.h"
|
||||
#include "editor/scene_tree_editor.h"
|
||||
#include "modules/multiplayer/multiplayer_synchronizer.h"
|
||||
|
|
@ -139,7 +140,7 @@ void ReplicationEditor::_add_sync_property(String p_path) {
|
|||
return;
|
||||
}
|
||||
|
||||
UndoRedo *undo_redo = EditorNode::get_singleton()->get_undo_redo();
|
||||
Ref<EditorUndoRedoManager> undo_redo = EditorNode::get_singleton()->get_undo_redo();
|
||||
undo_redo->create_action(TTR("Add property to synchronizer"));
|
||||
|
||||
if (config.is_null()) {
|
||||
|
|
@ -354,7 +355,7 @@ void ReplicationEditor::_tree_item_edited() {
|
|||
int column = tree->get_edited_column();
|
||||
ERR_FAIL_COND(column < 1 || column > 2);
|
||||
const NodePath prop = ti->get_metadata(0);
|
||||
UndoRedo *undo_redo = EditorNode::get_singleton()->get_undo_redo();
|
||||
Ref<EditorUndoRedoManager> undo_redo = EditorNode::get_undo_redo();
|
||||
bool value = ti->is_checked(column);
|
||||
String method;
|
||||
if (column == 1) {
|
||||
|
|
@ -394,7 +395,7 @@ void ReplicationEditor::_dialog_closed(bool p_confirmed) {
|
|||
int idx = config->property_get_index(prop);
|
||||
bool spawn = config->property_get_spawn(prop);
|
||||
bool sync = config->property_get_sync(prop);
|
||||
UndoRedo *undo_redo = EditorNode::get_singleton()->get_undo_redo();
|
||||
Ref<EditorUndoRedoManager> undo_redo = EditorNode::get_undo_redo();
|
||||
undo_redo->create_action(TTR("Remove Property"));
|
||||
undo_redo->add_do_method(config.ptr(), "remove_property", prop);
|
||||
undo_redo->add_undo_method(config.ptr(), "add_property", prop, idx);
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@
|
|||
#include "editor/editor_resource_preview.h"
|
||||
#include "editor/editor_scale.h"
|
||||
#include "editor/editor_settings.h"
|
||||
#include "editor/editor_undo_redo_manager.h"
|
||||
#include "scene/gui/check_button.h"
|
||||
#include "scene/gui/graph_edit.h"
|
||||
#include "scene/gui/separator.h"
|
||||
|
|
@ -74,7 +75,7 @@ class VisualScriptEditorSignalEdit : public Object {
|
|||
StringName sig;
|
||||
|
||||
public:
|
||||
UndoRedo *undo_redo;
|
||||
Ref<EditorUndoRedoManager> undo_redo;
|
||||
Ref<VisualScript> script;
|
||||
|
||||
protected:
|
||||
|
|
@ -197,8 +198,6 @@ public:
|
|||
sig = p_sig;
|
||||
notify_property_list_changed();
|
||||
}
|
||||
|
||||
VisualScriptEditorSignalEdit() { undo_redo = nullptr; }
|
||||
};
|
||||
|
||||
class VisualScriptEditorVariableEdit : public Object {
|
||||
|
|
@ -207,7 +206,7 @@ class VisualScriptEditorVariableEdit : public Object {
|
|||
StringName var;
|
||||
|
||||
public:
|
||||
UndoRedo *undo_redo;
|
||||
Ref<EditorUndoRedoManager> undo_redo;
|
||||
Ref<VisualScript> script;
|
||||
|
||||
protected:
|
||||
|
|
@ -355,8 +354,6 @@ public:
|
|||
var = p_var;
|
||||
notify_property_list_changed();
|
||||
}
|
||||
|
||||
VisualScriptEditorVariableEdit() { undo_redo = nullptr; }
|
||||
};
|
||||
|
||||
static Color _color_from_type(Variant::Type p_type, bool dark_theme = true) {
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@
|
|||
|
||||
class GraphEdit;
|
||||
|
||||
class EditorUndoRedoManager;
|
||||
class VisualScriptEditorSignalEdit;
|
||||
class VisualScriptEditorVariableEdit;
|
||||
|
||||
|
|
@ -135,8 +136,7 @@ class VisualScriptEditor : public ScriptEditorBase {
|
|||
EditorProperty *default_property_editor = nullptr;
|
||||
Ref<VisualScriptEditedProperty> edited_default_property_holder;
|
||||
|
||||
UndoRedo *undo_redo = nullptr;
|
||||
|
||||
Ref<EditorUndoRedoManager> undo_redo;
|
||||
Tree *members = nullptr;
|
||||
AcceptDialog *function_name_edit = nullptr;
|
||||
LineEdit *function_name_box = nullptr;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue