Qt: Fix selecting tiles in OBJ-only view (fixes #2497)

This commit is contained in:
Vicki Pfau 2022-04-12 22:19:33 -07:00
parent 7093d083dd
commit 672867f1f6
1 changed files with 14 additions and 1 deletions

View File

@ -25,7 +25,20 @@ TileView::TileView(std::shared_ptr<CoreController> controller, QWidget* parent)
m_ui.setupUi(this);
m_ui.tile->setController(controller);
connect(m_ui.tiles, &TilePainter::indexPressed, m_ui.tile, &AssetTile::selectIndex);
connect(m_ui.tiles, &TilePainter::indexPressed, this, [this](int index) {
if (m_ui.tilesObj->isChecked()) {
switch (m_controller->platform()) {
#ifdef M_CORE_GBA
case mPLATFORM_GBA:
index += 2048 >> m_ui.palette256->isChecked();
break;
#endif
default:
break;
}
}
m_ui.tile->selectIndex(index);
});
connect(m_ui.tiles, &TilePainter::needsRedraw, this, [this]() {
updateTiles(true);
});