diff options
author | Felix Laurie von Massenbach <felix@erbridge.co.uk> | 2015-01-27 00:00:07 +0000 |
---|---|---|
committer | Felix Laurie von Massenbach <felix@erbridge.co.uk> | 2015-01-27 00:00:07 +0000 |
commit | 5e1e78b257ad89dde7cd9becdbaa5fdadca08e19 (patch) | |
tree | 1f2a333c02bdd64fda0b82931b13c6750318a00f /tools | |
parent | ce488e1f93b06a08815aefbec0fc57976bf42256 (diff) |
Show a confirmation for the revert action.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/editor/editor_node.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index b4a9ca3b7a..a48545d152 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -1974,8 +1974,15 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { 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; + } - open_request(scene->get_filename()); + Error err = load_scene(scene->get_filename()); } break; |