diff --git a/src/jasper/modules/world/src/studio/worldeditor/objectexplorer-imgui.cpp b/src/jasper/modules/world/src/studio/worldeditor/objectexplorer-imgui.cpp index 7f8822c..ebfbf12 100644 --- a/src/jasper/modules/world/src/studio/worldeditor/objectexplorer-imgui.cpp +++ b/src/jasper/modules/world/src/studio/worldeditor/objectexplorer-imgui.cpp @@ -8,9 +8,9 @@ namespace studio { -ObjectExplorerModel::ObjectExplorerModel(ox::StringView name, ObjectExplorerModel *parent) noexcept: +ObjectExplorerModel::ObjectExplorerModel(ox::StringParam name, ObjectExplorerModel *parent) noexcept: m_parent(parent), - m_name(name), + m_name(std::move(name)), m_fullPath(m_parent ? (m_parent->m_fullPath + "/" + m_name) : ox::String{}) { } diff --git a/src/jasper/modules/world/src/studio/worldeditor/objectexplorer-imgui.hpp b/src/jasper/modules/world/src/studio/worldeditor/objectexplorer-imgui.hpp index 8e2ea26..a1e37da 100644 --- a/src/jasper/modules/world/src/studio/worldeditor/objectexplorer-imgui.hpp +++ b/src/jasper/modules/world/src/studio/worldeditor/objectexplorer-imgui.hpp @@ -15,7 +15,7 @@ class ObjectExplorerModel { ox::String m_fullPath; ox::Vector> m_children; public: - explicit ObjectExplorerModel(ox::StringView name, ObjectExplorerModel *parent = {}) noexcept; + explicit ObjectExplorerModel(ox::StringParam name, ObjectExplorerModel *parent = {}) noexcept; void draw(turbine::Context &ctx) const noexcept; private: }; diff --git a/src/jasper/modules/world/src/studio/worldeditor/worldeditor-imgui.cpp b/src/jasper/modules/world/src/studio/worldeditor/worldeditor-imgui.cpp index 177637b..0d6cc70 100644 --- a/src/jasper/modules/world/src/studio/worldeditor/worldeditor-imgui.cpp +++ b/src/jasper/modules/world/src/studio/worldeditor/worldeditor-imgui.cpp @@ -201,6 +201,12 @@ void WorldEditorImGui::drawObjSetSelector() noexcept { } return setName; }, m_doc.objSets.size(), m_palMgr.selectedIdx); + if (ig::DragDropTarget const d; d) { + auto const [fr, err] = ig::getDragDropPayload("FileRef"); + if (!err && endsWith(fr.path, FileExt_jwob)) { + std::ignore = addObjSet(fr.path); + } + } } void WorldEditorImGui::drawObjSelector() noexcept { @@ -386,7 +392,7 @@ ox::Error WorldEditorImGui::handleDrop(float const fbPaneScale) noexcept { ox::Error WorldEditorImGui::addObjSet(ox::StringViewCR path) noexcept { OX_REQUIRE(uuid, getUuid(keelCtx(m_sctx), path)); std::ignore = pushCommand(m_doc, uuid); - return {}; + return loadObjectSets(); } void WorldEditorImGui::rmObjSet() noexcept {