fix region map entries save bug where NONE map section was being saved in array

This commit is contained in:
garak 2019-08-18 22:33:36 -04:00 committed by huderlem
parent 60e68116c4
commit 9e7ce82f45
3 changed files with 6 additions and 2 deletions

View file

@ -185,7 +185,7 @@ void RegionMap::saveLayout() {
}
for (auto sec : project->mapSectionNameToValue.keys()) {
if (!mapSecToMapEntry.contains(sec)) continue;
if (!mapSecToMapEntry.contains(sec) || sec == "MAPSEC_NONE") continue;
RegionMapEntry entry = mapSecToMapEntry.value(sec);
entries_text += " [" + sec + QString("]%1= {").arg(QString(" ").repeated(1 + longest - sec.length()))
+ QString::number(entry.x) + ", " + QString::number(entry.y) + ", "

View file

@ -1418,6 +1418,7 @@ void MainWindow::updateSelectedObjects() {
combo->setToolTip("The trainer type of this event object.\n"
"If it is not a trainer, use NONE. SEE ALL DIRECTIONS\n"
"should only be used with a sight radius of 1.");
combo->setMinimumContentsLength(10);
int index = combo->findData(value);
if (index != -1) {
@ -1499,15 +1500,18 @@ void MainWindow::updateSelectedObjects() {
combo->setToolTip("The maximum number of metatiles this object\n"
"is allowed to move left or right during its\n"
"normal movement behavior actions.");
combo->setMinimumContentsLength(4);
} else if (key == "radius_y") {
combo->setToolTip("The maximum number of metatiles this object\n"
"is allowed to move up or down during its\n"
"normal movement behavior actions.");
combo->setMinimumContentsLength(4);
} else if (key == "script_label") {
combo->setToolTip("The script which is executed with this event.");
} else if (key == "sight_radius_tree_id") {
combo->setToolTip("The maximum sight range of a trainer,\n"
"OR the unique id of the berry tree.");
combo->setMinimumContentsLength(4);
} else {
combo->addItem(value);
}

View file

@ -9,7 +9,7 @@ NoScrollComboBox::NoScrollComboBox(QWidget *parent)
setFocusPolicy(Qt::StrongFocus);
// Make speed a priority when loading comboboxes.
setMinimumContentsLength(20);// an arbitrary limit
setMinimumContentsLength(24);// an arbitrary limit
setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLength);
// Allow items to be searched by any part of the word, displaying all matches.