Merge pull request #1303 from erbridge/revert_menu_item
Add a revert menu item
This commit is contained in:
commit
d45a227e25
2 changed files with 22 additions and 0 deletions
|
@ -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);
|
||||
|
||||
|
|
|
@ -127,6 +127,7 @@ class EditorNode : public Node {
|
|||
FILE_EXTERNAL_OPEN_SCENE,
|
||||
EDIT_UNDO,
|
||||
EDIT_REDO,
|
||||
EDIT_REVERT,
|
||||
RESOURCE_NEW,
|
||||
RESOURCE_LOAD,
|
||||
RESOURCE_SAVE,
|
||||
|
|
Loading…
Reference in a new issue