Fix regression for appending new tilesets, add missing tooltip

This commit is contained in:
GriffinR 2025-03-27 13:07:13 -04:00
parent 67e2844821
commit 1f9a836da9
2 changed files with 8 additions and 3 deletions

View File

@ -91,7 +91,11 @@
</widget>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="checkBox_CheckerboardFill"/>
<widget class="QCheckBox" name="checkBox_CheckerboardFill">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;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.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<spacer name="verticalSpacer">

View File

@ -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