[jasper/world] Fix WorldObjectSetEditor to handle .ng and .nts file extensions
All checks were successful
Build / build (push) Successful in 1m45s

This commit is contained in:
2025-06-25 21:31:28 -05:00
parent 43efcbf59f
commit d98d78890a

View File

@ -32,7 +32,7 @@ WorldObjectSetEditorImGui::WorldObjectSetEditorImGui(
m_doc{*readObj<WorldObjectSet>(keelCtx(m_sctx), itemPath()).unwrapThrow()}, m_doc{*readObj<WorldObjectSet>(keelCtx(m_sctx), itemPath()).unwrapThrow()},
m_tileSheet{readObj<ngfx::TileSheet>(keelCtx(m_sctx), m_doc.tilesheet) m_tileSheet{readObj<ngfx::TileSheet>(keelCtx(m_sctx), m_doc.tilesheet)
.or_value(keel::AssetRef<ngfx::TileSheet>{})}, .or_value(keel::AssetRef<ngfx::TileSheet>{})},
m_tsPicker{"Tile Sheet Chooser", keelCtx(m_sctx), ngfx::FileExt_nts}, m_tsPicker{"Tile Sheet Chooser", keelCtx(m_sctx), ngfx::FileExts_TileSheet},
m_addPalPopup{"Palette Chooser", keelCtx(m_sctx), ngfx::FileExt_npal} { m_addPalPopup{"Palette Chooser", keelCtx(m_sctx), ngfx::FileExt_npal} {
auto &kctx = keelCtx(m_sctx); auto &kctx = keelCtx(m_sctx);
auto const [tsPath, err] = getPath(kctx, m_doc.tilesheet); auto const [tsPath, err] = getPath(kctx, m_doc.tilesheet);
@ -114,7 +114,7 @@ void WorldObjectSetEditorImGui::drawTileSheetSelector() noexcept {
ig::InputTextWithHint("##Tile Sheet", "Path to Tile Sheet", m_tilesheetPath, tsFlags); ig::InputTextWithHint("##Tile Sheet", "Path to Tile Sheet", m_tilesheetPath, tsFlags);
if (ig::DragDropTarget const d; d) { if (ig::DragDropTarget const d; d) {
auto const [fr, err] = ig::getDragDropPayload<studio::FileRef>("FileRef"); auto const [fr, err] = ig::getDragDropPayload<studio::FileRef>("FileRef");
if (!err && endsWith(fr.path, ngfx::FileExt_ng)) { if (!err && ngfx::isTileSheet(fr.path)) {
oxLogError(setTileSheet(fr.path)); oxLogError(setTileSheet(fr.path));
} }
} }