From 977b190a2d2f7b5bc252c10836114661702e001e Mon Sep 17 00:00:00 2001 From: Felix Laurie von Massenbach Date: Sun, 25 Jan 2015 00:14:06 +0000 Subject: [PATCH] Add a revert menu item. --- tools/editor/editor_node.cpp | 14 ++++++++++++++ tools/editor/editor_node.h | 1 + 2 files changed, 15 insertions(+) diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 6ff16e661c9..c5604ffaf90 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -1967,6 +1967,18 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { log->add_message("REDO: "+action); } break; + + case EDIT_REVERT: { + + Node *scene = get_edited_scene(); + + if (!scene) + break; + + open_request(scene->get_filename()); + + } break; + #if 0 case NODE_EXTERNAL_INSTANCE: { @@ -3465,6 +3477,8 @@ EditorNode::EditorNode() { p->add_item("Undo",EDIT_UNDO,KEY_MASK_CMD+KEY_Z); p->add_item("Redo",EDIT_REDO,KEY_MASK_CMD+KEY_MASK_SHIFT+KEY_Z); p->add_separator(); + p->add_item("Revert Scene",EDIT_REVERT); + p->add_separator(); p->add_item("Run Script",FILE_RUN_SCRIPT,KEY_MASK_SHIFT+KEY_MASK_CMD+KEY_R); p->add_separator(); p->add_item("Project Settings",RUN_SETTINGS); diff --git a/tools/editor/editor_node.h b/tools/editor/editor_node.h index 7560c2b1497..54b9dc2b0b4 100644 --- a/tools/editor/editor_node.h +++ b/tools/editor/editor_node.h @@ -127,6 +127,7 @@ class EditorNode : public Node { FILE_EXTERNAL_OPEN_SCENE, EDIT_UNDO, EDIT_REDO, + EDIT_REVERT, RESOURCE_NEW, RESOURCE_LOAD, RESOURCE_SAVE,