mirror of
https://github.com/huderlem/porymap.git
synced 2026-06-22 07:39:48 -05:00
Fix changing tilesets not marking layouts as unsaved
This commit is contained in:
parent
87193158ae
commit
7cfd9fa0f8
|
|
@ -25,6 +25,7 @@ public:
|
|||
|
||||
|
||||
bool loaded = false;
|
||||
bool hasUnsavedDataChanges = false;
|
||||
|
||||
QString id;
|
||||
QString name;
|
||||
|
|
|
|||
|
|
@ -200,6 +200,7 @@ private slots:
|
|||
void applyUserShortcuts();
|
||||
void markMapEdited();
|
||||
void markSpecificMapEdited(Map*);
|
||||
void markLayoutEdited();
|
||||
|
||||
void on_actionNew_Tileset_triggered();
|
||||
void on_action_Save_triggered();
|
||||
|
|
|
|||
|
|
@ -438,5 +438,5 @@ QPixmap Layout::getLayoutItemPixmap() {
|
|||
}
|
||||
|
||||
bool Layout::hasUnsavedChanges() const {
|
||||
return !this->editHistory.isClean() || !this->newFolderPath.isEmpty();
|
||||
return !this->editHistory.isClean() || this->hasUnsavedDataChanges || !this->newFolderPath.isEmpty();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user