diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-12-14 23:28:40 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-12-14 23:28:40 +0100 |
commit | 1c5cfc4675826db05d6e7dc42b337e8b1282de08 (patch) | |
tree | 76ffb356d2765ae67c490ac594b75f741b5c7a79 /editor/editor_node.cpp | |
parent | 0872e1483b06b79e5b1fba5e8f487d7d080812d8 (diff) | |
parent | ff994585b3ef78cef4ea3de65f48d267599cec11 (diff) |
Merge pull request #69761 from KoBeWi/where_undo
Add scope prefix to undo actions
Diffstat (limited to 'editor/editor_node.cpp')
-rw-r--r-- | editor/editor_node.cpp | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 4c3c9973cb..02cfd3e873 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -2754,11 +2754,20 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { log->add_message(TTR("Can't undo while mouse buttons are pressed."), EditorLog::MSG_TYPE_EDITOR); } else { String action = editor_data.get_undo_redo()->get_current_action_name(); - + int id = editor_data.get_undo_redo()->get_current_action_history_id(); if (!editor_data.get_undo_redo()->undo()) { log->add_message(TTR("Nothing to undo."), EditorLog::MSG_TYPE_EDITOR); } else if (!action.is_empty()) { - log->add_message(vformat(TTR("Undo: %s"), action), EditorLog::MSG_TYPE_EDITOR); + switch (id) { + case EditorUndoRedoManager::GLOBAL_HISTORY: + log->add_message(vformat(TTR("Global Undo: %s"), action), EditorLog::MSG_TYPE_EDITOR); + break; + case EditorUndoRedoManager::REMOTE_HISTORY: + log->add_message(vformat(TTR("Remote Undo: %s"), action), EditorLog::MSG_TYPE_EDITOR); + break; + default: + log->add_message(vformat(TTR("Scene Undo: %s"), action), EditorLog::MSG_TYPE_EDITOR); + } } } } break; @@ -2770,7 +2779,20 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { log->add_message(TTR("Nothing to redo."), EditorLog::MSG_TYPE_EDITOR); } else { String action = editor_data.get_undo_redo()->get_current_action_name(); - log->add_message(vformat(TTR("Redo: %s"), action), EditorLog::MSG_TYPE_EDITOR); + if (action.is_empty()) { + break; + } + + switch (editor_data.get_undo_redo()->get_current_action_history_id()) { + case EditorUndoRedoManager::GLOBAL_HISTORY: + log->add_message(vformat(TTR("Global Redo: %s"), action), EditorLog::MSG_TYPE_EDITOR); + break; + case EditorUndoRedoManager::REMOTE_HISTORY: + log->add_message(vformat(TTR("Remote Redo: %s"), action), EditorLog::MSG_TYPE_EDITOR); + break; + default: + log->add_message(vformat(TTR("Scene Redo: %s"), action), EditorLog::MSG_TYPE_EDITOR); + } } } } break; |