diff options
Diffstat (limited to 'tools')
22 files changed, 394 insertions, 83 deletions
diff --git a/tools/Godot.app/Contents/Info.plist b/tools/Godot.app/Contents/Info.plist index 3a4b51e2fe..8a89993fb9 100755 --- a/tools/Godot.app/Contents/Info.plist +++ b/tools/Godot.app/Contents/Info.plist @@ -13,7 +13,7 @@ <key>CFBundleIconFile</key> <string>Godot.icns</string> <key>CFBundleIdentifier</key> - <string>com.okamstudio.godot</string> + <string>org.godotengine.godot</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundlePackageType</key> @@ -61,7 +61,7 @@ <true/> <key>LSItemContentTypes</key> <array> - <string>com.okamstudio.scn</string> + <string>org.godotengine.scn</string> </array> </dict> </array> diff --git a/tools/editor/code_editor.cpp b/tools/editor/code_editor.cpp index 685763cadb..0728b3b7c1 100644 --- a/tools/editor/code_editor.cpp +++ b/tools/editor/code_editor.cpp @@ -614,6 +614,7 @@ CodeTextEditor::CodeTextEditor() { text_editor->add_font_override("font",get_font("source","Fonts")); text_editor->set_show_line_numbers(true); text_editor->set_brace_matching(true); + text_editor->set_auto_indent(true); line_col = memnew( Label ); add_child(line_col); diff --git a/tools/editor/connections_dialog.cpp b/tools/editor/connections_dialog.cpp index b0bacdae61..d4937d7114 100644 --- a/tools/editor/connections_dialog.cpp +++ b/tools/editor/connections_dialog.cpp @@ -163,6 +163,7 @@ void ConnectDialog::edit(Node *p_node) { dst_path->set_text(""); dst_method->set_text(""); deferred->set_pressed(false); + oneshot->set_pressed(false); cdbinds->params.clear(); cdbinds->notify_changed(); } @@ -196,6 +197,11 @@ bool ConnectDialog::get_deferred() const { return deferred->is_pressed(); } +bool ConnectDialog::get_oneshot() const { + + return oneshot->is_pressed(); +} + StringName ConnectDialog::get_dst_method() const { String txt=dst_method->get_text(); @@ -423,12 +429,13 @@ ConnectDialog::ConnectDialog() { dstm_hb->add_child(make_callback); deferred = memnew( CheckButton ); - deferred->set_toggle_mode(true); - deferred->set_pressed(true); deferred->set_text("Deferred"); dstm_hb->add_child(deferred); - + oneshot = memnew( CheckButton ); + oneshot->set_text("Oneshot"); + dstm_hb->add_child(oneshot); + /* realtime = memnew( CheckButton ); realtime->set_anchor( MARGIN_TOP, ANCHOR_END ); @@ -496,11 +503,13 @@ void ConnectionsDialog::_connect() { StringName dst_method=connect_dialog->get_dst_method(); bool defer=connect_dialog->get_deferred(); + bool oshot=connect_dialog->get_oneshot(); Vector<Variant> binds = connect_dialog->get_binds(); StringArray args = it->get_metadata(0).operator Dictionary()["args"]; + int flags = CONNECT_PERSIST | (defer?CONNECT_DEFERRED:0) | (oshot?CONNECT_ONESHOT:0); undo_redo->create_action("Connect '"+signal+"' to '"+String(dst_method)+"'"); - undo_redo->add_do_method(node,"connect",signal,target,dst_method,binds,CONNECT_PERSIST | (defer?CONNECT_DEFERRED:0)); + undo_redo->add_do_method(node,"connect",signal,target,dst_method,binds,flags); undo_redo->add_undo_method(node,"disconnect",signal,target,dst_method); undo_redo->add_do_method(this,"update_tree"); undo_redo->add_undo_method(this,"update_tree"); @@ -731,6 +740,8 @@ void ConnectionsDialog::update_tree() { String path = String(node->get_path_to(target))+" :: "+c.method+"()"; if (c.flags&CONNECT_DEFERRED) path+=" (deferred)"; + if (c.flags&CONNECT_ONESHOT) + path+=" (oneshot)"; if (c.binds.size()) { path+=" binds( "; diff --git a/tools/editor/connections_dialog.h b/tools/editor/connections_dialog.h index 68b13bf07a..4a1c3f189c 100644 --- a/tools/editor/connections_dialog.h +++ b/tools/editor/connections_dialog.h @@ -58,6 +58,7 @@ class ConnectDialog : public ConfirmationDialog { //MenuButton *dst_method_list; OptionButton *type_list; CheckButton *deferred; + CheckButton *oneshot; CheckButton *make_callback; PropertyEditor *bind_editor; Node *node; @@ -80,6 +81,7 @@ public: NodePath get_dst_path() const; StringName get_dst_method() const; bool get_deferred() const; + bool get_oneshot() const; Vector<Variant> get_binds() const; void set_dst_method(const StringName& p_method); void set_dst_node(Node* p_node); diff --git a/tools/editor/dependency_editor.cpp b/tools/editor/dependency_editor.cpp index c04e82a08a..7e63cfb1b4 100644 --- a/tools/editor/dependency_editor.cpp +++ b/tools/editor/dependency_editor.cpp @@ -510,3 +510,184 @@ DependencyErrorDialog::DependencyErrorDialog() { set_title("Errors loading!"); } + +////////////////////////////////////////////////////////////////////// + + + +void OrphanResourcesDialog::ok_pressed() { + + paths.clear(); + + _find_to_delete(files->get_root(),paths); + if (paths.empty()) + return; + + delete_confirm->set_text("Permanently Delete "+itos(paths.size())+" Item(s) ? (No Undo!!)"); + delete_confirm->popup_centered_minsize(); +} + +bool OrphanResourcesDialog::_fill_owners(EditorFileSystemDirectory *efsd,HashMap<String,int>& refs,TreeItem* p_parent){ + + + if (!efsd) + return false; + + bool has_childs=false; + + for(int i=0;i<efsd->get_subdir_count();i++) { + + TreeItem *dir_item=NULL; + if (p_parent) { + dir_item = files->create_item(p_parent); + dir_item->set_text(0,efsd->get_subdir(i)->get_name()); + dir_item->set_icon(0,get_icon("folder","FileDialog")); + + } + bool children = _fill_owners(efsd->get_subdir(i),refs,dir_item); + + if (p_parent) { + if (!children) { + memdelete(dir_item); + } else { + has_childs=true; + } + } + + } + + + for(int i=0;i<efsd->get_file_count();i++) { + + if (!p_parent) { + Vector<String> deps = efsd->get_file_deps(i); + //print_line(":::"+efsd->get_file_path(i)); + for(int j=0;j<deps.size();j++) { + + if (!refs.has(deps[j])) { + refs[deps[j]]=1; + } + } + } else { + + String path = efsd->get_file_path(i); + if (!refs.has(path)) { + TreeItem *ti=files->create_item(p_parent); + ti->set_cell_mode(0,TreeItem::CELL_MODE_CHECK); + ti->set_text(0,efsd->get_file(i)); + ti->set_editable(0,true); + + String type=efsd->get_file_type(i); + + Ref<Texture> icon; + if (has_icon(type,"EditorIcons")) { + icon=get_icon(type,"EditorIcons"); + } else { + icon=get_icon("Object","EditorIcons"); + } + ti->set_icon(0,icon); + int ds = efsd->get_file_deps(i).size(); + ti->set_text(1,itos(ds)); + if (ds) { + ti->add_button(1,get_icon("Visible","EditorIcons")); + } + ti->set_metadata(0,path); + has_childs=true; + } + } + + } + + return has_childs; +} + + +void OrphanResourcesDialog::refresh() { + HashMap<String,int> refs; + _fill_owners(EditorFileSystem::get_singleton()->get_filesystem(),refs,NULL); + files->clear(); + TreeItem *root=files->create_item(); + _fill_owners(EditorFileSystem::get_singleton()->get_filesystem(),refs,root); +} + + +void OrphanResourcesDialog::show(){ + + refresh(); + popup_centered_ratio(); +} + + +void OrphanResourcesDialog::_find_to_delete(TreeItem* p_item,List<String>& paths) { + + while(p_item) { + + if (p_item->get_cell_mode(0)==TreeItem::CELL_MODE_CHECK && p_item->is_checked(0)) { + paths.push_back(p_item->get_metadata(0)); + } + + if (p_item->get_children()) { + _find_to_delete(p_item->get_children(),paths); + } + + p_item=p_item->get_next(); + } + + +} + +void OrphanResourcesDialog::_delete_confirm() { + + DirAccess *da = DirAccess::create(DirAccess::ACCESS_RESOURCES); + for (List<String>::Element *E=paths.front();E;E=E->next()) { + + da->remove(E->get()); + EditorFileSystem::get_singleton()->update_file(E->get()); + } + memdelete(da); + refresh(); +} + +void OrphanResourcesDialog::_button_pressed(Object *p_item,int p_column, int p_id) { + + TreeItem *ti=p_item->cast_to<TreeItem>(); + + String path = ti->get_metadata(0); + dep_edit->edit(path); + +} + +void OrphanResourcesDialog::_bind_methods() { + + ObjectTypeDB::bind_method(_MD("_delete_confirm"),&OrphanResourcesDialog::_delete_confirm); + ObjectTypeDB::bind_method(_MD("_button_pressed"),&OrphanResourcesDialog::_button_pressed); + +} + +OrphanResourcesDialog::OrphanResourcesDialog(){ + + VBoxContainer *vbc = memnew( VBoxContainer ); + add_child(vbc); + set_child_rect(vbc); + files = memnew( Tree ); + files->set_columns(2); + files->set_column_titles_visible(true); + files->set_column_min_width(1,100); + files->set_column_expand(0,true); + files->set_column_expand(1,false); + files->set_column_title(0,"Resource"); + files->set_column_title(1,"Owns"); + files->set_hide_root(true); + vbc->add_margin_child("Resources Without Explicit Ownership:",files,true); + set_title("Orphan Resource Explorer"); + delete_confirm = memnew( ConfirmationDialog ); + delete_confirm->set_text("Delete selected files?"); + get_ok()->set_text("Delete"); + add_child(delete_confirm); + dep_edit = memnew( DependencyEditor ); + add_child(dep_edit); + files->connect("button_pressed",this,"_button_pressed"); + delete_confirm->connect("confirmed",this,"_delete_confirm"); + set_hide_on_ok(false); + +} diff --git a/tools/editor/dependency_editor.h b/tools/editor/dependency_editor.h index 1c328e7a93..c372025ca0 100644 --- a/tools/editor/dependency_editor.h +++ b/tools/editor/dependency_editor.h @@ -91,4 +91,29 @@ public: DependencyErrorDialog(); }; + + +class OrphanResourcesDialog : public ConfirmationDialog { + OBJ_TYPE(OrphanResourcesDialog,ConfirmationDialog); + + DependencyEditor *dep_edit; + Tree *files; + ConfirmationDialog *delete_confirm; + void ok_pressed(); + + bool _fill_owners(EditorFileSystemDirectory *efsd, HashMap<String,int>& refs, TreeItem *p_parent); + + List<String> paths; + void _find_to_delete(TreeItem* p_item,List<String>& paths); + void _delete_confirm(); + void _button_pressed(Object *p_item,int p_column, int p_id); + + void refresh(); + static void _bind_methods(); +public: + + void show(); + OrphanResourcesDialog(); +}; + #endif // DEPENDENCY_EDITOR_H diff --git a/tools/editor/editor_help.cpp b/tools/editor/editor_help.cpp index 321ac76240..a5a3890129 100644 --- a/tools/editor/editor_help.cpp +++ b/tools/editor/editor_help.cpp @@ -36,6 +36,14 @@ #include "os/keyboard.h" +void EditorHelpSearch::popup() { + popup_centered_ratio(0.6); + if (search_box->get_text()!="") { + search_box->select_all(); + _update_search(); + } + search_box->grab_focus(); +} void EditorHelpSearch::popup(const String& p_term) { @@ -263,7 +271,7 @@ void EditorHelpSearch::_confirmed() { String mdata=ti->get_metadata(0); emit_signal("go_to_help",mdata); - editor->call("_editor_select",3); // in case EditorHelpSearch beeen invoked on top of other editor window + editor->call("_editor_select",EditorNode::EDITOR_SCRIPT); // in case EditorHelpSearch beeen invoked on top of other editor window // go to that hide(); } @@ -1049,7 +1057,7 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) { void EditorHelp::_request_help(const String& p_string) { Error err = _goto_desc(p_string); if (err==OK) { - editor->call("_editor_select",3); + editor->call("_editor_select",EditorNode::EDITOR_SCRIPT); } //100 palabras } @@ -1089,7 +1097,7 @@ void EditorHelp::_help_callback(const String& p_topic) { line=constant_line[name]; } - class_desc->scroll_to_line(line); + class_desc->call_deferred("scroll_to_line", line); } @@ -1350,7 +1358,6 @@ void EditorHelp::_notification(int p_what) { // forward->set_icon(get_icon("Forward","EditorIcons")); // back->set_icon(get_icon("Back","EditorIcons")); _update_doc(); - editor->connect("request_help",this,"_request_help"); } break; } @@ -1408,7 +1415,6 @@ void EditorHelp::_bind_methods() { ObjectTypeDB::bind_method("_unhandled_key_input",&EditorHelp::_unhandled_key_input); ObjectTypeDB::bind_method("_search",&EditorHelp::_search); ObjectTypeDB::bind_method("_search_cbk",&EditorHelp::_search_cbk); - ObjectTypeDB::bind_method("_help_callback",&EditorHelp::_help_callback); ADD_SIGNAL(MethodInfo("go_to_help")); diff --git a/tools/editor/editor_help.h b/tools/editor/editor_help.h index b5ee6eca6c..04ac4d35ff 100644 --- a/tools/editor/editor_help.h +++ b/tools/editor/editor_help.h @@ -68,7 +68,8 @@ protected: static void _bind_methods(); public: - void popup(const String& p_term=""); + void popup(); + void popup(const String& p_term); EditorHelpSearch(); }; diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 4e22592880..7b96db56f2 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -167,11 +167,20 @@ 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: _editor_select(0); break; - case KEY_F2: _editor_select(1); break; - case KEY_F3: _editor_select(2); break; + case KEY_F1: + if (!p_event.key.mod.shift && !p_event.key.mod.command) + _editor_select(EDITOR_2D); + break; + case KEY_F2: + if (!p_event.key.mod.shift && !p_event.key.mod.command) + _editor_select(EDITOR_3D); + break; + case KEY_F3: + if (!p_event.key.mod.shift && !p_event.key.mod.command) + _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; case KEY_F7: _menu_option_confirm(RUN_PAUSE,true); break; @@ -289,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!="") { @@ -879,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); @@ -2379,6 +2388,10 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { log->add_message("REDO: "+action); } break; + case TOOLS_ORPHAN_RESOURCES: { + + orphan_resources->show(); + } break; case EDIT_REVERT: { @@ -2519,7 +2532,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { case OBJECT_REQUEST_HELP: { if (current) { - _editor_select(3); + _editor_select(EDITOR_SCRIPT); emit_signal("request_help",current->get_type()); } @@ -3296,9 +3309,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); } } @@ -3534,13 +3547,14 @@ Error EditorNode::load_scene(const String& p_scene, bool p_ignore_broken_deps,bo if (p_set_inherited) { Ref<SceneState> state = sdata->get_state(); - state->set_path(lpath); + state->set_path(lpath); new_scene->set_scene_inherited_state(state); new_scene->set_filename(String()); - if (new_scene->get_scene_instance_state().is_valid()) - new_scene->get_scene_instance_state()->set_path(String()); + //if (new_scene->get_scene_instance_state().is_valid()) + // new_scene->get_scene_instance_state()->set_path(String()); } + new_scene->set_scene_instance_state(Ref<SceneState>()); set_edited_scene(new_scene); _get_scene_metadata(); @@ -3857,7 +3871,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); } @@ -5037,6 +5052,17 @@ EditorNode::EditorNode() { p=import_menu->get_popup(); p->connect("item_pressed",this,"_menu_option"); + tool_menu = memnew( MenuButton ); + tool_menu->set_tooltip("Miscelaneous project or scene wide tools."); + tool_menu->set_text("Tools"); + + //tool_menu->set_icon(gui_base->get_icon("Save","EditorIcons")); + left_menu_hb->add_child( tool_menu ); + + p=tool_menu->get_popup(); + p->connect("item_pressed",this,"_menu_option"); + p->add_item("Orphan Resource Explorer",TOOLS_ORPHAN_RESOURCES); + export_button = memnew( ToolButton ); export_button->set_tooltip("Export the project to many platforms."); export_button->set_text("Export"); @@ -5465,7 +5491,8 @@ EditorNode::EditorNode() { - + orphan_resources = memnew( OrphanResourcesDialog ); + gui_base->add_child(orphan_resources); diff --git a/tools/editor/editor_node.h b/tools/editor/editor_node.h index 7d8b97688e..5cc9d9eaa2 100644 --- a/tools/editor/editor_node.h +++ b/tools/editor/editor_node.h @@ -133,6 +133,7 @@ class EditorNode : public Node { EDIT_UNDO, EDIT_REDO, EDIT_REVERT, + TOOLS_ORPHAN_RESOURCES, RESOURCE_NEW, RESOURCE_LOAD, RESOURCE_SAVE, @@ -237,6 +238,7 @@ class EditorNode : public Node { Control *viewport; MenuButton *file_menu; MenuButton *import_menu; + MenuButton *tool_menu; ToolButton *export_button; ToolButton *prev_scene; MenuButton *object_menu; @@ -333,6 +335,7 @@ class EditorNode : public Node { DependencyErrorDialog *dependency_error; DependencyEditor *dependency_fixer; + OrphanResourcesDialog *orphan_resources; TabContainer *dock_slot[DOCK_SLOT_MAX]; Rect2 dock_select_rect[DOCK_SLOT_MAX]; @@ -529,6 +532,12 @@ protected: static void _bind_methods(); public: + enum EditorTable { + EDITOR_2D = 0, + EDITOR_3D, + EDITOR_SCRIPT + }; + static EditorNode* get_singleton() { return singleton; } diff --git a/tools/editor/io_plugins/editor_mesh_import_plugin.cpp b/tools/editor/io_plugins/editor_mesh_import_plugin.cpp index 2139513025..b32ab8cb0b 100644 --- a/tools/editor/io_plugins/editor_mesh_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_mesh_import_plugin.cpp @@ -128,7 +128,7 @@ class EditorMeshImportDialog : public ConfirmationDialog { LineEdit *save_path; EditorFileDialog *file_select; EditorDirDialog *save_select; - ConfirmationDialog *error_dialog; + AcceptDialog *error_dialog; PropertyEditor *option_editor; _EditorMeshImportOptions *options; @@ -169,13 +169,12 @@ public: void _browse_target() { save_select->popup_centered_ratio(); - } - void popup_import(const String& p_path) { popup_centered(Size2(400,400)); + if (p_path!="") { Ref<ResourceImportMetadata> rimd = ResourceLoader::load_import_metadata(p_path); @@ -199,14 +198,13 @@ public: } } - void _import() { Vector<String> meshes = import_path->get_text().split(","); - if (meshes.size()==0) { error_dialog->set_text("No meshes to import!"); - error_dialog->popup_centered(Size2(200,100)); + error_dialog->popup_centered_minsize(); + return; } for(int i=0;i<meshes.size();i++) { @@ -229,19 +227,18 @@ public: String dst = save_path->get_text(); if (dst=="") { error_dialog->set_text("Save path is empty!"); - error_dialog->popup_centered(Size2(200,100)); + error_dialog->popup_centered_minsize(); + return; } dst = dst.plus_file(meshes[i].get_file().basename()+".msh"); - Error err = plugin->import(dst,imd); + plugin->import(dst,imd); } hide(); - } - void _notification(int p_what) { @@ -253,27 +250,24 @@ public: static void _bind_methods() { - ObjectTypeDB::bind_method("_choose_files",&EditorMeshImportDialog::_choose_files); ObjectTypeDB::bind_method("_choose_save_dir",&EditorMeshImportDialog::_choose_save_dir); ObjectTypeDB::bind_method("_import",&EditorMeshImportDialog::_import); ObjectTypeDB::bind_method("_browse",&EditorMeshImportDialog::_browse); ObjectTypeDB::bind_method("_browse_target",&EditorMeshImportDialog::_browse_target); - // ADD_SIGNAL( MethodInfo("imported",PropertyInfo(Variant::OBJECT,"scene")) ); } EditorMeshImportDialog(EditorMeshImportPlugin *p_plugin) { plugin=p_plugin; - set_title("Single Mesh Import"); + set_hide_on_ok(false); VBoxContainer *vbc = memnew( VBoxContainer ); add_child(vbc); set_child_rect(vbc); - HBoxContainer *hbc = memnew( HBoxContainer ); vbc->add_margin_child("Source Mesh(es):",hbc); @@ -300,28 +294,23 @@ public: save_choose->connect("pressed", this,"_browse_target"); - file_select = memnew(EditorFileDialog); + file_select = memnew( EditorFileDialog ); file_select->set_access(EditorFileDialog::ACCESS_FILESYSTEM); - add_child(file_select); file_select->set_mode(EditorFileDialog::MODE_OPEN_FILES); - file_select->connect("files_selected", this,"_choose_files"); file_select->add_filter("*.obj ; Wavefront OBJ"); - save_select = memnew( EditorDirDialog ); - add_child(save_select); + add_child(file_select); + file_select->connect("files_selected", this,"_choose_files"); - // save_select->set_mode(EditorFileDialog::MODE_OPEN_DIR); + save_select = memnew( EditorDirDialog ); + add_child(save_select); save_select->connect("dir_selected", this,"_choose_save_dir"); get_ok()->connect("pressed", this,"_import"); get_ok()->set_text("Import"); - - error_dialog = memnew ( ConfirmationDialog ); + error_dialog = memnew( AcceptDialog ); add_child(error_dialog); - error_dialog->get_ok()->set_text("Accept"); - // error_dialog->get_cancel()->hide(); - set_hide_on_ok(false); options = memnew( _EditorMeshImportOptions ); option_editor = memnew( PropertyEditor ); diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp index 65ed420a51..e01cf72149 100644 --- a/tools/editor/plugins/script_editor_plugin.cpp +++ b/tools/editor/plugins/script_editor_plugin.cpp @@ -881,18 +881,17 @@ void ScriptEditor::_menu_option(int p_option) { } break; case SEARCH_HELP: { - help_search_dialog->popup("current"); + help_search_dialog->popup(); } break; case SEARCH_CLASSES: { - if (tab_container->get_tab_count()==0) - break; - String current; - EditorHelp *eh = tab_container->get_child( tab_container->get_current_tab() )->cast_to<EditorHelp>(); - if (eh) { - current=eh->get_class_name(); + if (tab_container->get_tab_count()>0) { + EditorHelp *eh = tab_container->get_child( tab_container->get_current_tab() )->cast_to<EditorHelp>(); + if (eh) { + current=eh->get_class_name(); + } } help_index->popup_centered_ratio(0.6); @@ -1388,6 +1387,7 @@ void ScriptEditor::_notification(int p_what) { if (p_what==NOTIFICATION_READY) { get_tree()->connect("tree_changed",this,"_tree_changed"); + editor->connect("request_help",this,"_request_help"); } if (p_what==NOTIFICATION_EXIT_TREE) { @@ -2205,6 +2205,7 @@ void ScriptEditor::_bind_methods() { ObjectTypeDB::bind_method("_script_split_dragged",&ScriptEditor::_script_split_dragged); ObjectTypeDB::bind_method("_help_class_open",&ScriptEditor::_help_class_open); ObjectTypeDB::bind_method("_help_class_goto",&ScriptEditor::_help_class_goto); + ObjectTypeDB::bind_method("_request_help",&ScriptEditor::_help_class_open); ObjectTypeDB::bind_method("_history_forward",&ScriptEditor::_history_forward); ObjectTypeDB::bind_method("_history_back",&ScriptEditor::_history_back); } diff --git a/tools/editor/project_export.cpp b/tools/editor/project_export.cpp index cd6dc06f75..3464b3c9bb 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<EditorExportPlatform> exporter = EditorImportExport::get_singleton()->get_export_platform(p_platform); if (exporter.is_null()) { ERR_PRINT("Invalid platform for export"); + + List<StringName> platforms; + EditorImportExport::get_singleton()->get_export_platforms(&platforms); + print_line("Valid export plaftorms are:"); + for (List<StringName>::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); diff --git a/tools/editor/project_manager.cpp b/tools/editor/project_manager.cpp index 893df04709..04705017d2 100644 --- a/tools/editor/project_manager.cpp +++ b/tools/editor/project_manager.cpp @@ -624,11 +624,6 @@ void ProjectManager::_open_project_confirm() { args.push_back("-editor"); - const String &selected_main = E->get(); - if (selected_main!="") { - args.push_back(selected_main); - } - String exec = OS::get_singleton()->get_executable_path(); OS::ProcessID pid=0; diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp index 31393ebcbc..0fe3dee2ea 100644 --- a/tools/editor/property_editor.cpp +++ b/tools/editor/property_editor.cpp @@ -1361,7 +1361,7 @@ void CustomPropertyEditor::_modified(String p_string) { } break; case Variant::MATRIX32: { - Matrix3 m; + Matrix32 m; for(int i=0;i<6;i++) { m.elements[i/2][i%2]=value_editor[i]->get_text().to_double(); @@ -2846,6 +2846,13 @@ void PropertyEditor::update_tree() { item->set_icon( 0,get_icon("Vector","EditorIcons") ); } break; + case Variant::MATRIX32: + case Variant::MATRIX3: { + + item->set_cell_mode( 1, TreeItem::CELL_MODE_CUSTOM ); + item->set_editable( 1, true ); + item->set_text(1, obj->get(p.name)); + } break; case Variant::TRANSFORM: { item->set_cell_mode( 1, TreeItem::CELL_MODE_CUSTOM ); diff --git a/tools/editor/scene_tree_dock.cpp b/tools/editor/scene_tree_dock.cpp index 0cafe7459b..8b5bf8c1e1 100644 --- a/tools/editor/scene_tree_dock.cpp +++ b/tools/editor/scene_tree_dock.cpp @@ -1264,7 +1264,10 @@ void SceneTreeDock::import_subscene() { void SceneTreeDock::_import_subscene() { Node* parent = scene_tree->get_selected(); - ERR_FAIL_COND(!parent); + if (!parent) { + parent = editor_data->get_edited_scene_root(); + ERR_FAIL_COND(!parent); + } import_subscene_dialog->move(parent,edited_scene); editor_data->get_undo_redo().clear_history(); //no undo for now.. diff --git a/tools/editor/scene_tree_editor.cpp b/tools/editor/scene_tree_editor.cpp index ac2f76acdc..6575603073 100644 --- a/tools/editor/scene_tree_editor.cpp +++ b/tools/editor/scene_tree_editor.cpp @@ -565,7 +565,6 @@ void SceneTreeEditor::_notification(int p_what) { get_tree()->disconnect("node_removed",this,"_node_removed"); tree->disconnect("item_collapsed",this,"_cell_collapsed"); clear_inherit_confirm->disconnect("confirmed",this,"_subscene_option"); - _update_tree(); } } diff --git a/tools/ios_xcode_template/godot_ios.xcodeproj/project.pbxproj b/tools/ios_xcode_template/godot_ios.xcodeproj/project.pbxproj index 7cd4da0f4a..4ae1ec8a53 100644 --- a/tools/ios_xcode_template/godot_ios.xcodeproj/project.pbxproj +++ b/tools/ios_xcode_template/godot_ios.xcodeproj/project.pbxproj @@ -192,7 +192,7 @@ isa = PBXProject; attributes = { LastUpgradeCheck = 0500; - ORGANIZATIONNAME = Okam; + ORGANIZATIONNAME = GodotEngine; TargetAttributes = { D0BCFE5F18AEBDA3004A7AAE = { TestTargetID = D0BCFE3318AEBDA2004A7AAE; diff --git a/tools/ios_xcode_template/godot_ios/godot_ios-Info.plist b/tools/ios_xcode_template/godot_ios/godot_ios-Info.plist index f34ebb97f0..357970920a 100644 --- a/tools/ios_xcode_template/godot_ios/godot_ios-Info.plist +++ b/tools/ios_xcode_template/godot_ios/godot_ios-Info.plist @@ -9,7 +9,7 @@ <key>CFBundleExecutable</key> <string>godot_opt.iphone</string> <key>CFBundleIdentifier</key> - <string>com.okamstudios.${PRODUCT_NAME:rfc1034identifier}</string> + <string>org.godotengine.${PRODUCT_NAME:rfc1034identifier}</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> diff --git a/tools/ios_xcode_template/godot_ios/main.m b/tools/ios_xcode_template/godot_ios/main.m index dca55f40ce..6bb6bc2188 100644 --- a/tools/ios_xcode_template/godot_ios/main.m +++ b/tools/ios_xcode_template/godot_ios/main.m @@ -1,10 +1,31 @@ -// -// main.m -// godot_ios -// -// Created by Ariel m on 2/14/14. -// Copyright (c) 2014 Okam. All rights reserved. -// +/*************************************************************************/ +/* main.m */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #import <UIKit/UIKit.h> diff --git a/tools/ios_xcode_template/godot_iosTests/godot_iosTests-Info.plist b/tools/ios_xcode_template/godot_iosTests/godot_iosTests-Info.plist index 3b3eec9a51..0f69aa80eb 100644 --- a/tools/ios_xcode_template/godot_iosTests/godot_iosTests-Info.plist +++ b/tools/ios_xcode_template/godot_iosTests/godot_iosTests-Info.plist @@ -7,7 +7,7 @@ <key>CFBundleExecutable</key> <string>${EXECUTABLE_NAME}</string> <key>CFBundleIdentifier</key> - <string>com.okamstudios.${PRODUCT_NAME:rfc1034identifier}</string> + <string>org.godotengine.${PRODUCT_NAME:rfc1034identifier}</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundlePackageType</key> diff --git a/tools/ios_xcode_template/godot_iosTests/godot_iosTests.m b/tools/ios_xcode_template/godot_iosTests/godot_iosTests.m index fce6288670..75e44659e0 100644 --- a/tools/ios_xcode_template/godot_iosTests/godot_iosTests.m +++ b/tools/ios_xcode_template/godot_iosTests/godot_iosTests.m @@ -1,10 +1,31 @@ -// -// godot_iosTests.m -// godot_iosTests -// -// Created by Ariel m on 2/14/14. -// Copyright (c) 2014 Okam. All rights reserved. -// +/*************************************************************************/ +/* godot_iosTests.m */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #import <XCTest/XCTest.h> |