From 1f9a836da9cacd00bfe7b38e09abcb7ea913db5f Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 27 Mar 2025 13:07:13 -0400 Subject: [PATCH] Fix regression for appending new tilesets, add missing tooltip --- forms/newtilesetdialog.ui | 6 +++++- src/project.cpp | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/forms/newtilesetdialog.ui b/forms/newtilesetdialog.ui index 13996c73..66c701cd 100644 --- a/forms/newtilesetdialog.ui +++ b/forms/newtilesetdialog.ui @@ -91,7 +91,11 @@ - + + + <html><head/><body><p>If enabled, the metatiles in the new tileset will be filled alternately with tile 1 or tile 2. If not enabled, all the metatiles will be filled with tile 0.</p></body></html> + + diff --git a/src/project.cpp b/src/project.cpp index ce7be8cb..bc2156ce 100644 --- a/src/project.cpp +++ b/src/project.cpp @@ -1464,12 +1464,13 @@ Tileset *Project::createNewTileset(QString name, bool secondary, bool checkerboa // Update tileset label arrays QStringList *labelList = tileset->is_secondary ? &this->secondaryTilesetLabels : &this->primaryTilesetLabels; - for (int i = 0; i < labelList->length(); i++) { + int i = 0; + for (; i < labelList->length(); i++) { if (labelList->at(i) > tileset->name) { - labelList->insert(i, tileset->name); break; } } + labelList->insert(i, tileset->name); this->tilesetLabelsOrdered.append(tileset->name); // TODO: Ideally we wouldn't save new Tilesets immediately