[nostalgia/core/studio/tilesheeteditor] Fix palette drop target to only take palettes

This commit is contained in:
Gary Talent 2025-01-19 16:49:31 -06:00
parent 1567a6e29d
commit 16c32273ac

View File

@ -445,7 +445,7 @@ void TileSheetEditorImGui::drawPaletteMenu() noexcept {
} }
if (ig::DragDropTarget const dragDropTarget; dragDropTarget) { if (ig::DragDropTarget const dragDropTarget; dragDropTarget) {
auto const [ref, err] = ig::getDragDropPayload<studio::FileRef>("FileRef"); auto const [ref, err] = ig::getDragDropPayload<studio::FileRef>("FileRef");
if (!err) { if (!err && endsWith(ref.path, FileExt_npal)) {
auto const oldVal = m_selectedPaletteIdx; auto const oldVal = m_selectedPaletteIdx;
std::ignore = ox::findIdx(files.begin(), files.end(), ref.path).moveTo(m_selectedPaletteIdx); std::ignore = ox::findIdx(files.begin(), files.end(), ref.path).moveTo(m_selectedPaletteIdx);
if (oldVal != m_selectedPaletteIdx) { if (oldVal != m_selectedPaletteIdx) {