Track unsaved changes to metatile attributes and labels

This commit is contained in:
GriffinR 2020-07-01 17:18:27 -04:00 committed by huderlem
parent a92d0eb006
commit 016c65448e

View file

@ -380,6 +380,7 @@ void TilesetEditor::on_comboBox_metatileBehaviors_activated(const QString &metat
this->metatile->behavior = static_cast<uint8_t>(project->metatileBehaviorMap[metatileBehavior]); this->metatile->behavior = static_cast<uint8_t>(project->metatileBehaviorMap[metatileBehavior]);
MetatileHistoryItem *commit = new MetatileHistoryItem(metatileSelector->getSelectedMetatile(), prevMetatile, this->metatile->copy()); MetatileHistoryItem *commit = new MetatileHistoryItem(metatileSelector->getSelectedMetatile(), prevMetatile, this->metatile->copy());
metatileHistory.push(commit); metatileHistory.push(commit);
this->hasUnsavedChanges = true;
} }
} }
@ -396,6 +397,7 @@ void TilesetEditor::saveMetatileLabel()
this->metatile->label = this->ui->lineEdit_metatileLabel->text(); this->metatile->label = this->ui->lineEdit_metatileLabel->text();
MetatileHistoryItem *commit = new MetatileHistoryItem(metatileSelector->getSelectedMetatile(), prevMetatile, this->metatile->copy()); MetatileHistoryItem *commit = new MetatileHistoryItem(metatileSelector->getSelectedMetatile(), prevMetatile, this->metatile->copy());
metatileHistory.push(commit); metatileHistory.push(commit);
this->hasUnsavedChanges = true;
} }
} }
@ -406,6 +408,7 @@ void TilesetEditor::on_comboBox_layerType_activated(int layerType)
this->metatile->layerType = static_cast<uint8_t>(layerType); this->metatile->layerType = static_cast<uint8_t>(layerType);
MetatileHistoryItem *commit = new MetatileHistoryItem(metatileSelector->getSelectedMetatile(), prevMetatile, this->metatile->copy()); MetatileHistoryItem *commit = new MetatileHistoryItem(metatileSelector->getSelectedMetatile(), prevMetatile, this->metatile->copy());
metatileHistory.push(commit); metatileHistory.push(commit);
this->hasUnsavedChanges = true;
} }
} }
@ -416,6 +419,7 @@ void TilesetEditor::on_comboBox_encounterType_activated(int encounterType)
this->metatile->encounterType = static_cast<uint8_t>(encounterType); this->metatile->encounterType = static_cast<uint8_t>(encounterType);
MetatileHistoryItem *commit = new MetatileHistoryItem(metatileSelector->getSelectedMetatile(), prevMetatile, this->metatile->copy()); MetatileHistoryItem *commit = new MetatileHistoryItem(metatileSelector->getSelectedMetatile(), prevMetatile, this->metatile->copy());
metatileHistory.push(commit); metatileHistory.push(commit);
this->hasUnsavedChanges = true;
} }
} }
@ -426,6 +430,7 @@ void TilesetEditor::on_comboBox_terrainType_activated(int terrainType)
this->metatile->terrainType = static_cast<uint8_t>(terrainType); this->metatile->terrainType = static_cast<uint8_t>(terrainType);
MetatileHistoryItem *commit = new MetatileHistoryItem(metatileSelector->getSelectedMetatile(), prevMetatile, this->metatile->copy()); MetatileHistoryItem *commit = new MetatileHistoryItem(metatileSelector->getSelectedMetatile(), prevMetatile, this->metatile->copy());
metatileHistory.push(commit); metatileHistory.push(commit);
this->hasUnsavedChanges = true;
} }
} }