Fix metatile behaviors with no constant not displaying

This commit is contained in:
GriffinR 2022-10-19 00:33:53 -04:00
parent 2425b0e7c7
commit 2f93caff14
2 changed files with 8 additions and 1 deletions

View file

@ -58,6 +58,7 @@ The **"Breaking Changes"** listed below are changes that have been made in the d
- Fix drawing large amounts of text with the scripting API causing a significant drop in performance.
- Silence unnecessary error logging when parsing C defines Porymap doesn't use.
- Fix some windows like the Tileset Editor not raising to the front when reactivated.
- Metatile behaviors with no constant will now display their value in the Tileset Editor.
## [4.5.0] - 2021-12-26
### Added

View file

@ -353,7 +353,13 @@ void TilesetEditor::onSelectedMetatileChanged(uint16_t metatileId) {
this->metatileLayersItem->setMetatile(metatile);
this->metatileLayersItem->draw();
this->ui->graphicsView_metatileLayers->setFixedSize(this->metatileLayersItem->pixmap().width() + 2, this->metatileLayersItem->pixmap().height() + 2);
this->ui->comboBox_metatileBehaviors->setCurrentIndex(this->ui->comboBox_metatileBehaviors->findData(this->metatile->behavior));
int index = this->ui->comboBox_metatileBehaviors->findData(this->metatile->behavior);
if (index != -1)
this->ui->comboBox_metatileBehaviors->setCurrentIndex(index);
else
this->ui->comboBox_metatileBehaviors->setCurrentText(QString::number(this->metatile->behavior));
this->ui->lineEdit_metatileLabel->setText(this->metatile->label);
if (!projectConfig.getTripleLayerMetatilesEnabled()) {
this->ui->comboBox_layerType->setCurrentIndex(this->ui->comboBox_layerType->findData(this->metatile->layerType));