diff options
-rw-r--r-- | core/variant_parser.cpp | 13 | ||||
-rw-r--r-- | demos/misc/autoload/global.gd | 27 | ||||
-rw-r--r-- | demos/misc/autoload/scene_a.gd | 11 | ||||
-rw-r--r-- | demos/misc/autoload/scene_b.gd | 11 | ||||
-rw-r--r-- | platform/isim/detect.py | 15 | ||||
-rw-r--r-- | scene/gui/option_button.cpp | 9 | ||||
-rw-r--r-- | scene/gui/popup_menu.cpp | 3 | ||||
-rw-r--r-- | scene/gui/slider.cpp | 4 | ||||
-rw-r--r-- | scene/gui/texture_button.cpp | 2 | ||||
-rw-r--r-- | scene/gui/tree.cpp | 14 | ||||
-rw-r--r-- | scene/gui/video_player.cpp | 9 | ||||
-rw-r--r-- | scene/gui/video_player.h | 6 | ||||
-rw-r--r-- | scene/resources/material.cpp | 2 | ||||
-rw-r--r-- | scene/resources/shader.cpp | 20 | ||||
-rw-r--r-- | tools/editor/editor_file_dialog.cpp | 5 | ||||
-rw-r--r-- | tools/editor/editor_import_export.cpp | 56 | ||||
-rw-r--r-- | tools/editor/editor_import_export.h | 12 | ||||
-rw-r--r-- | tools/editor/editor_node.cpp | 4 | ||||
-rw-r--r-- | tools/editor/project_export.cpp | 39 | ||||
-rw-r--r-- | tools/editor/property_editor.cpp | 16 | ||||
-rw-r--r-- | tools/editor/script_editor_debugger.cpp | 4 | ||||
-rw-r--r-- | tools/editor/script_editor_debugger.h | 1 | ||||
-rw-r--r-- | tools/editor/spatial_editor_gizmos.cpp | 4 |
23 files changed, 188 insertions, 99 deletions
diff --git a/core/variant_parser.cpp b/core/variant_parser.cpp index fed8c28740..239b129388 100644 --- a/core/variant_parser.cpp +++ b/core/variant_parser.cpp @@ -460,6 +460,19 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in value=Vector2(args[0],args[1]); return OK; + } else if (id=="Rect2"){ + + Vector<float> args; + Error err = _parse_construct<float>(p_stream,args,line,r_err_str); + if (err) + return err; + + if (args.size()!=4) { + r_err_str="Expected 4 arguments for constructor"; + } + + value=Rect2(args[0],args[1],args[2],args[3]); + return OK; } else if (id=="Vector3"){ Vector<float> args; diff --git a/demos/misc/autoload/global.gd b/demos/misc/autoload/global.gd index 2671b6f412..735995e806 100644 --- a/demos/misc/autoload/global.gd +++ b/demos/misc/autoload/global.gd @@ -1,7 +1,9 @@ extends Node -# Member variables -var current_scene = null + +# Changing scenes is most easily done using the functions `change_scene` +# and `change_scene_to` of the SceneTree. This script demonstrates how to +# change scenes without those helpers. func goto_scene(path): @@ -18,20 +20,17 @@ func goto_scene(path): func _deferred_goto_scene(path): - # Immediately free the current scene, - # there is no risk here. - current_scene.free() + # Immediately free the current scene, there is no risk here. + get_tree().get_current_scene().free() # Load new scene - var s = ResourceLoader.load(path) + var packed_scene = ResourceLoader.load(path) # Instance the new scene - current_scene = s.instance() + var instanced_scene = packed_scene.instance() - # Add it to the active scene, as child of root - get_tree().get_root().add_child(current_scene) - - -func _ready(): - # Get the current scene at the time of initialization - current_scene = get_tree().get_current_scene() + # Add it to the scene tree, as direct child of root + get_tree().get_root().add_child(instanced_scene) + + # Set it as the current scene, only after it has been added to the tree + get_tree().set_current_scene(instanced_scene) diff --git a/demos/misc/autoload/scene_a.gd b/demos/misc/autoload/scene_a.gd index f9c39887b0..03da86d9a0 100644 --- a/demos/misc/autoload/scene_a.gd +++ b/demos/misc/autoload/scene_a.gd @@ -1,16 +1,5 @@ - extends Panel -# Member variables here, example: -# var a=2 -# var b="textvar" - - -func _ready(): - # Initalization here - pass - func _on_goto_scene_pressed(): get_node("/root/global").goto_scene("res://scene_b.scn") - pass # Replace with function body diff --git a/demos/misc/autoload/scene_b.gd b/demos/misc/autoload/scene_b.gd index fdf2287a04..dea8c4623f 100644 --- a/demos/misc/autoload/scene_b.gd +++ b/demos/misc/autoload/scene_b.gd @@ -1,16 +1,5 @@ - extends Panel -# Member variables here, example: -# var a=2 -# var b="textvar" - - -func _ready(): - # Initalization here - pass - func _on_goto_scene_pressed(): get_node("/root/global").goto_scene("res://scene_a.scn") - pass # Replace with function body diff --git a/platform/isim/detect.py b/platform/isim/detect.py index bd0fd2fea3..0adbd9f413 100644 --- a/platform/isim/detect.py +++ b/platform/isim/detect.py @@ -21,8 +21,8 @@ def get_opts(): return [ ('ISIMPLATFORM', 'name of the iphone platform', 'iPhoneSimulator'), - ('ISIMPATH', 'the path to iphone toolchain', '/Applications/Xcode.app/Contents/Developer/Platforms/${ISIMPLATFORM}.platform'), - ('ISIMSDK', 'path to the iphone SDK', '$ISIMPATH/Developer/SDKs/${ISIMPLATFORM}.sdk'), + ('ISIMPATH', 'the path to iphone toolchain', '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain'), + ('ISIMSDK', 'path to the iphone SDK', '/Applications/Xcode.app/Contents/Developer/Platforms/${ISIMPLATFORM}.platform/Developer/SDKs/${ISIMPLATFORM}.sdk'), ('game_center', 'Support for game center', 'yes'), ('store_kit', 'Support for in-app store', 'yes'), ('ios_gles22_override', 'Force GLES2.0 on iOS', 'yes'), @@ -46,9 +46,10 @@ def configure(env): env['ENV']['PATH'] = env['ISIMPATH']+"/Developer/usr/bin/:"+env['ENV']['PATH'] - env['CC'] = '$ISIMPATH/Developer/usr/bin/gcc' - env['CXX'] = '$ISIMPATH/Developer/usr/bin/g++' - env['AR'] = 'ar' + env['CC'] = '$ISIMPATH/usr/bin/${ios_triple}clang' + env['CXX'] = '$ISIMPATH/usr/bin/${ios_triple}clang++' + env['AR'] = '$ISIMPATH/usr/bin/${ios_triple}ar' + env['RANLIB'] = '$ISIMPATH/usr/bin/${ios_triple}ranlib' import string env['CCFLAGS'] = string.split('-arch i386 -fobjc-abi-version=2 -fobjc-legacy-dispatch -fmessage-length=0 -fpascal-strings -fasm-blocks -Wall -D__IPHONE_OS_VERSION_MIN_REQUIRED=40100 -isysroot $ISIMSDK -mios-simulator-version-min=4.3 -DCUSTOM_MATRIX_TRANSFORM_H=\\\"build/iphone/matrix4_iphone.h\\\" -DCUSTOM_VECTOR3_TRANSFORM_H=\\\"build/iphone/vector3_iphone.h\\\"') @@ -97,4 +98,8 @@ def configure(env): env['ENV']['CODESIGN_ALLOCATE'] = '/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate' env.Append(CPPFLAGS=['-DIPHONE_ENABLED', '-DUNIX_ENABLED', '-DGLES2_ENABLED', '-fexceptions']) + import methods + env.Append( BUILDERS = { 'GLSL120' : env.Builder(action = methods.build_legacygl_headers, suffix = 'glsl.h',src_suffix = '.glsl') } ) + env.Append( BUILDERS = { 'GLSL' : env.Builder(action = methods.build_glsl_headers, suffix = 'glsl.h',src_suffix = '.glsl') } ) + env.Append( BUILDERS = { 'GLSL120GLES' : env.Builder(action = methods.build_gles2_headers, suffix = 'glsl.h',src_suffix = '.glsl') } ) diff --git a/scene/gui/option_button.cpp b/scene/gui/option_button.cpp index ff94a37be0..3cc5acc1a6 100644 --- a/scene/gui/option_button.cpp +++ b/scene/gui/option_button.cpp @@ -77,9 +77,14 @@ void OptionButton::_selected(int p_which) { } } - ERR_FAIL_COND(selid==-1); + if (selid==-1 && p_which>=0 && p_which<popup->get_item_count()) { + _select(p_which,true); + } else { - _select(selid,true); + ERR_FAIL_COND(selid==-1); + + _select(selid,true); + } } diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp index 25e39c1891..9dc03272b2 100644 --- a/scene/gui/popup_menu.cpp +++ b/scene/gui/popup_menu.cpp @@ -370,7 +370,7 @@ void PopupMenu::_input_event(const InputEvent &p_event) { } int over=_get_mouse_over(Point2(m.x,m.y)); - int id = (over<0 || items[over].separator || items[over].disabled)?-1:items[over].ID; + int id = (over<0 || items[over].separator || items[over].disabled)?-1:(items[over].ID>=0?items[over].ID:over); if (id<0) { mouse_over=-1; @@ -753,6 +753,7 @@ int PopupMenu::find_item_by_accelerator(uint32_t p_accel) const { void PopupMenu::activate_item(int p_item) { + ERR_FAIL_INDEX(p_item,items.size()); ERR_FAIL_COND(items[p_item].separator); int id = items[p_item].ID>=0?items[p_item].ID:p_item; diff --git a/scene/gui/slider.cpp b/scene/gui/slider.cpp index b6292c544b..78b5dabeb4 100644 --- a/scene/gui/slider.cpp +++ b/scene/gui/slider.cpp @@ -50,9 +50,9 @@ void Slider::_input_event(InputEvent p_event) { grab.pos=orientation==VERTICAL?mb.y:mb.x; double max = orientation==VERTICAL ? get_size().height : get_size().width ; if (orientation==VERTICAL) - set_val( ( ( -(double)grab.pos / max) * ( get_max() - get_min() ) ) + get_max() ); + set_unit_value( 1 - ((double)grab.pos / max) ); else - set_val( ( ( (double)grab.pos / max) * ( get_max() - get_min() ) ) + get_min() ); + set_unit_value((double)grab.pos / max); grab.active=true; grab.uvalue=get_unit_value(); } else { diff --git a/scene/gui/texture_button.cpp b/scene/gui/texture_button.cpp index 1322eeb0c3..7e6bf2cbdf 100644 --- a/scene/gui/texture_button.cpp +++ b/scene/gui/texture_button.cpp @@ -163,7 +163,7 @@ void TextureButton::_bind_methods() { ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT,"textures/disabled",PROPERTY_HINT_RESOURCE_TYPE,"Texture"), _SCS("set_disabled_texture"), _SCS("get_disabled_texture")); ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT,"textures/focused",PROPERTY_HINT_RESOURCE_TYPE,"Texture"), _SCS("set_focused_texture"), _SCS("get_focused_texture")); ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT,"textures/click_mask",PROPERTY_HINT_RESOURCE_TYPE,"BitMap"), _SCS("set_click_mask"), _SCS("get_click_mask")) ; - ADD_PROPERTYNO(PropertyInfo(Variant::VECTOR2,"params/scale",PROPERTY_HINT_RANGE,"0.01,1024,0.01"), _SCS("set_texture_scale"), _SCS("set_texture_scale")); + ADD_PROPERTYNO(PropertyInfo(Variant::VECTOR2,"params/scale",PROPERTY_HINT_RANGE,"0.01,1024,0.01"), _SCS("set_texture_scale"), _SCS("get_texture_scale")); ADD_PROPERTYNO(PropertyInfo(Variant::COLOR,"params/modulate"), _SCS("set_modulate"), _SCS("get_modulate")); } diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index ee7c0724e3..1b204cff65 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -1721,6 +1721,7 @@ void Tree::text_editor_enter(String p_text) { text_editor->hide(); + value_editor->hide(); if (!popup_edited_item) return; @@ -2167,18 +2168,9 @@ void Tree::_input_event(InputEvent p_event) { range_drag_enabled=false; Input::get_singleton()->set_mouse_mode(Input::MOUSE_MODE_VISIBLE); warp_mouse(range_drag_capture_pos); - } else { - text_editor->set_pos(pressing_item_rect.pos); - text_editor->set_size(pressing_item_rect.size); - - text_editor->clear(); - text_editor->set_text( pressing_for_editor_text ); - text_editor->select_all(); + } else + edit_selected(); - text_editor->show_modal(); - text_editor->grab_focus(); - - } pressing_for_editor=false; } diff --git a/scene/gui/video_player.cpp b/scene/gui/video_player.cpp index d99da5e906..22b19f50b2 100644 --- a/scene/gui/video_player.cpp +++ b/scene/gui/video_player.cpp @@ -338,6 +338,13 @@ float VideoPlayer::get_stream_pos() const { return playback->get_pos(); }; +Ref<Texture> VideoPlayer::get_video_texture() { + + if (playback.is_valid()) + return playback->get_texture(); + + return Ref<Texture> (); +} void VideoPlayer::set_autoplay(bool p_enable) { @@ -384,6 +391,8 @@ void VideoPlayer::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_buffering_msec","msec"),&VideoPlayer::set_buffering_msec); ObjectTypeDB::bind_method(_MD("get_buffering_msec"),&VideoPlayer::get_buffering_msec); + ObjectTypeDB::bind_method(_MD("get_video_texutre:Texture"), &VideoPlayer::get_video_texture ); + ADD_PROPERTY( PropertyInfo(Variant::INT, "stream/audio_track",PROPERTY_HINT_RANGE,"0,128,1"), _SCS("set_audio_track"), _SCS("get_audio_track") ); ADD_PROPERTY( PropertyInfo(Variant::OBJECT, "stream/stream", PROPERTY_HINT_RESOURCE_TYPE,"VideoStream"), _SCS("set_stream"), _SCS("get_stream") ); // ADD_PROPERTY( PropertyInfo(Variant::BOOL, "stream/loop"), _SCS("set_loop"), _SCS("has_loop") ); diff --git a/scene/gui/video_player.h b/scene/gui/video_player.h index c485e3d6b6..b14d3936b9 100644 --- a/scene/gui/video_player.h +++ b/scene/gui/video_player.h @@ -88,6 +88,8 @@ public: bool has_expand() const; + Ref<Texture> get_video_texture(); + void set_stream(const Ref<VideoStream> &p_stream); Ref<VideoStream> get_stream() const; @@ -110,8 +112,8 @@ public: void set_autoplay(bool p_vol); bool has_autoplay() const; - void set_audio_track(int p_track); - int get_audio_track() const; + void set_audio_track(int p_track); + int get_audio_track() const; void set_buffering_msec(int p_msec); int get_buffering_msec() const; diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index 55bb4e9073..b4ea60cb8d 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -535,6 +535,8 @@ void ShaderMaterial::_shader_changed() { void ShaderMaterial::set_shader(const Ref<Shader>& p_shader) { + ERR_FAIL_COND(p_shader.is_valid() && p_shader->get_mode()!=Shader::MODE_MATERIAL); + if (shader.is_valid()) shader->disconnect(SceneStringNames::get_singleton()->changed,this,SceneStringNames::get_singleton()->_shader_changed); shader=p_shader; diff --git a/scene/resources/shader.cpp b/scene/resources/shader.cpp index a9376faf62..f0a2721016 100644 --- a/scene/resources/shader.cpp +++ b/scene/resources/shader.cpp @@ -448,31 +448,19 @@ RES ResourceFormatLoaderShader::load(const String &p_path, const String& p_origi void ResourceFormatLoaderShader::get_recognized_extensions(List<String> *p_extensions) const { - p_extensions->push_back("shader"); + ObjectTypeDB::get_extensions_for_type("Shader", p_extensions); } + bool ResourceFormatLoaderShader::handles_type(const String& p_type) const { - return p_type=="Shader"; + return ObjectTypeDB::is_type(p_type, "Shader"); } String ResourceFormatLoaderShader::get_resource_type(const String &p_path) const { - if (p_path.extension().to_lower()=="shader") + if (p_path.extension().to_lower()=="shd") return "Shader"; return ""; } - - - - - - - - - - - - - diff --git a/tools/editor/editor_file_dialog.cpp b/tools/editor/editor_file_dialog.cpp index 7365cf9069..61ad7b6cbb 100644 --- a/tools/editor/editor_file_dialog.cpp +++ b/tools/editor/editor_file_dialog.cpp @@ -6,6 +6,8 @@ #include "editor_resource_preview.h" #include "editor_settings.h" #include "scene/gui/margin_container.h" +#include "os/file_access.h" + EditorFileDialog::GetIconFunc EditorFileDialog::get_icon_func=NULL; EditorFileDialog::GetIconFunc EditorFileDialog::get_large_icon_func=NULL; @@ -194,6 +196,9 @@ void EditorFileDialog::_thumbnail_done(const String& p_path,const Ref<Texture>& void EditorFileDialog::_request_single_thumbnail(const String& p_path) { + if (!FileAccess::exists(p_path)) + return; + EditorResourcePreview::get_singleton()->queue_resource_preview(p_path,this,"_thumbnail_done",p_path); //print_line("want file "+p_path); set_process(true); diff --git a/tools/editor/editor_import_export.cpp b/tools/editor/editor_import_export.cpp index cd455406b7..3cd5cfd629 100644 --- a/tools/editor/editor_import_export.cpp +++ b/tools/editor/editor_import_export.cpp @@ -41,6 +41,7 @@ #include "io/md5.h" #include "io_plugins/editor_texture_import_plugin.h" #include "tools/editor/plugins/script_editor_plugin.h" +#include "io/zip_io.h" String EditorImportPlugin::validate_source_path(const String& p_path) { @@ -1077,6 +1078,61 @@ Error EditorExportPlatform::save_pack_file(void *p_userdata,const String& p_path } +Error EditorExportPlatform::save_zip_file(void *p_userdata,const String& p_path, const Vector<uint8_t>& p_data,int p_file,int p_total) { + + + String path=p_path.replace_first("res://",""); + + ZipData *zd = (ZipData*)p_userdata; + + zipFile zip=(zipFile)zd->zip; + + zipOpenNewFileInZip(zip, + path.utf8().get_data(), + NULL, + NULL, + 0, + NULL, + 0, + NULL, + Z_DEFLATED, + Z_DEFAULT_COMPRESSION); + + zipWriteInFileInZip(zip,p_data.ptr(),p_data.size()); + zipCloseFileInZip(zip); + + zd->ep->step("Storing File: "+p_path,2+p_file*100/p_total); + zd->count++; + return OK; + +} + +Error EditorExportPlatform::save_zip(const String& p_path, bool p_make_bundles) { + + EditorProgress ep("savezip","Packing",102); + + //FileAccess *tmp = FileAccess::open(tmppath,FileAccess::WRITE); + + FileAccess *src_f; + zlib_filefunc_def io = zipio_create_io_from_file(&src_f); + zipFile zip=zipOpen2(p_path.utf8().get_data(),APPEND_STATUS_CREATE,NULL,&io); + + ZipData zd; + zd.count=0; + zd.ep=&ep; + zd.zip=zip; + + + Error err = export_project_files(save_zip_file,&zd,p_make_bundles); + + zipClose(zip,NULL); + + if (err) + return err; + + +} + Error EditorExportPlatform::save_pack(FileAccess *dst,bool p_make_bundles, int p_alignment) { EditorProgress ep("savepack","Packing",102); diff --git a/tools/editor/editor_import_export.h b/tools/editor/editor_import_export.h index 93086f7ad4..940a41bafd 100644 --- a/tools/editor/editor_import_export.h +++ b/tools/editor/editor_import_export.h @@ -33,6 +33,7 @@ #include "scene/main/node.h" #include "scene/resources/texture.h" + class EditorExportPlatform; class FileAccess; class EditorProgress; @@ -107,8 +108,17 @@ protected: }; + struct ZipData { + + void* zip; + EditorProgress *ep; + int count; + + }; + void gen_export_flags(Vector<String> &r_flags, int p_flags); static Error save_pack_file(void *p_userdata,const String& p_path, const Vector<uint8_t>& p_data,int p_file,int p_total); + static Error save_zip_file(void *p_userdata,const String& p_path, const Vector<uint8_t>& p_data,int p_file,int p_total); public: @@ -134,6 +144,8 @@ public: Error export_project_files(EditorExportSaveFunction p_func, void* p_udata,bool p_make_bundles); Error save_pack(FileAccess *p_where, bool p_make_bundles=false, int p_alignment = 1); + Error save_zip(const String& p_path, bool p_make_bundles=false); + virtual String get_name() const =0; virtual ImageCompression get_image_compression() const=0; virtual Ref<Texture> get_logo() const =0; diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 35404b0bba..3dbca760f0 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -1816,7 +1816,7 @@ void EditorNode::_run(bool p_current,const String& p_custom) { } play_button->set_pressed(false); - play_button->set_icon(gui_base->get_icon("Play","EditorIcons")); + play_button->set_icon(gui_base->get_icon("MainPlay","EditorIcons")); //pause_button->set_pressed(false); play_scene_button->set_pressed(false); play_scene_button->set_icon(gui_base->get_icon("PlayScene","EditorIcons")); @@ -2688,7 +2688,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { editor_run.stop(); play_button->set_pressed(false); - play_button->set_icon(gui_base->get_icon("Play","EditorIcons")); + play_button->set_icon(gui_base->get_icon("MainPlay","EditorIcons")); play_scene_button->set_pressed(false); play_scene_button->set_icon(gui_base->get_icon("PlayScene","EditorIcons")); //pause_button->set_pressed(false); diff --git a/tools/editor/project_export.cpp b/tools/editor/project_export.cpp index b288439b74..29f9918e26 100644 --- a/tools/editor/project_export.cpp +++ b/tools/editor/project_export.cpp @@ -471,20 +471,32 @@ void ProjectExportDialog::_export_action_pck(const String& p_file) { ERR_PRINT("Invalid platform for export of PCK"); return; } - FileAccess *f = FileAccess::open(p_file,FileAccess::WRITE); - if (!f) { - error->set_text("Error exporting project PCK! Can't write"); - error->popup_centered_minsize(); - } - ERR_FAIL_COND(!f); - Error err = exporter->save_pack(f,false); - memdelete(f); + if (p_file.ends_with(".pck")) { + FileAccess *f = FileAccess::open(p_file,FileAccess::WRITE); + if (!f) { + error->set_text("Error exporting project PCK! Can't write"); + error->popup_centered_minsize(); + } + ERR_FAIL_COND(!f); - if (err!=OK) { - error->set_text("Error exporting project!"); - error->popup_centered_minsize(); - return; + Error err = exporter->save_pack(f,false); + memdelete(f); + + if (err!=OK) { + error->set_text("Error exporting project!"); + error->popup_centered_minsize(); + return; + } + } else if (p_file.ends_with(".zip")) { + + Error err = exporter->save_zip(p_file,false); + + if (err!=OK) { + error->set_text("Error exporting project!"); + error->popup_centered_minsize(); + return; + } } } @@ -1395,7 +1407,7 @@ ProjectExportDialog::ProjectExportDialog(EditorNode *p_editor) { add_child(confirm); confirm->connect("confirmed",this,"_confirmed"); - get_ok()->set_text("Export PCK"); + get_ok()->set_text("Export PCK/Zip"); expopt="--,Export,Bundle"; @@ -1425,6 +1437,7 @@ ProjectExportDialog::ProjectExportDialog(EditorNode *p_editor) { pck_export->set_title("Export Project PCK"); pck_export->connect("file_selected", this,"_export_action_pck"); pck_export->add_filter("*.pck ; Data Pack"); + pck_export->add_filter("*.zip ; Zip"); add_child(pck_export); button_export = add_button("Export..",!OS::get_singleton()->get_swap_ok_cancel(),"export_pck"); diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp index 0a06d78255..9fb623022b 100644 --- a/tools/editor/property_editor.cpp +++ b/tools/editor/property_editor.cpp @@ -89,13 +89,23 @@ void CustomPropertyEditor::_menu_option(int p_which) { case OBJ_MENU_LOAD: { file->set_mode(EditorFileDialog::MODE_OPEN_FILE); - List<String> extensions; String type=(hint==PROPERTY_HINT_RESOURCE_TYPE)?hint_text:String(); - ResourceLoader::get_recognized_extensions_for_type(type,&extensions); - file->clear_filters(); + List<String> extensions; + for (int i=0;i<type.get_slice_count(",");i++) { + + ResourceLoader::get_recognized_extensions_for_type(type.get_slice(",",i),&extensions); + } + + Set<String> valid_extensions; for (List<String>::Element *E=extensions.front();E;E=E->next()) { + valid_extensions.insert(E->get()); + } + + file->clear_filters(); + for (Set<String>::Element *E=valid_extensions.front();E;E=E->next()) { + file->add_filter("*."+E->get()+" ; "+E->get().to_upper() ); } diff --git a/tools/editor/script_editor_debugger.cpp b/tools/editor/script_editor_debugger.cpp index 1247760a55..d0bf4faf02 100644 --- a/tools/editor/script_editor_debugger.cpp +++ b/tools/editor/script_editor_debugger.cpp @@ -570,8 +570,7 @@ void ScriptEditorDebugger::_notification(int p_what) { ppeer->set_stream_peer(connection); - if (!always_visible) - show(); + show(); dobreak->set_disabled(false); tabs->set_current_tab(0); @@ -1460,7 +1459,6 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor){ add_child(msgdialog); hide(); - always_visible=false; log_forced_visible=false; p_editor->get_undo_redo()->set_method_notify_callback(_method_changeds,this); diff --git a/tools/editor/script_editor_debugger.h b/tools/editor/script_editor_debugger.h index 906714d13c..43666b37d5 100644 --- a/tools/editor/script_editor_debugger.h +++ b/tools/editor/script_editor_debugger.h @@ -81,7 +81,6 @@ class ScriptEditorDebugger : public Control { TabContainer *tabs; Label *reason; - bool always_visible; bool log_forced_visible; ScriptEditorDebuggerVariables *variables; diff --git a/tools/editor/spatial_editor_gizmos.cpp b/tools/editor/spatial_editor_gizmos.cpp index 5efca44c7d..04a6b1b437 100644 --- a/tools/editor/spatial_editor_gizmos.cpp +++ b/tools/editor/spatial_editor_gizmos.cpp @@ -2283,6 +2283,8 @@ void NavigationMeshSpatialGizmo::redraw() { } } + if (faces.empty()) + return; Map<_EdgeKey,bool> edge_map; DVector<Vector3> tmeshfaces; @@ -2330,7 +2332,7 @@ void NavigationMeshSpatialGizmo::redraw() { } } - Ref<TriangleMesh> tmesh = memnew( TriangleMesh); + Ref<TriangleMesh> tmesh = memnew( TriangleMesh ); tmesh->create(tmeshfaces); if (lines.size()) |