From 84087a6e2d9edbbca950abc5bc4215bea4e050e3 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sat, 17 May 2025 23:27:53 -0500 Subject: [PATCH] [jasper/gfx/studio] Use type specific navigateTo functions --- .../worldobjectseteditor-imgui.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/jasper/modules/world/src/studio/worldobjectseteditor/worldobjectseteditor-imgui.cpp b/src/jasper/modules/world/src/studio/worldobjectseteditor/worldobjectseteditor-imgui.cpp index 28681a8..5618264 100644 --- a/src/jasper/modules/world/src/studio/worldobjectseteditor/worldobjectseteditor-imgui.cpp +++ b/src/jasper/modules/world/src/studio/worldobjectseteditor/worldobjectseteditor-imgui.cpp @@ -6,6 +6,8 @@ #include +#include + #include "commands/addobject.hpp" #include "commands/rmobject.hpp" #include "commands/editobject.hpp" @@ -271,7 +273,7 @@ void WorldObjectSetEditorImGui::drawSubSheetNode(ngfx::TileSheet::SubSheet const m_doc, m_selectedObj, ss.id, static_cast(ss.subsheets.size())); } if (ImGui::IsItemHovered() && ImGui::IsMouseDoubleClicked(ImGuiMouseButton_Left)) { - studio::navigateTo(m_sctx, m_tilesheetPath, ox::intToStr(ss.id)); + ngfx::navigateToTileSheet(m_sctx, m_tilesheetPath, ss.id); } for (auto const&child : ss.subsheets) { drawSubSheetNode(child); @@ -283,7 +285,7 @@ void WorldObjectSetEditorImGui::drawSubSheetNode(ngfx::TileSheet::SubSheet const m_doc, m_selectedObj, ss.id, static_cast(ss.subsheets.size())); } if (ImGui::IsItemHovered() && ImGui::IsMouseDoubleClicked(ImGuiMouseButton_Left)) { - studio::navigateTo(m_sctx, m_tilesheetPath, ox::intToStr(ss.id)); + ngfx::navigateToTileSheet(m_sctx, m_tilesheetPath, ss.id); } } } else if (ImGui::TreeNodeEx(ss.name.c_str(), ImGuiTreeNodeFlags_Leaf | selected)) { @@ -291,7 +293,7 @@ void WorldObjectSetEditorImGui::drawSubSheetNode(ngfx::TileSheet::SubSheet const std::ignore = pushCommand(m_doc, m_selectedObj, ss.id, static_cast(1)); } if (ImGui::IsItemHovered() && ImGui::IsMouseDoubleClicked(ImGuiMouseButton_Left)) { - studio::navigateTo(m_sctx, m_tilesheetPath, ox::intToStr(ss.id)); + ngfx::navigateToTileSheet(m_sctx, m_tilesheetPath, ss.id); } ImGui::TreePop(); } @@ -336,7 +338,7 @@ void WorldObjectSetEditorImGui::drawPaletteListItems() noexcept { if (ImGui::IsItemHovered() && ImGui::IsMouseDoubleClicked(ImGuiMouseButton_Left)) { auto const [p, err] = m_doc.palettes[i].getPath(); if (!err) { - studio::navigateTo(m_sctx, p); + ngfx::navigateToPalette(m_sctx, p); } } ++i;