You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-08 12:40:44 +00:00
Add EditorUndoRedoManager singleton
This commit is contained in:
@@ -130,7 +130,7 @@ void GroupDialog::_add_pressed() {
|
||||
return;
|
||||
}
|
||||
|
||||
Ref<EditorUndoRedoManager> &undo_redo = EditorNode::get_undo_redo();
|
||||
EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
|
||||
undo_redo->create_action(TTR("Add to Group"));
|
||||
|
||||
while (selected) {
|
||||
@@ -160,7 +160,7 @@ void GroupDialog::_removed_pressed() {
|
||||
return;
|
||||
}
|
||||
|
||||
Ref<EditorUndoRedoManager> &undo_redo = EditorNode::get_undo_redo();
|
||||
EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
|
||||
undo_redo->create_action(TTR("Remove from Group"));
|
||||
|
||||
while (selected) {
|
||||
@@ -248,7 +248,7 @@ void GroupDialog::_group_renamed() {
|
||||
|
||||
renamed_group->set_text(0, name); // Spaces trimmed.
|
||||
|
||||
Ref<EditorUndoRedoManager> &undo_redo = EditorNode::get_undo_redo();
|
||||
EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
|
||||
undo_redo->create_action(TTR("Rename Group"));
|
||||
|
||||
List<Node *> nodes;
|
||||
@@ -325,7 +325,7 @@ void GroupDialog::_modify_group_pressed(Object *p_item, int p_column, int p_id,
|
||||
case DELETE_GROUP: {
|
||||
String name = ti->get_text(0);
|
||||
|
||||
Ref<EditorUndoRedoManager> &undo_redo = EditorNode::get_undo_redo();
|
||||
EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
|
||||
undo_redo->create_action(TTR("Delete Group"));
|
||||
|
||||
List<Node *> nodes;
|
||||
@@ -597,7 +597,7 @@ void GroupsEditor::_add_group(const String &p_group) {
|
||||
return;
|
||||
}
|
||||
|
||||
Ref<EditorUndoRedoManager> &undo_redo = EditorNode::get_undo_redo();
|
||||
EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
|
||||
undo_redo->create_action(TTR("Add to Group"));
|
||||
|
||||
undo_redo->add_do_method(node, "add_to_group", name, true);
|
||||
@@ -652,7 +652,7 @@ void GroupsEditor::_group_renamed() {
|
||||
|
||||
ti->set_text(0, name); // Spaces trimmed.
|
||||
|
||||
Ref<EditorUndoRedoManager> &undo_redo = EditorNode::get_undo_redo();
|
||||
EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
|
||||
undo_redo->create_action(TTR("Rename Group"));
|
||||
|
||||
undo_redo->add_do_method(node, "remove_from_group", selected_group);
|
||||
@@ -688,7 +688,7 @@ void GroupsEditor::_modify_group(Object *p_item, int p_column, int p_id, MouseBu
|
||||
switch (p_id) {
|
||||
case DELETE_GROUP: {
|
||||
const String name = ti->get_text(0);
|
||||
Ref<EditorUndoRedoManager> &undo_redo = EditorNode::get_undo_redo();
|
||||
EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
|
||||
undo_redo->create_action(TTR("Remove from Group"));
|
||||
|
||||
undo_redo->add_do_method(node, "remove_from_group", name);
|
||||
|
||||
Reference in New Issue
Block a user