/* * Copyright 2016 - 2023 Gary Talent (gary@drinkingtea.net). All rights reserved. */ #include #include "paletteeditor-imgui.hpp" #include "tilesheeteditor-imgui.hpp" #include "studiomodule.hpp" namespace nostalgia::core { class StudioModule: public studio::Module { public: ox::Vector editors(turbine::Context *ctx) const noexcept override; ox::Vector> itemMakers(turbine::Context*) const noexcept override; }; ox::Vector StudioModule::editors(turbine::Context *ctx) const noexcept { return { { {FileExt_ng}, [ctx](ox::CRStringView path) -> ox::Result { try { return ox::make(ctx, path); } catch (const ox::Exception &ex) { return ex.toError(); } } }, { {FileExt_npal}, [ctx](ox::CRStringView path) -> ox::Result { return PaletteEditorImGui::make(ctx, path); } } }; } ox::Vector> StudioModule::itemMakers(turbine::Context*) const noexcept { ox::Vector> out; out.emplace_back(ox::make>("Tile Sheet", "TileSheets", "ng")); out.emplace_back(ox::make>("Palette", "Palettes", "npal")); return out; } static StudioModule mod; const studio::Module *studioModule() noexcept { return &mod; } }