diff --git a/CHANGELOG.md b/CHANGELOG.md index 5043ac9b..13aae036 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,7 @@ The **"Breaking Changes"** listed below are changes that have been made in the d - The heal location prefixes `SPAWN_` and `HEAL_LOCATION_` may now be used interchangeably. - The number and order of entries in the heal location data tables can now be changed arbitrarily, and independently of each other. - The metatile behavior is now displayed in the bottom bar mouseover text. +- Number values are now allowed in the Tileset Editor's Metatile Behavior field. - Removed some unnecessary error logs from the scripting API and added new useful ones. - If any JSON data is the incorrect type Porymap will now attempt to convert it. @@ -62,11 +63,11 @@ The **"Breaking Changes"** listed below are changes that have been made in the d - Fix drawing large amounts of text with the scripting API causing a significant drop in performance. - Silence unnecessary error logging when parsing C defines Porymap doesn't use. - Fix some windows like the Tileset Editor not raising to the front when reactivated. -- Metatile behaviors with no constant will now display their value in the Tileset Editor. - Fix incorrect limits on Floor Number and Border Width/Height in the New Map Options window. - Fix Border Width/Height being set to 0 when creating a new map from an existing layout. - Fix certain UI elements not highlighting red on some platforms. - Fix Open Config Folder not responding +- Properly update the minimum offset for a connection when the map is changed. ## [4.5.0] - 2021-12-26 ### Added diff --git a/include/ui/eventframes.h b/include/ui/eventframes.h index a85a8f08..942b9179 100644 --- a/include/ui/eventframes.h +++ b/include/ui/eventframes.h @@ -67,10 +67,6 @@ public: ObjectFrame(ObjectEvent *object, QWidget *parent = nullptr) : EventFrame(object, parent), object(object) {} - virtual ~ObjectFrame() { - delete this->scriptCompleter; - } - virtual void setup() override; virtual void initialize() override; virtual void connectSignals() override; @@ -148,10 +144,6 @@ public: TriggerFrame(TriggerEvent *trigger, QWidget *parent = nullptr) : EventFrame(trigger, parent), trigger(trigger) {} - virtual ~TriggerFrame() { - delete this->scriptCompleter; - } - virtual void setup() override; virtual void initialize() override; virtual void connectSignals() override; @@ -198,10 +190,6 @@ public: SignFrame(SignEvent *sign, QWidget *parent = nullptr) : EventFrame(sign, parent), sign(sign) {} - virtual ~SignFrame() { - delete this->scriptCompleter; - } - virtual void setup() override; virtual void initialize() override; virtual void connectSignals() override; diff --git a/src/core/tileset.cpp b/src/core/tileset.cpp index 4b31e22e..49b3f1f1 100644 --- a/src/core/tileset.cpp +++ b/src/core/tileset.cpp @@ -18,12 +18,15 @@ Tileset::Tileset(const Tileset &other) metatile_attrs_label(other.metatile_attrs_label), metatile_attrs_path(other.metatile_attrs_path), tilesImagePath(other.tilesImagePath), - tilesImage(other.tilesImage), + tilesImage(other.tilesImage.copy()), palettePaths(other.palettePaths), - tiles(other.tiles), palettes(other.palettes), palettePreviews(other.palettePreviews) { + for (auto tile : other.tiles) { + tiles.append(tile.copy()); + } + for (auto *metatile : other.metatiles) { metatiles.append(new Metatile(*metatile)); } @@ -39,12 +42,16 @@ Tileset &Tileset::operator=(const Tileset &other) { metatile_attrs_label = other.metatile_attrs_label; metatile_attrs_path = other.metatile_attrs_path; tilesImagePath = other.tilesImagePath; - tilesImage = other.tilesImage; + tilesImage = other.tilesImage.copy(); palettePaths = other.palettePaths; - tiles = other.tiles; palettes = other.palettes; palettePreviews = other.palettePreviews; + tiles.clear(); + for (auto tile : other.tiles) { + tiles.append(tile.copy()); + } + metatiles.clear(); for (auto *metatile : other.metatiles) { metatiles.append(new Metatile(*metatile)); diff --git a/src/editor.cpp b/src/editor.cpp index 69a501b5..21873fd7 100644 --- a/src/editor.cpp +++ b/src/editor.cpp @@ -1753,6 +1753,12 @@ void Editor::setConnectionMap(QString mapName) { setConnectionEditControlsEnabled(true); selected_connection_item->connection->map_name = mapName; setCurrentConnectionDirection(selected_connection_item->connection->direction); + + // New map may have a different minimum offset than the last one. The maximum will be the same. + int min = selected_connection_item->getMinOffset(); + ui->spinBox_ConnectionOffset->setMinimum(min); + onConnectionOffsetChanged(qMax(min, selected_connection_item->connection->offset)); + updateMirroredConnectionMap(selected_connection_item->connection, originalMapName); maskNonVisibleConnectionTiles(); } diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 135b819f..5e64fcfc 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -610,6 +610,7 @@ void MainWindow::on_action_Reload_Project_triggered() { warning.setText("WARNING"); warning.setInformativeText("Reloading this project will discard any unsaved changes."); warning.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel); + warning.setDefaultButton(QMessageBox::Cancel); warning.setIcon(QMessageBox::Warning); if (warning.exec() == QMessageBox::Ok) { diff --git a/src/project.cpp b/src/project.cpp index 764340ab..76955169 100644 --- a/src/project.cpp +++ b/src/project.cpp @@ -69,6 +69,7 @@ void Project::initSignals() { notice.setInformativeText(QString("The file %1 has changed on disk. Would you like to reload the project?") .arg(changed.remove(this->root + "/"))); notice.setStandardButtons(QMessageBox::No | QMessageBox::Yes); + notice.setDefaultButton(QMessageBox::No); notice.setIcon(QMessageBox::Question); QCheckBox showAgainCheck("Do not ask again."); diff --git a/src/ui/newmappopup.cpp b/src/ui/newmappopup.cpp index 9965e7d3..85f74235 100644 --- a/src/ui/newmappopup.cpp +++ b/src/ui/newmappopup.cpp @@ -42,6 +42,8 @@ void NewMapPopup::init() { ui->spinBox_NewMap_Height->setMaximum(project->getMaxMapHeight()); ui->spinBox_NewMap_BorderWidth->setMinimum(1); ui->spinBox_NewMap_BorderHeight->setMinimum(1); + ui->spinBox_NewMap_BorderWidth->setMaximum(MAX_BORDER_WIDTH); + ui->spinBox_NewMap_BorderHeight->setMaximum(MAX_BORDER_HEIGHT); ui->spinBox_NewMap_Floor_Number->setMinimum(-128); ui->spinBox_NewMap_Floor_Number->setMaximum(127);