[jasper/world/studio] Use type specific navigateTo functions
All checks were successful
Build / build (push) Successful in 1m28s
All checks were successful
Build / build (push) Successful in 1m28s
This commit is contained in:
parent
ebef57a28b
commit
d10efbdcba
@ -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"
|
||||
@ -243,7 +245,7 @@ void WorldObjectSetEditorImGui::drawObjEditor() noexcept {
|
||||
auto const imageSz = ImVec2{width * scale, height * scale};
|
||||
auto const imagePos = ImGui::GetCursorScreenPos();
|
||||
ImGui::Image(
|
||||
std::bit_cast<void*>(buffId),
|
||||
std::bit_cast<ImTextureID>(buffId),
|
||||
imageSz,
|
||||
{0, 1.0},
|
||||
{horzPct, 1 - vertPct});
|
||||
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user