diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-01-08 21:57:30 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-01-08 21:57:30 -0300 |
commit | 2e33c4c02b1fe3d286431f606376e0324071f259 (patch) | |
tree | 997a0b831e483cf579736131fe4a1927a7e31436 /tools/editor/editor_node.cpp | |
parent | 81318916954d0e5b279b7562922c9125acadfceb (diff) | |
parent | 5b7b817c9b53d0390f785c7abddd16d17c0f33a5 (diff) |
Merge pull request #1129 from xodene/master
Some polishes to editor UI
Diffstat (limited to 'tools/editor/editor_node.cpp')
-rw-r--r-- | tools/editor/editor_node.cpp | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 5843a7cb28..52c75c6d7e 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -978,6 +978,15 @@ void EditorNode::_dialog_action(String p_file) { } } break; + + case FILE_SAVE_AND_RUN: { + if (file->get_mode()==FileDialog::MODE_SAVE_FILE) { + + _save_scene(p_file); + _run(false); + } + } break; + case FILE_EXPORT_MESH_LIBRARY: { Ref<MeshLibrary> ml; @@ -1391,13 +1400,10 @@ void EditorNode::_run(bool p_current,const String& p_custom) { } if (scene->get_filename()=="") { - - current_option=-1; //accept->get_cancel()->hide(); - accept->get_ok()->set_text("I see.."); - accept->set_text("Scene has never been saved. Save before running!"); - accept->popup_centered(Size2(300,70));; + /**/ + _menu_option_confirm(FILE_SAVE_BEFORE_RUN, false); return; } @@ -1664,6 +1670,18 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { } break; + case FILE_SAVE_BEFORE_RUN: { + if (!p_confirmed) { + accept->get_ok()->set_text("Yes"); + accept->set_text("This scene has never been saved. Save before running?"); + accept->popup_centered(Size2(300, 70)); + break; + } + + _menu_option(FILE_SAVE_AS_SCENE); + _menu_option_confirm(FILE_SAVE_AND_RUN, true); + } break; + case FILE_DUMP_STRINGS: { Node *scene = edited_scene; |