From 2f93caff14e3d3c7b46e725439ae59d6c6dbbfed Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 19 Oct 2022 00:33:53 -0400 Subject: [PATCH] Fix metatile behaviors with no constant not displaying --- CHANGELOG.md | 1 + src/ui/tileseteditor.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9cdaa53e..6d143652 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/ui/tileseteditor.cpp b/src/ui/tileseteditor.cpp index 71afc11e..474e363f 100644 --- a/src/ui/tileseteditor.cpp +++ b/src/ui/tileseteditor.cpp @@ -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));