diff options
-rw-r--r-- | core/io/resource_format_binary.cpp | 3 | ||||
-rw-r--r-- | core/io/resource_format_xml.cpp | 4 | ||||
-rw-r--r-- | core/print_string.cpp | 2 | ||||
-rw-r--r-- | drivers/gles2/shader_gles2.h | 5 | ||||
-rw-r--r-- | main/main.cpp | 2 | ||||
-rw-r--r-- | scene/gui/line_edit.cpp | 2 | ||||
-rw-r--r-- | scene/resources/packed_scene.cpp | 10 | ||||
-rw-r--r-- | scene/resources/packed_scene.h | 1 | ||||
-rw-r--r-- | scene/resources/scene_format_text.cpp | 7 | ||||
-rw-r--r-- | tools/editor/editor_data.cpp | 4 | ||||
-rw-r--r-- | tools/editor/editor_import_export.cpp | 9 | ||||
-rw-r--r-- | tools/editor/editor_node.cpp | 13 | ||||
-rw-r--r-- | tools/editor/plugins/canvas_item_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | tools/editor/plugins/spatial_editor_plugin.cpp | 4 | ||||
-rw-r--r-- | tools/editor/project_export.cpp | 1 |
15 files changed, 59 insertions, 10 deletions
diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp index 796dcde3d0..c008c3f9a4 100644 --- a/core/io/resource_format_binary.cpp +++ b/core/io/resource_format_binary.cpp @@ -725,7 +725,8 @@ Error ResourceInteractiveLoaderBinary::poll(){ } } else { - path=res_path; + if (!ResourceCache::has(res_path)) + path=res_path; } uint64_t offset = internal_resources[s].offset; diff --git a/core/io/resource_format_xml.cpp b/core/io/resource_format_xml.cpp index 74813d24fa..8c8d79948a 100644 --- a/core/io/resource_format_xml.cpp +++ b/core/io/resource_format_xml.cpp @@ -1570,7 +1570,9 @@ Error ResourceInteractiveLoaderXML::poll() { if (main) { f->close(); resource=res; - resource->set_path(res_path); + if (!ResourceCache::has(res_path)) { + resource->set_path(res_path); + } error=ERR_FILE_EOF; return error; diff --git a/core/print_string.cpp b/core/print_string.cpp index 37760a66ca..e364388b7b 100644 --- a/core/print_string.cpp +++ b/core/print_string.cpp @@ -66,7 +66,7 @@ void remove_print_handler(PrintHandlerList *p_handler) { l=l->next; } - OS::get_singleton()->print("print hanlder list is %p\n",print_handler_list); + OS::get_singleton()->print("print handler list is %p\n",print_handler_list); ERR_FAIL_COND(l==NULL); _global_unlock(); diff --git a/drivers/gles2/shader_gles2.h b/drivers/gles2/shader_gles2.h index 51520cc9da..68ae8af63f 100644 --- a/drivers/gles2/shader_gles2.h +++ b/drivers/gles2/shader_gles2.h @@ -205,6 +205,11 @@ private: Plane val=p_value; glUniform4f( p_uniform, val.normal.x,val.normal.y,val.normal.z,val.d ); } break; + case Variant::QUAT: { + + Quat val=p_value; + glUniform4f( p_uniform, val.x,val.y,val.z,val.w ); + } break; case Variant::MATRIX32: { diff --git a/main/main.cpp b/main/main.cpp index f9bf406724..8319c415fc 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -1374,7 +1374,7 @@ bool Main::start() { } else if (res->is_type("Script")) { Ref<Script> s = res; StringName ibt = s->get_instance_base_type(); - bool valid_type = !ObjectTypeDB::is_type(ibt,"Node"); + bool valid_type = ObjectTypeDB::is_type(ibt,"Node"); ERR_EXPLAIN("Script does not inherit a Node: "+path); ERR_CONTINUE( !valid_type ); diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 49ea077a30..fdced3f62f 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -330,6 +330,8 @@ void LineEdit::_input_event(InputEvent p_event) { append_at_cursor(ucodestr); emit_signal("text_changed",text); _change_notify("text"); + + accept_event(); } } else { diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp index d2795bddb8..03127620f7 100644 --- a/scene/resources/packed_scene.cpp +++ b/scene/resources/packed_scene.cpp @@ -1597,6 +1597,16 @@ Node *PackedScene::instance(bool p_gen_edit_state) const { return s; } +void PackedScene::replace_state(Ref<SceneState> p_by) { + + state=p_by; + state->set_path(get_path()); +#ifdef TOOLS_ENABLED + state->set_last_modified_time(get_last_modified_time()); +#endif + +} + void PackedScene::recreate_state() { state = Ref<SceneState>( memnew( SceneState )); diff --git a/scene/resources/packed_scene.h b/scene/resources/packed_scene.h index 415357b61f..00a812f16a 100644 --- a/scene/resources/packed_scene.h +++ b/scene/resources/packed_scene.h @@ -198,6 +198,7 @@ public: Node *instance(bool p_gen_edit_state=false) const; void recreate_state(); + void replace_state(Ref<SceneState> p_by); virtual void set_path(const String& p_path,bool p_take_over=false); #ifdef TOOLS_ENABLED diff --git a/scene/resources/scene_format_text.cpp b/scene/resources/scene_format_text.cpp index 2552f682fa..5450b9e2ac 100644 --- a/scene/resources/scene_format_text.cpp +++ b/scene/resources/scene_format_text.cpp @@ -302,6 +302,10 @@ Error ResourceInteractiveLoaderText::poll() { if (error) { if (error!=ERR_FILE_EOF) { _printerr(); + } else { + if (!ResourceCache::has(res_path)) { + resource->set_path(res_path); + } } return error; } @@ -403,6 +407,9 @@ Error ResourceInteractiveLoaderText::poll() { _printerr(); } else { resource=packed_scene; + if (!ResourceCache::has(res_path)) { + packed_scene->set_path(res_path); + } } return error; } diff --git a/tools/editor/editor_data.cpp b/tools/editor/editor_data.cpp index d79c1ff466..5e613c658b 100644 --- a/tools/editor/editor_data.cpp +++ b/tools/editor/editor_data.cpp @@ -499,8 +499,8 @@ void EditorData::remove_scene(int p_idx){ bool EditorData::_find_updated_instances(Node* p_root,Node *p_node,Set<String> &checked_paths) { - if (p_root!=p_node && p_node->get_owner()!=p_root && !p_root->is_editable_instance(p_node->get_owner())) - return false; +// if (p_root!=p_node && p_node->get_owner()!=p_root && !p_root->is_editable_instance(p_node->get_owner())) +// return false; Ref<SceneState> ss; diff --git a/tools/editor/editor_import_export.cpp b/tools/editor/editor_import_export.cpp index fde3d4e278..5203ace125 100644 --- a/tools/editor/editor_import_export.cpp +++ b/tools/editor/editor_import_export.cpp @@ -1849,6 +1849,15 @@ void EditorImportExport::load_config() { if (cf->has_section("convert_samples")) { + if (cf->has_section_key("convert_samples","action")) { + String action = cf->get_value("convert_samples","action"); + if (action=="none") { + sample_action=SAMPLE_ACTION_NONE; + } else if (action=="compress_ram") { + sample_action=SAMPLE_ACTION_COMPRESS_RAM; + } + } + if (cf->has_section_key("convert_samples","max_hz")) sample_action_max_hz=cf->get_value("convert_samples","max_hz"); diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 9258637a74..6008021b16 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -3623,7 +3623,18 @@ Error EditorNode::load_scene(const String& p_scene, bool p_ignore_broken_deps,bo add_io_error(txt); } - sdata->set_path(lpath,true); //take over path + if (ResourceCache::has(lpath)) { + //used from somewhere else? no problem! update state and replace sdata + Ref<PackedScene> ps = Ref<PackedScene>( ResourceCache::get(lpath)->cast_to<PackedScene>() ); + if (ps.is_valid()) { + ps->replace_state( sdata->get_state() ); + ps->set_last_modified_time( sdata->get_last_modified_time() ); + sdata=ps; + } + + } else { + sdata->set_path(lpath,true); //take over path + } Node*new_scene=sdata->instance(true); diff --git a/tools/editor/plugins/canvas_item_editor_plugin.cpp b/tools/editor/plugins/canvas_item_editor_plugin.cpp index 56ed95fb16..2eaf017d08 100644 --- a/tools/editor/plugins/canvas_item_editor_plugin.cpp +++ b/tools/editor/plugins/canvas_item_editor_plugin.cpp @@ -194,7 +194,7 @@ void CanvasItemEditor::_edit_set_pivot(const Vector2& mouse_pos) { void CanvasItemEditor::_unhandled_key_input(const InputEvent& p_ev) { - if (!is_visible()) + if (!is_visible() || window_has_modal_stack()) return; if (p_ev.key.mod.control) // prevent to change tool mode when control key is pressed diff --git a/tools/editor/plugins/spatial_editor_plugin.cpp b/tools/editor/plugins/spatial_editor_plugin.cpp index 29d2a7774c..e47dcbf30f 100644 --- a/tools/editor/plugins/spatial_editor_plugin.cpp +++ b/tools/editor/plugins/spatial_editor_plugin.cpp @@ -3529,10 +3529,10 @@ void SpatialEditor::_instance_scene() { void SpatialEditor::_unhandled_key_input(InputEvent p_event) { - if (!is_visible()) + if (!is_visible() || window_has_modal_stack()) return; - { + { EditorNode *en = editor; EditorPlugin *over_plugin = en->get_editor_plugin_over(); diff --git a/tools/editor/project_export.cpp b/tools/editor/project_export.cpp index d034edc80d..7690d31e7b 100644 --- a/tools/editor/project_export.cpp +++ b/tools/editor/project_export.cpp @@ -258,6 +258,7 @@ void ProjectExportDialog::_sample_convert_edited(int what) { EditorImportExport::get_singleton()->sample_set_action( EditorImportExport::SampleAction(sample_mode->get_selected())); EditorImportExport::get_singleton()->sample_set_max_hz( sample_max_hz->get_val() ); EditorImportExport::get_singleton()->sample_set_trim( sample_trim->is_pressed() ); + _save_export_cfg(); } |