diff --git a/CHANGELOG.md b/CHANGELOG.md index 41fe7e4d..2352b6f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,11 +41,13 @@ and this project somewhat adheres to [Semantic Versioning](https://semver.org/sp - Fix events being dragged in negative coordinates lagging behind the cursor. - Fix the shortcut for duplicating events working while on the Connections tab. - Fix the Shortcuts Editor displaying the duplicate shortcut prompt repeatedly. -- Fix clear text button on the left in each row of the Shortcuts Editor also clearing the shortcut on the right. +- Fix the clear text button on the left in each row of the Shortcuts Editor also clearing the shortcut on the right. - Fix Undo/Redo ignoring the automatic resizing that occurs if a layout/border was an unexpected size. - Fix Undo/Redo in the Tileset and Palette Editors and Paste in the Tileset Editor appearing enabled even when they don't do anything. - Fix `Ctrl+Shift+Z` not being set as a default shortcut for Redo in the Palette Editor like it is for other windows. - Fix the Tileset Editor's status bar not updating while selecting tiles in the metatile layer view. +- Fix cleared metatile labels not updating until the project is reloaded. +- Fix some changes in the Tileset Editor being discarded if the window is closed too quickly. - Fix the Region Map Editor incorrectly displaying whether a `MAPSEC` has region map data. - Fix the Primary/Secondary Tileset selectors allowing invalid text, and considering a map unsaved if changed to invalid text then back again. - Fix broken error message for the primary tileset on the new map/layout dialogs. diff --git a/src/project.cpp b/src/project.cpp index 3746e04f..af2bf0c2 100644 --- a/src/project.cpp +++ b/src/project.cpp @@ -1701,6 +1701,7 @@ void Project::loadTilesetMetatileLabels(Tileset* tileset) { QString metatileLabelPrefix = tileset->getMetatileLabelPrefix(); // Reverse map for faster lookup by metatile id + tileset->metatileLabels.clear(); for (auto it = this->metatileLabelsMap[tileset->name].constBegin(); it != this->metatileLabelsMap[tileset->name].constEnd(); it++) { QString labelName = it.key(); tileset->metatileLabels[it.value()] = labelName.replace(metatileLabelPrefix, ""); diff --git a/src/ui/tileseteditor.cpp b/src/ui/tileseteditor.cpp index 7aa8b5b2..50189112 100644 --- a/src/ui/tileseteditor.cpp +++ b/src/ui/tileseteditor.cpp @@ -840,6 +840,11 @@ void TilesetEditor::importTilesetTiles(Tileset *tileset) { void TilesetEditor::closeEvent(QCloseEvent *event) { + // If focus is still on any input widgets, a user may have made changes + // but the widget hasn't had a chance to fire the 'editingFinished' signal. + // Make sure they lose focus before we close so that changes aren't missed. + setFocus(); + if (this->hasUnsavedChanges) { auto result = SaveChangesMessage::show(QStringLiteral("Tileset"), this); if (result == QMessageBox::Yes) {