Merge pull request #1129 from xodene/master

Some polishes to editor UI
This commit is contained in:
Juan Linietsky 2015-01-08 21:57:30 -03:00
commit 2e33c4c02b
4 changed files with 27 additions and 9 deletions

View File

@ -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;

View File

@ -108,6 +108,8 @@ class EditorNode : public Node {
FILE_OPEN_SCENE,
FILE_SAVE_SCENE,
FILE_SAVE_AS_SCENE,
FILE_SAVE_BEFORE_RUN,
FILE_SAVE_AND_RUN,
FILE_IMPORT_SUBSCENE,
FILE_EXPORT_PROJECT,
FILE_EXPORT_MESH_LIBRARY,

View File

@ -65,7 +65,7 @@ class NewProjectDialog : public ConfirmationDialog {
error->set_text("");
get_ok()->set_disabled(true);
DirAccess *d = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
if (d->change_dir(project_path->get_text())!=OK) {
if (project_path->get_text() != "" && d->change_dir(project_path->get_text())!=OK) {
error->set_text("Invalid Path for Project, Path Must Exist!");
memdelete(d);
return false;
@ -82,7 +82,7 @@ class NewProjectDialog : public ConfirmationDialog {
} else {
if (!d->file_exists("engine.cfg")) {
if (project_path->get_text() != "" && !d->file_exists("engine.cfg")) {
error->set_text("Invalid Project Path (engine.cfg must exist).");
memdelete(d);

View File

@ -478,8 +478,6 @@ void ScriptEditorDebugger::_notification(int p_what) {
if (!connection->is_connected()) {
stop();
editor->notify_child_process_exited(); //somehow, exited
msgdialog->set_text("Process being debugged exited.");
msgdialog->popup_centered(Size2(250,100));
break;
};