| 825 | } |
| 826 | |
| 827 | void EditorUI::onFileContentItemClicked(EditorFileNode* node) |
| 828 | { |
| 829 | if (node->m_file_type != "object") |
| 830 | return; |
| 831 | |
| 832 | std::shared_ptr<Level> level = g_runtime_global_context.m_world_manager->getCurrentActiveLevel().lock(); |
| 833 | if (level == nullptr) |
| 834 | return; |
| 835 | |
| 836 | const unsigned int new_object_index = ++m_new_object_index_map[node->m_file_name]; |
| 837 | |
| 838 | ObjectInstanceRes new_object_instance_res; |
| 839 | new_object_instance_res.m_name = |
| 840 | "New_" + Path::getFilePureName(node->m_file_name) + "_" + std::to_string(new_object_index); |
| 841 | new_object_instance_res.m_definition = |
| 842 | g_runtime_global_context.m_asset_manager->getFullPath(node->m_file_path).generic_string(); |
| 843 | |
| 844 | size_t new_gobject_id = level->createObject(new_object_instance_res); |
| 845 | if (new_gobject_id != k_invalid_gobject_id) |
| 846 | { |
| 847 | g_editor_global_context.m_scene_manager->onGObjectSelected(new_gobject_id); |
| 848 | } |
| 849 | } |
| 850 | |
| 851 | inline void windowContentScaleUpdate(float scale) |
| 852 | { |
nothing calls this directly
no test coverage detected