From 0e6432c20d52ffbad99faf0c1708b92b6064b5b6 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 25 Jan 2023 22:57:24 -0500 Subject: [PATCH 1/4] Update changelog for tileset fix --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 92438d65..3d016080 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ The **"Breaking Changes"** listed below are changes that have been made in the d ## [Unreleased] ### Fixed +- Fix tilesets that share part of their name loading incorrectly. - Fix events being hidden behind connecting maps. - Fix some minor visual issues on the Connections tab. From f34aec824e081220f5b734abd315abcb04a2bae9 Mon Sep 17 00:00:00 2001 From: garakmon Date: Sun, 5 Feb 2023 10:57:55 -0500 Subject: [PATCH 2/4] fix map item render when collision tab is active --- src/editor.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/editor.cpp b/src/editor.cpp index 2b8f0b50..e6afe75f 100644 --- a/src/editor.cpp +++ b/src/editor.cpp @@ -112,6 +112,8 @@ void Editor::setEditingCollision() { } if (map_item) { map_item->paintingMode = MapPixmapItem::PaintMode::Metatiles; + map_item->draw(); + map_item->setVisible(true); } if (events_group) { events_group->setVisible(false); From 940e7355d0391c1906a0d310260b2a9fccafdc48 Mon Sep 17 00:00:00 2001 From: garakmon Date: Sun, 5 Feb 2023 14:48:40 -0500 Subject: [PATCH 3/4] fix crash resulting from deleting encounter fields with groups present --- src/editor.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/editor.cpp b/src/editor.cpp index e6afe75f..3f5b2e1a 100644 --- a/src/editor.cpp +++ b/src/editor.cpp @@ -470,7 +470,7 @@ void Editor::configureEncounterJSON(QWidget *window) { QVBoxLayout *slotChoiceLayout = new QVBoxLayout; if (useGroups) { QComboBox *groupCombo = new QComboBox; - connect(groupCombo, QOverload::of(&QComboBox::textActivated), [&tempFields, ¤tField, index](QString newGroupName) { + connect(groupCombo, QOverload::of(&QComboBox::textActivated), [&tempFields, ¤tField, &updateTotal, index](QString newGroupName) { for (EncounterField &field : tempFields) { if (field.name == currentField.name) { for (auto groupNameIterator : field.groups) { @@ -487,6 +487,7 @@ void Editor::configureEncounterJSON(QWidget *window) { break; } } + updateTotal(currentField); }); for (auto groupNameIterator : currentField.groups) { groupCombo->addItem(groupNameIterator.first); @@ -544,6 +545,12 @@ void Editor::configureEncounterJSON(QWidget *window) { delete slot; } + if (!tempFields.size()) { + return; + } + if (index >= tempFields.size()) { + index = tempFields.size() - 1; + } EncounterField ¤tField = tempFields[index]; for (int i = 0; i < currentField.encounterRates.size(); i++) { grid.addWidget(createNewSlot(i, currentField), i / 4 + 1, i % 4); @@ -604,10 +611,15 @@ void Editor::configureEncounterJSON(QWidget *window) { removeSlotButton->setFlat(true); connect(removeSlotButton, &QPushButton::clicked, [&fieldChoices, &drawSlotWidgets, &tempFields]() { EncounterField &field = tempFields[fieldChoices->currentIndex()]; - if (field.encounterRates.size() > 1) + int lastIndex = field.encounterRates.size() - 1; + if (lastIndex > 0) field.encounterRates.removeLast(); + for (auto &g : field.groups) { + field.groups[g.first].removeAll(lastIndex); + } drawSlotWidgets(fieldChoices->currentIndex()); }); + // TODO: method for editing groups? QFrame firstRow; QHBoxLayout firstRowLayout; From c6e44075600591f33952b804389872643071ce8c Mon Sep 17 00:00:00 2001 From: garakmon Date: Sun, 5 Feb 2023 14:51:12 -0500 Subject: [PATCH 4/4] update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d016080..81997fe5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,9 @@ The **"Breaking Changes"** listed below are changes that have been made in the d - Fix tilesets that share part of their name loading incorrectly. - Fix events being hidden behind connecting maps. - Fix some minor visual issues on the Connections tab. +- Fix bug which caused encounter configurator to crash if slots in fields containing groups were deleted. +- Fix bug which caused encounter configurator to crash if last field was deleted. +- Fix map render when collision view was active while map changed. ## [5.1.0] - 2023-01-22 ### Added