diff options
Diffstat (limited to 'tools/editor')
-rw-r--r-- | tools/editor/editor_help.cpp | 2 | ||||
-rw-r--r-- | tools/editor/editor_log.cpp | 2 | ||||
-rw-r--r-- | tools/editor/editor_node.cpp | 93 | ||||
-rw-r--r-- | tools/editor/editor_node.h | 5 | ||||
-rw-r--r-- | tools/editor/editor_settings.cpp | 1 | ||||
-rw-r--r-- | tools/editor/io_plugins/editor_sample_import_plugin.cpp | 5 | ||||
-rw-r--r-- | tools/editor/io_plugins/editor_scene_import_plugin.cpp | 5 | ||||
-rw-r--r-- | tools/editor/plugins/script_editor_plugin.cpp | 6 | ||||
-rw-r--r-- | tools/editor/project_export.cpp | 7 | ||||
-rw-r--r-- | tools/editor/project_settings.cpp | 5 |
10 files changed, 86 insertions, 45 deletions
diff --git a/tools/editor/editor_help.cpp b/tools/editor/editor_help.cpp index a5b6fbd4ff..25fc526bf9 100644 --- a/tools/editor/editor_help.cpp +++ b/tools/editor/editor_help.cpp @@ -353,7 +353,7 @@ void EditorHelp::_search(const String&) { String stext=search->get_text(); bool keep = prev_search==stext && class_list->get_selected() && prev_search_page==class_list->get_selected()->get_text(0); - class_desc->search(stext); + class_desc->search(stext, keep); prev_search=stext; if (class_list->get_selected()) diff --git a/tools/editor/editor_log.cpp b/tools/editor/editor_log.cpp index 67c7f7b788..8d49655960 100644 --- a/tools/editor/editor_log.cpp +++ b/tools/editor/editor_log.cpp @@ -219,7 +219,7 @@ EditorLog::EditorLog() { log->set_selection_enabled(true); log->set_focus_mode(FOCUS_CLICK); pc->add_child(log); - add_message(VERSION_FULL_NAME" (c) 2008-2014 Juan Linietsky, Ariel Manzur."); + add_message(VERSION_FULL_NAME" (c) 2008-2015 Juan Linietsky, Ariel Manzur."); //log->add_text("Initialization Complete.\n"); //because it looks cool. add_style_override("panel",get_stylebox("panelf","Panel")); diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index a6625d7204..56b813344a 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -610,7 +610,42 @@ static Error _fix_imported_scene_paths(Node* node, Node* root, String save_path) }; -bool EditorNode::_find_and_save_edited_subresources(Object *obj,Set<RES>& processed,int32_t flags) { +bool EditorNode::_find_and_save_resource(RES res,Map<RES,bool>& processed,int32_t flags) { + + if (res.is_null()) + return false; + + if (processed.has(res)) { + + return processed[res]; + } + + + bool changed = res->is_edited(); + res->set_edited(false); + + bool subchanged = _find_and_save_edited_subresources(res.ptr(),processed,flags); + +// print_line("checking if edited: "+res->get_type()+" :: "+res->get_name()+" :: "+res->get_path()+" :: "+itos(changed)+" :: SR "+itos(subchanged)); + + if (res->get_path().is_resource_file()) { + if (changed || subchanged) { + //save + print_line("Also saving modified external resource: "+res->get_path()); + Error err = ResourceSaver::save(res->get_path(),res,flags); + + } + processed[res]=false; //because it's a file + return false; + } else { + + + processed[res]=changed; + return changed; + } +} + +bool EditorNode::_find_and_save_edited_subresources(Object *obj,Map<RES,bool>& processed,int32_t flags) { bool ret_changed=false; List<PropertyInfo> pi; @@ -620,57 +655,45 @@ bool EditorNode::_find_and_save_edited_subresources(Object *obj,Set<RES>& proces if (!(E->get().usage&PROPERTY_USAGE_STORAGE)) continue; + + switch(E->get().type) { case Variant::OBJECT: { RES res = obj->get(E->get().name); - if (res.is_null() || processed.has(res)) - break; - - processed.insert(res); - - bool changed = res->is_edited(); - res->set_edited(false); - - bool subchanged = _find_and_save_edited_subresources(res.ptr(),processed,flags); - - if (res->get_path().is_resource_file()) { - if (changed || subchanged) { - //save - print_line("Also saving modified external resource: "+res->get_path()); - Error err = ResourceSaver::save(res->get_path(),res,flags); - - } - } else { - + if (_find_and_save_resource(res,processed,flags)) ret_changed=true; - } - } break; case Variant::ARRAY: { - /*Array varray=p_variant; + Array varray= obj->get(E->get().name); int len=varray.size(); for(int i=0;i<len;i++) { Variant v=varray.get(i); - _find_resources(v); - }*/ + RES res=v; + if (_find_and_save_resource(res,processed,flags)) + ret_changed=true; + + //_find_resources(v); + } } break; case Variant::DICTIONARY: { - /* - Dictionary d=p_variant; + + Dictionary d=obj->get(E->get().name);; List<Variant> keys; d.get_key_list(&keys); for(List<Variant>::Element *E=keys.front();E;E=E->next()) { Variant v = d[E->get()]; - _find_resources(v); - } */ + RES res=v; + if (_find_and_save_resource(res,processed,flags)) + ret_changed=true; + } } break; default: {} } @@ -681,7 +704,7 @@ bool EditorNode::_find_and_save_edited_subresources(Object *obj,Set<RES>& proces } -void EditorNode::_save_edited_subresources(Node* scene,Set<RES>& processed,int32_t flags) { +void EditorNode::_save_edited_subresources(Node* scene,Map<RES,bool>& processed,int32_t flags) { _find_and_save_edited_subresources(scene,processed,flags); @@ -741,7 +764,7 @@ void EditorNode::_save_scene(String p_file) { err = ResourceSaver::save(p_file,sdata,flg); - Set<RES> processed; + Map<RES,bool> processed; _save_edited_subresources(scene,processed,flg); editor_data.save_editor_external_data(); if (err==OK) { @@ -2122,7 +2145,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { } editor_data.get_undo_redo().clear_history(); - if (editor_plugin_screen) { //reload editor plugin + if (editor_plugin_over) { //reload editor plugin editor_plugin_over->edit(NULL); editor_plugin_over->edit(current); } @@ -2518,7 +2541,7 @@ Error EditorNode::save_translatable_strings(const String& p_to_file) { OS::Time time = OS::get_singleton()->get_time(); f->store_line("# Translation Strings Dump."); f->store_line("# Created By."); - f->store_line("# \t"VERSION_FULL_NAME" (c) 2008-2014 Juan Linietsky, Ariel Manzur."); + f->store_line("# \t"VERSION_FULL_NAME" (c) 2008-2015 Juan Linietsky, Ariel Manzur."); f->store_line("# From Scene: "); f->store_line("# \t"+get_edited_scene()->get_filename()); f->store_line(""); @@ -2633,7 +2656,7 @@ Error EditorNode::save_optimized_copy(const String& p_scene,const String& p_pres } } - ERR_EXPLAIN("Preset '"+p_preset+"' references unexisting saver: "+type); + ERR_EXPLAIN("Preset '"+p_preset+"' references nonexistent saver: "+type); ERR_FAIL_COND_V(saver.is_null(),ERR_INVALID_DATA); List<Variant> keys; @@ -3984,7 +4007,7 @@ EditorNode::EditorNode() { about->get_ok()->set_text("Thanks!"); about->set_hide_on_ok(true); Label *about_text = memnew( Label ); - about_text->set_text(VERSION_FULL_NAME"\n(c) 2008-2014 Juan Linietsky, Ariel Manzur.\n"); + about_text->set_text(VERSION_FULL_NAME"\n(c) 2008-2015 Juan Linietsky, Ariel Manzur.\n"); about_text->set_pos(Point2(gui_base->get_icon("Logo","EditorIcons")->get_size().width+30,20)); gui_base->add_child(about); about->add_child(about_text); diff --git a/tools/editor/editor_node.h b/tools/editor/editor_node.h index ae712004ba..76e82b5a6b 100644 --- a/tools/editor/editor_node.h +++ b/tools/editor/editor_node.h @@ -390,8 +390,9 @@ class EditorNode : public Node { void _cleanup_scene(); - bool _find_and_save_edited_subresources(Object *obj,Set<RES>& processed,int32_t flags); - void _save_edited_subresources(Node* scene,Set<RES>& processed,int32_t flags); + bool _find_and_save_resource(RES p_res,Map<RES,bool>& processed,int32_t flags); + bool _find_and_save_edited_subresources(Object *obj,Map<RES,bool>& processed,int32_t flags); + void _save_edited_subresources(Node* scene,Map<RES,bool>& processed,int32_t flags); struct ExportDefer { diff --git a/tools/editor/editor_settings.cpp b/tools/editor/editor_settings.cpp index 9a4505efed..f49d3b496d 100644 --- a/tools/editor/editor_settings.cpp +++ b/tools/editor/editor_settings.cpp @@ -264,6 +264,7 @@ void EditorSettings::create() { singleton = Ref<EditorSettings>( memnew( EditorSettings ) ); singleton->config_file_path=config_file_path; + singleton->settings_path=config_path+"/"+config_dir; singleton->_load_defaults(); singleton->scan_plugins(); diff --git a/tools/editor/io_plugins/editor_sample_import_plugin.cpp b/tools/editor/io_plugins/editor_sample_import_plugin.cpp index d1fe10df03..fa472ed033 100644 --- a/tools/editor/io_plugins/editor_sample_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_sample_import_plugin.cpp @@ -610,6 +610,7 @@ Error EditorSampleImportPlugin::import(const String& p_path, const Ref<ResourceI dst_format=Sample::FORMAT_IMA_ADPCM; _compress_ima_adpcm(data,dst_data); + print_line("compressing ima-adpcm, resulting buffersize is "+itos(dst_data.size())+" from "+itos(data.size())); } else { @@ -755,10 +756,10 @@ void EditorSampleImportPlugin::_compress_ima_adpcm(const Vector<float>& p_data,D prev+=vpdiff ; if (prev > 32767) { - printf("%i,xms %i, prev %i,diff %i, vpdiff %i, clip up %i\n",i,xm_sample,prev,diff,vpdiff,prev); + //printf("%i,xms %i, prev %i,diff %i, vpdiff %i, clip up %i\n",i,xm_sample,prev,diff,vpdiff,prev); prev=32767; } else if (prev < -32768) { - printf("%i,xms %i, prev %i,diff %i, vpdiff %i, clip down %i\n",i,xm_sample,prev,diff,vpdiff,prev); + //printf("%i,xms %i, prev %i,diff %i, vpdiff %i, clip down %i\n",i,xm_sample,prev,diff,vpdiff,prev); prev = -32768 ; } diff --git a/tools/editor/io_plugins/editor_scene_import_plugin.cpp b/tools/editor/io_plugins/editor_scene_import_plugin.cpp index 3fb4b06f3c..2ce5f3a5a7 100644 --- a/tools/editor/io_plugins/editor_scene_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_scene_import_plugin.cpp @@ -2638,8 +2638,11 @@ void EditorSceneImportPlugin::_filter_tracks(Node *scene, const String& p_text) for(Set<String>::Element *F=keep_local.front();F;F=F->next()) { keep.insert(F->get()); } - + print_line("FILTERING ANIM: "+String(E->get())); _filter_anim_tracks(anim->get_animation(name),keep); + } else { + print_line("NOT FILTERING ANIM: "+String(E->get())); + } } diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp index edc5d460e7..f5ba6a08e6 100644 --- a/tools/editor/plugins/script_editor_plugin.cpp +++ b/tools/editor/plugins/script_editor_plugin.cpp @@ -706,25 +706,31 @@ void ScriptEditor::_menu_option(int p_option) { } break; case EDIT_UNDO: { current->get_text_edit()->undo(); + current->get_text_edit()->call_deferred("grab_focus"); } break; case EDIT_REDO: { current->get_text_edit()->redo(); + current->get_text_edit()->call_deferred("grab_focus"); } break; case EDIT_CUT: { current->get_text_edit()->cut(); + current->get_text_edit()->call_deferred("grab_focus"); } break; case EDIT_COPY: { current->get_text_edit()->copy(); + current->get_text_edit()->call_deferred("grab_focus"); } break; case EDIT_PASTE: { current->get_text_edit()->paste(); + current->get_text_edit()->call_deferred("grab_focus"); } break; case EDIT_SELECT_ALL: { current->get_text_edit()->select_all(); + current->get_text_edit()->call_deferred("grab_focus"); } break; case EDIT_MOVE_LINE_UP: { diff --git a/tools/editor/project_export.cpp b/tools/editor/project_export.cpp index 63187d2903..ab27ac7fa9 100644 --- a/tools/editor/project_export.cpp +++ b/tools/editor/project_export.cpp @@ -479,6 +479,11 @@ Error ProjectExportDialog::export_platform(const String& p_platform, const Strin if (err!=OK) { error->set_text("Error exporting project!"); error->popup_centered_minsize(); + ERR_PRINT("Exporting failed!"); + if (p_quit_after) { + OS::get_singleton()->set_exit_code(255); + get_tree()->quit(); + } return ERR_CANT_CREATE; } else { if (p_quit_after) { @@ -1648,7 +1653,7 @@ Error ProjectExport::export_project(const String& p_preset) { if (saver.is_null()) { memdelete(d); - ERR_EXPLAIN("Preset '"+preset+"' references unexisting saver: "+type); + ERR_EXPLAIN("Preset '"+preset+"' references nonexistent saver: "+type); ERR_FAIL_COND_V(saver.is_null(),ERR_INVALID_DATA); } diff --git a/tools/editor/project_settings.cpp b/tools/editor/project_settings.cpp index 85adbd3a3b..08a1191f41 100644 --- a/tools/editor/project_settings.cpp +++ b/tools/editor/project_settings.cpp @@ -916,8 +916,8 @@ void ProjectSettings::_translation_res_option_changed() { ERR_FAIL_COND(!remaps.has(key)); - StringArray r = remaps[key]; - ERR_FAIL_INDEX(idx,remaps.size()); + StringArray r = remaps[key]; + ERR_FAIL_INDEX(idx,r.size()); r.set(idx,path+":"+langs[which]); remaps[key]=r; @@ -1095,6 +1095,7 @@ void ProjectSettings::_update_translations() { t2->set_editable(1,true); t2->set_metadata(1,path); int idx = langs.find(locale); + print_line("find "+locale+" at "+itos(idx)); if (idx<0) idx=0; |