Fix changing tilesets not marking layouts as unsaved

This commit is contained in:
GriffinR
2025-03-02 19:23:19 -05:00
parent 87193158ae
commit 7cfd9fa0f8
4 changed files with 15 additions and 4 deletions

View File

@@ -339,7 +339,7 @@ void MainWindow::initEditor() {
connect(this->editor, &Editor::openConnectedMap, this, &MainWindow::onOpenConnectedMap);
connect(this->editor, &Editor::warpEventDoubleClicked, this, &MainWindow::openWarpMap);
connect(this->editor, &Editor::currentMetatilesSelectionChanged, this, &MainWindow::currentMetatilesSelectionChanged);
connect(this->editor, &Editor::wildMonTableEdited, [this] { this->markMapEdited(); });
connect(this->editor, &Editor::wildMonTableEdited, this, &MainWindow::markMapEdited);
connect(this->editor, &Editor::mapRulerStatusChanged, this, &MainWindow::onMapRulerStatusChanged);
connect(this->editor, &Editor::tilesetUpdated, this, &Scripting::cb_TilesetUpdated);
connect(ui->newEventToolButton, &NewEventToolButton::newEventAdded, this->editor, &Editor::addNewEvent);
@@ -512,6 +512,15 @@ void MainWindow::markSpecificMapEdited(Map* map) {
updateMapList();
}
void MainWindow::markLayoutEdited() {
if (!this->editor->layout)
return;
this->editor->layout->hasUnsavedDataChanges = true;
updateWindowTitle();
updateMapList();
}
void MainWindow::loadUserSettings() {
// Better Cursors
ui->actionBetter_Cursors->setChecked(porymapConfig.prettyCursors);
@@ -2585,7 +2594,7 @@ void MainWindow::on_comboBox_PrimaryTileset_currentTextChanged(const QString &ti
redrawMapScene();
updateTilesetEditor();
prefab.updatePrefabUi(editor->layout);
markMapEdited();
markLayoutEdited();
}
}
@@ -2596,7 +2605,7 @@ void MainWindow::on_comboBox_SecondaryTileset_currentTextChanged(const QString &
redrawMapScene();
updateTilesetEditor();
prefab.updatePrefabUi(editor->layout);
markMapEdited();
markLayoutEdited();
}
}