summaryrefslogtreecommitdiff
path: root/tools/editor
diff options
context:
space:
mode:
Diffstat (limited to 'tools/editor')
-rw-r--r--tools/editor/editor_node.cpp21
-rw-r--r--tools/editor/editor_node.h1
2 files changed, 22 insertions, 0 deletions
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp
index 6ff16e661c..a48545d152 100644
--- a/tools/editor/editor_node.cpp
+++ b/tools/editor/editor_node.cpp
@@ -1967,6 +1967,25 @@ 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;
+
+ if (unsaved_cache && !p_confirmed) {
+ confirmation->get_ok()->set_text("Revert");
+ confirmation->set_text("This action cannot be undone. Revert anyway?");
+ confirmation->popup_centered(Size2(300,70));
+ break;
+ }
+
+ Error err = load_scene(scene->get_filename());
+
+ } break;
+
#if 0
case NODE_EXTERNAL_INSTANCE: {
@@ -3469,6 +3488,8 @@ EditorNode::EditorNode() {
p->add_separator();
p->add_item("Project Settings",RUN_SETTINGS);
p->add_separator();
+ p->add_item("Revert Scene",EDIT_REVERT);
+ p->add_separator();
p->add_item("Quit to Project List",RUN_PROJECT_MANAGER,KEY_MASK_SHIFT+KEY_MASK_CMD+KEY_Q);
p->add_item("Quit",FILE_QUIT,KEY_MASK_CMD+KEY_Q);
diff --git a/tools/editor/editor_node.h b/tools/editor/editor_node.h
index 7560c2b149..54b9dc2b0b 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,