[nostalgia/gfx/studio] Add type specific navigateTo functions
Some checks failed
Build / build (push) Has been cancelled
Some checks failed
Build / build (push) Has been cancelled
This commit is contained in:
parent
0e9a8d7202
commit
ebef57a28b
@ -6,6 +6,27 @@
|
||||
|
||||
#include <studio/studio.hpp>
|
||||
|
||||
namespace nostalgia::core {
|
||||
#include "tilesheet.hpp"
|
||||
|
||||
namespace nostalgia::gfx {
|
||||
|
||||
inline void navigateToTileSheet(studio::Context &ctx, ox::StringViewCR path, SubSheetId subsheetId) noexcept {
|
||||
::studio::navigateTo(ctx, path, ox::intToStr(subsheetId));
|
||||
}
|
||||
|
||||
inline void navigateToPalette(studio::Context &ctx, ox::StringViewCR path) noexcept {
|
||||
::studio::navigateTo(ctx, path);
|
||||
}
|
||||
|
||||
inline void navigateToPalette(
|
||||
studio::Context &ctx,
|
||||
ox::StringViewCR path,
|
||||
size_t const colorIdx,
|
||||
size_t const palPage) noexcept {
|
||||
::studio::navigateTo(
|
||||
ctx,
|
||||
path,
|
||||
ox::sfmt("{};{}", colorIdx, palPage));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -9,6 +9,8 @@
|
||||
#include <keel/media.hpp>
|
||||
#include <studio/studio.hpp>
|
||||
|
||||
#include <nostalgia/gfx/studio.hpp>
|
||||
|
||||
#include "tilesheeteditor-imgui.hpp"
|
||||
|
||||
namespace nostalgia::gfx {
|
||||
@ -570,10 +572,10 @@ void TileSheetEditorImGui::drawPaletteMenu() noexcept {
|
||||
m_view.setPalIdx(i);
|
||||
}
|
||||
if (ImGui::IsItemHovered() && ImGui::IsMouseDoubleClicked(0)) {
|
||||
studio::navigateTo(
|
||||
navigateToPalette(
|
||||
m_sctx,
|
||||
m_model.palPath(),
|
||||
ox::sfmt("{};{}", i, m_model.palettePage()));
|
||||
i, m_model.palettePage());
|
||||
}
|
||||
// Column: color RGB
|
||||
ImGui::TableNextColumn();
|
||||
|
Loading…
x
Reference in New Issue
Block a user