Allow number values in the Metatile Behavior field
This commit is contained in:
parent
fa859a691f
commit
f0c793424c
3 changed files with 19 additions and 4 deletions
|
@ -42,6 +42,7 @@ The **"Breaking Changes"** listed below are changes that have been made in the d
|
|||
- The heal location prefixes `SPAWN_` and `HEAL_LOCATION_` may now be used interchangeably.
|
||||
- The number and order of entries in the heal location data tables can now be changed arbitrarily, and independently of each other.
|
||||
- The metatile behavior is now displayed in the bottom bar mouseover text.
|
||||
- Number values are now allowed in the Tileset Editor's Metatile Behavior field.
|
||||
- Removed some unnecessary error logs from the scripting API and added new useful ones.
|
||||
- If any JSON data is the incorrect type Porymap will now attempt to convert it.
|
||||
|
||||
|
@ -62,7 +63,6 @@ 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.
|
||||
- Fix incorrect limits on Floor Number and Border Width/Height in the New Map Options window.
|
||||
- Fix Border Width/Height being set to 0 when creating a new map from an existing layout.
|
||||
- Fix certain UI elements not highlighting red on some platforms.
|
||||
|
|
|
@ -85,7 +85,7 @@ private slots:
|
|||
|
||||
void on_actionRedo_triggered();
|
||||
|
||||
void on_comboBox_metatileBehaviors_textActivated(const QString &arg1);
|
||||
void on_comboBox_metatileBehaviors_currentTextChanged(const QString &arg1);
|
||||
|
||||
void on_lineEdit_metatileLabel_editingFinished();
|
||||
|
||||
|
|
|
@ -497,11 +497,26 @@ void TilesetEditor::on_checkBox_yFlip_stateChanged(int checked)
|
|||
this->metatileLayersItem->clearLastModifiedCoords();
|
||||
}
|
||||
|
||||
void TilesetEditor::on_comboBox_metatileBehaviors_textActivated(const QString &metatileBehavior)
|
||||
void TilesetEditor::on_comboBox_metatileBehaviors_currentTextChanged(const QString &metatileBehavior)
|
||||
{
|
||||
if (this->metatile) {
|
||||
int behavior;
|
||||
if (project->metatileBehaviorMap.contains(metatileBehavior)) {
|
||||
behavior = project->metatileBehaviorMap[metatileBehavior];
|
||||
} else {
|
||||
// Check if user has entered a number value instead
|
||||
bool ok;
|
||||
behavior = metatileBehavior.toInt(&ok, 0);
|
||||
if (!ok) return;
|
||||
}
|
||||
|
||||
// This function can also be called when the user selects
|
||||
// a different metatile. Stop this from being considered a change.
|
||||
if (this->metatile->behavior == static_cast<uint16_t>(behavior))
|
||||
return;
|
||||
|
||||
Metatile *prevMetatile = new Metatile(*this->metatile);
|
||||
this->metatile->behavior = static_cast<uint16_t>(project->metatileBehaviorMap[metatileBehavior]);
|
||||
this->metatile->behavior = behavior;
|
||||
MetatileHistoryItem *commit = new MetatileHistoryItem(this->getSelectedMetatileId(),
|
||||
prevMetatile, new Metatile(*this->metatile));
|
||||
metatileHistory.push(commit);
|
||||
|
|
Loading…
Reference in a new issue