From 8d97eef0fe634b8dba17d786123714fe83d5a4f8 Mon Sep 17 00:00:00 2001 From: neikeq Date: Wed, 25 Nov 2015 00:46:44 +0100 Subject: Put 2D, 3D and Script editor index in enum To avoid invalid index out of bounds mistakes. --- tools/editor/editor_node.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'tools/editor/editor_node.cpp') diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 01e53ead1..15ac06aff 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -167,19 +167,19 @@ void EditorNode::_unhandled_input(const InputEvent& p_event) { /*case KEY_F1: if (!p_event.key.mod.shift && !p_event.key.mod.command) - _editor_select(3); + _editor_select(EDITOR_SCRIPT); break;*/ case KEY_F1: if (!p_event.key.mod.shift && !p_event.key.mod.command) - _editor_select(0); + _editor_select(EDITOR_2D); break; case KEY_F2: if (!p_event.key.mod.shift && !p_event.key.mod.command) - _editor_select(1); + _editor_select(EDITOR_3D); break; case KEY_F3: if (!p_event.key.mod.shift && !p_event.key.mod.command) - _editor_select(2); + _editor_select(EDITOR_SCRIPT); break; case KEY_F5: _menu_option_confirm((p_event.key.mod.control&&p_event.key.mod.shift)?RUN_PLAY_CUSTOM_SCENE:RUN_PLAY,true); break; case KEY_F6: _menu_option_confirm(RUN_PLAY_SCENE,true); break; @@ -298,7 +298,7 @@ void EditorNode::_notification(int p_what) { VisualServer::get_singleton()->viewport_set_hide_canvas(get_scene_root()->get_viewport(),true); VisualServer::get_singleton()->viewport_set_disable_environment(get_viewport()->get_viewport_rid(),true); - _editor_select(1); + _editor_select(EDITOR_3D); if (defer_load_scene!="") { @@ -888,7 +888,7 @@ void EditorNode::_save_scene_with_preview(String p_file) { } } - _editor_select(is2d?0:1); + _editor_select(is2d?EDITOR_2D:EDITOR_3D); VS::get_singleton()->viewport_queue_screen_capture(viewport); save.step("Creating Thumbnail",2); @@ -2528,7 +2528,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { case OBJECT_REQUEST_HELP: { if (current) { - _editor_select(2); + _editor_select(EDITOR_SCRIPT); emit_signal("request_help",current->get_type()); } @@ -3305,9 +3305,9 @@ void EditorNode::_set_main_scene_state(Dictionary p_state) { int n2d=0,n3d=0; _find_node_types(get_edited_scene(),n2d,n3d); if (n2d>n3d) { - _editor_select(0); + _editor_select(EDITOR_2D); } else if (n3d>n2d) { - _editor_select(1); + _editor_select(EDITOR_3D); } } -- cgit v1.3.1 From 5dc9770febf18ec2716a897528927cefadd23ab6 Mon Sep 17 00:00:00 2001 From: est31 Date: Wed, 25 Nov 2015 06:28:51 +0100 Subject: Print errors to console when exporting Now you the errors when exporting via godot server binary. When exporting via non-headless godot, it is useful to have the error on the console as well. Also exit and print a list of valid export platforms when the supplied platform was not found. --- tools/editor/editor_node.cpp | 3 ++- tools/editor/project_export.cpp | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'tools/editor/editor_node.cpp') diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 4e2259288..30e9931d1 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -3857,7 +3857,8 @@ bool EditorNode::_find_editing_changed_scene(Node *p_from) { void EditorNode::add_io_error(const String& p_error) { - + CharString err_ut = p_error.utf8(); + ERR_PRINT(err_ut.get_data()); _load_error_notify(singleton,p_error); } diff --git a/tools/editor/project_export.cpp b/tools/editor/project_export.cpp index cd6dc06f7..3464b3c9b 100644 --- a/tools/editor/project_export.cpp +++ b/tools/editor/project_export.cpp @@ -491,6 +491,18 @@ Error ProjectExportDialog::export_platform(const String& p_platform, const Strin Ref exporter = EditorImportExport::get_singleton()->get_export_platform(p_platform); if (exporter.is_null()) { ERR_PRINT("Invalid platform for export"); + + List platforms; + EditorImportExport::get_singleton()->get_export_platforms(&platforms); + print_line("Valid export plaftorms are:"); + for (List::Element *E=platforms.front();E;E=E->next()) + print_line(" \""+E->get()+"\""); + + if (p_quit_after) { + OS::get_singleton()->set_exit_code(255); + get_tree()->quit(); + } + return ERR_INVALID_PARAMETER; } Error err = exporter->export_project(p_path,p_debug); -- cgit v1.3.1