[jasper/gfx/studio] Use type specific navigateTo functions
All checks were successful
Build / build (push) Successful in 1m29s

This commit is contained in:
Gary Talent 2025-05-17 23:27:53 -05:00
parent ebef57a28b
commit 84087a6e2d

View File

@ -6,6 +6,8 @@
#include <studio/imguiutil.hpp>
#include <nostalgia/gfx/studio.hpp>
#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<uint8_t>(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<uint8_t>(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<EditObjectSubSheet>(m_doc, m_selectedObj, ss.id, static_cast<uint8_t>(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;