43 lines
1.0 KiB
C++

/*
* Copyright 2016 - 2022 Gary Talent (gary@drinkingtea.net). All rights reserved.
*/
#include <ox/std/memory.hpp>
#include "paletteeditor-imgui.hpp"
#include "tilesheeteditor-imgui.hpp"
#include "module.hpp"
namespace nostalgia::core {
ox::Vector<studio::EditorMaker> Module::editors(core::Context *ctx) noexcept {
return {
{
{"ng"},
[ctx](ox::CRStringView path) -> ox::Result<studio::BaseEditor*> {
try {
return ox::make<TileSheetEditorImGui>(ctx, path);
} catch (const ox::Exception &ex) {
return ex.toError();
}
}
},
{
{"npal"},
[ctx](ox::CRStringView path) -> ox::Result<studio::BaseEditor*> {
return PaletteEditorImGui::make(ctx, path);
}
}
};
}
ox::Vector<ox::UniquePtr<studio::ItemMaker>> Module::itemMakers(core::Context*) noexcept {
ox::Vector<ox::UniquePtr<studio::ItemMaker>> out;
out.emplace_back(ox::make<studio::ItemMakerT<core::TileSheet>>("Tile Sheet", "TileSheets", "ng"));
out.emplace_back(ox::make<studio::ItemMakerT<core::Palette>>("Palette", "Palettes", "npal"));
return out;
}
}