diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/collada/collada.cpp | 12 | ||||
-rw-r--r-- | editor/debugger/script_editor_debugger.cpp | 2 | ||||
-rw-r--r-- | editor/editor_resource_preview.cpp | 8 | ||||
-rw-r--r-- | editor/import/resource_importer_texture.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/script_text_editor.cpp | 18 | ||||
-rw-r--r-- | editor/plugins/script_text_editor.h | 1 | ||||
-rw-r--r-- | editor/plugins/spatial_editor_plugin.cpp | 14 |
7 files changed, 43 insertions, 14 deletions
diff --git a/editor/collada/collada.cpp b/editor/collada/collada.cpp index 231173e459..cf39abdc53 100644 --- a/editor/collada/collada.cpp +++ b/editor/collada/collada.cpp @@ -2194,7 +2194,11 @@ void Collada::_merge_skeletons(VisualScene *p_vscene, Node *p_node) { ERR_CONTINUE(!state.scene_map.has(nodeid)); //weird, it should have it... - NodeJoint *nj = SAFE_CAST<NodeJoint *>(state.scene_map[nodeid]); +#ifdef NO_SAFE_CAST + NodeJoint *nj = static_cast<NodeJoint *>(state.scene_map[nodeid]); +#else + NodeJoint *nj = dynamic_cast<NodeJoint *>(state.scene_map[nodeid]); +#endif ERR_CONTINUE(!nj); //broken collada ERR_CONTINUE(!nj->owner); //weird, node should have a skeleton owner @@ -2366,7 +2370,11 @@ bool Collada::_move_geometry_to_skeletons(VisualScene *p_vscene, Node *p_node, L String nodeid = ng->skeletons[0]; ERR_FAIL_COND_V(!state.scene_map.has(nodeid), false); //weird, it should have it... - NodeJoint *nj = SAFE_CAST<NodeJoint *>(state.scene_map[nodeid]); +#ifdef NO_SAFE_CAST + NodeJoint *nj = static_cast<NodeJoint *>(state.scene_map[nodeid]); +#else + NodeJoint *nj = dynamic_cast<NodeJoint *>(state.scene_map[nodeid]); +#endif ERR_FAIL_COND_V(!nj, false); ERR_FAIL_COND_V(!nj->owner, false); //weird, node should have a skeleton owner diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp index 920f4d858a..3d567ed2b3 100644 --- a/editor/debugger/script_editor_debugger.cpp +++ b/editor/debugger/script_editor_debugger.cpp @@ -1425,7 +1425,7 @@ void ScriptEditorDebugger::_item_menu_id_pressed(int p_option) { void ScriptEditorDebugger::_tab_changed(int p_tab) { if (tabs->get_tab_title(p_tab) == TTR("Video RAM")) { - // "Video RAM" tab was clicked, refresh the data it's dislaying when entering the tab. + // "Video RAM" tab was clicked, refresh the data it's displaying when entering the tab. _video_mem_request(); } } diff --git a/editor/editor_resource_preview.cpp b/editor/editor_resource_preview.cpp index 3c401a6fc7..98bc544478 100644 --- a/editor/editor_resource_preview.cpp +++ b/editor/editor_resource_preview.cpp @@ -109,9 +109,10 @@ void EditorResourcePreview::_thread_func(void *ud) { void EditorResourcePreview::_preview_ready(const String &p_str, const Ref<Texture2D> &p_texture, const Ref<Texture2D> &p_small_texture, ObjectID id, const StringName &p_func, const Variant &p_ud) { - MutexLock lock(preview_mutex); String path = p_str; { + MutexLock lock(preview_mutex); + uint32_t hash = 0; uint64_t modified_time = 0; @@ -364,7 +365,6 @@ void EditorResourcePreview::queue_edited_resource_preview(const Ref<Resource> &p cache[path_id].order = order++; p_receiver->call(p_receiver_func, path_id, cache[path_id].preview, cache[path_id].small_preview, p_userdata); - preview_mutex.unlock(); return; } @@ -391,7 +391,6 @@ void EditorResourcePreview::queue_resource_preview(const String &p_path, Object if (cache.has(p_path)) { cache[p_path].order = order++; p_receiver->call(p_receiver_func, p_path, cache[p_path].preview, cache[p_path].small_preview, p_userdata); - preview_mutex.unlock(); return; } @@ -436,9 +435,10 @@ void EditorResourcePreview::_bind_methods() { void EditorResourcePreview::check_for_invalidation(const String &p_path) { - MutexLock lock(preview_mutex); bool call_invalidated = false; { + MutexLock lock(preview_mutex); + if (cache.has(p_path)) { uint64_t modified_time = FileAccess::get_modified_time(p_path); diff --git a/editor/import/resource_importer_texture.cpp b/editor/import/resource_importer_texture.cpp index 92ecda8508..0090d30b9c 100644 --- a/editor/import/resource_importer_texture.cpp +++ b/editor/import/resource_importer_texture.cpp @@ -350,7 +350,7 @@ void ResourceImporterTexture::_save_stex(const Ref<Image> &p_image, const String f->store_32(flags); f->store_32(p_limit_mipmap); - //reserverd for future use + //reserved for future use f->store_32(0); f->store_32(0); f->store_32(0); diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 02168a4c97..1489ea1e27 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -980,6 +980,23 @@ void ScriptTextEditor::_lookup_symbol(const String &p_symbol, int p_row, int p_c } } +void ScriptTextEditor::_validate_symbol(const String &p_symbol) { + + TextEdit *text_edit = code_editor->get_text_edit(); + + Node *base = get_tree()->get_edited_scene_root(); + if (base) { + base = _find_node_for_script(base, base, script); + } + + ScriptLanguage::LookupResult result; + if (ScriptServer::is_global_class(p_symbol) || p_symbol.is_resource_file() || script->get_language()->lookup_code(code_editor->get_text_edit()->get_text_for_lookup_completion(), p_symbol, script->get_path(), base, result) == OK) { + text_edit->set_highlighted_word(p_symbol); + } else { + text_edit->set_highlighted_word(String()); + } +} + void ScriptTextEditor::update_toggle_scripts_button() { if (code_editor != NULL) { code_editor->update_toggle_scripts_button(); @@ -1769,6 +1786,7 @@ ScriptTextEditor::ScriptTextEditor() { code_editor->set_code_complete_func(_code_complete_scripts, this); code_editor->get_text_edit()->connect("breakpoint_toggled", callable_mp(this, &ScriptTextEditor::_breakpoint_toggled)); code_editor->get_text_edit()->connect("symbol_lookup", callable_mp(this, &ScriptTextEditor::_lookup_symbol)); + code_editor->get_text_edit()->connect("symbol_validate", callable_mp(this, &ScriptTextEditor::_validate_symbol)); code_editor->get_text_edit()->connect("info_clicked", callable_mp(this, &ScriptTextEditor::_lookup_connections)); code_editor->set_v_size_flags(SIZE_EXPAND_FILL); code_editor->show_toggle_scripts_button(); diff --git a/editor/plugins/script_text_editor.h b/editor/plugins/script_text_editor.h index e23160d029..d2f0b310e6 100644 --- a/editor/plugins/script_text_editor.h +++ b/editor/plugins/script_text_editor.h @@ -178,6 +178,7 @@ protected: void _goto_line(int p_line) { goto_line(p_line); } void _lookup_symbol(const String &p_symbol, int p_row, int p_column); + void _validate_symbol(const String &p_symbol); void _lookup_connections(int p_row, String p_method); diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index 647d64c627..a71cb50db4 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -2416,11 +2416,18 @@ void SpatialEditorViewport::_notification(int p_what) { if (!se) continue; + Transform t = sp->get_global_gizmo_transform(); + + exist = true; + if (se->last_xform == t) + continue; + changed = true; + se->last_xform = t; + VisualInstance *vi = Object::cast_to<VisualInstance>(sp); se->aabb = vi ? vi->get_aabb() : _calculate_spatial_bounds(sp); - Transform t = sp->get_global_gizmo_transform(); t.translate(se->aabb.position); // apply AABB scaling before item's global transform @@ -2428,11 +2435,6 @@ void SpatialEditorViewport::_notification(int p_what) { aabb_s.scale(se->aabb.size); t.basis = t.basis * aabb_s; - exist = true; - if (se->last_xform == t) - continue; - changed = true; - se->last_xform = t; VisualServer::get_singleton()->instance_set_transform(se->sbox_instance, t); } |