[nostalgia,studio] Add ability to navigate from tile sheet to palette color
All checks were successful
Build / build (push) Successful in 1m52s

This commit is contained in:
2025-02-20 23:20:43 -06:00
parent a2e41e6527
commit 03d4a5736e
8 changed files with 46 additions and 1 deletions

View File

@ -18,6 +18,10 @@
namespace studio {
ox::Error navigateTo(StudioContext &ctx, ox::StringViewCR filePath, ox::StringViewCR args) noexcept {
return ctx.ui.navigateTo(filePath, args);
}
namespace ig {
extern bool s_mainWinHasFocus;
}
@ -107,6 +111,12 @@ void StudioUI::handleKeyEvent(turbine::Key const key, bool const down) noexcept
}
}
ox::Error StudioUI::navigateTo(ox::StringViewCR path, ox::StringViewCR navArgs) noexcept {
OX_RETURN_ERROR(openFile(path));
m_activeEditor->navigateTo(navArgs);
return {};
}
void StudioUI::draw() noexcept {
glutils::clearScreen();
drawMenu();

View File

@ -68,6 +68,8 @@ class StudioUI: public ox::SignalHandler {
void handleKeyEvent(turbine::Key, bool down) noexcept;
ox::Error navigateTo(ox::StringViewCR path, ox::StringViewCR navArgs = {}) noexcept;
[[nodiscard]]
constexpr Project *project() noexcept {
return m_project.get();

View File

@ -27,4 +27,6 @@ inline keel::Context &keelCtx(StudioContext &ctx) noexcept {
return keelCtx(ctx.tctx);
}
ox::Error navigateTo(StudioContext &ctx, ox::StringViewCR filePath, ox::StringViewCR args) noexcept;
}

View File

@ -99,6 +99,8 @@ class BaseEditor: public Widget {
[[nodiscard]]
virtual UndoStack *undoStack() noexcept;
virtual void navigateTo(ox::StringViewCR arg) noexcept;
void setRequiresConstantRefresh(bool value) noexcept;
// signals

View File

@ -106,6 +106,8 @@ UndoStack *BaseEditor::undoStack() noexcept {
return nullptr;
}
void BaseEditor::navigateTo(ox::StringViewCR) noexcept {}
Editor::Editor(StudioContext &ctx, ox::StringParam itemPath) noexcept:
m_itemPath(std::move(itemPath)),