mirror of
https://github.com/huderlem/porymap.git
synced 2026-09-07 08:25:20 -05:00
Fix metatile label bug while saving
The metatile label only saved when the text field lost focus. But saving doesn't cause the lineEdit to lose focus. This forces a check whenever the tileset is saved.
This commit is contained in:
@@ -95,6 +95,7 @@ private:
|
||||
void importTilesetTiles(Tileset*, bool);
|
||||
void importTilesetMetatiles(Tileset*, bool);
|
||||
void refresh();
|
||||
void saveMetatileLabel();
|
||||
Ui::TilesetEditor *ui;
|
||||
History<MetatileHistoryItem*> metatileHistory;
|
||||
TilesetEditorMetatileSelector *metatileSelector = nullptr;
|
||||
|
||||
@@ -318,6 +318,11 @@ void TilesetEditor::on_comboBox_metatileBehaviors_activated(const QString &metat
|
||||
}
|
||||
|
||||
void TilesetEditor::on_lineEdit_metatileLabel_editingFinished()
|
||||
{
|
||||
saveMetatileLabel();
|
||||
}
|
||||
|
||||
void TilesetEditor::saveMetatileLabel()
|
||||
{
|
||||
if (this->metatile) {
|
||||
Metatile *prevMetatile = this->metatile->copy();
|
||||
@@ -339,6 +344,12 @@ void TilesetEditor::on_comboBox_layerType_activated(int layerType)
|
||||
|
||||
void TilesetEditor::on_actionSave_Tileset_triggered()
|
||||
{
|
||||
if (this->metatile) {
|
||||
if (this->metatile->label != this->ui->lineEdit_metatileLabel->text()) {
|
||||
saveMetatileLabel();
|
||||
}
|
||||
}
|
||||
|
||||
this->project->saveTilesets(this->primaryTileset, this->secondaryTileset);
|
||||
emit this->tilesetsSaved(this->primaryTileset->name, this->secondaryTileset->name);
|
||||
if (this->paletteEditor) {
|
||||
|
||||
Reference in New Issue
Block a user