From 32903e0d18bf808ac85b0cd65879a3b303b6ee8c Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 3 Dec 2022 08:49:08 -0500 Subject: [PATCH] Set default New Map settings when switching projects --- CHANGELOG.md | 3 +++ include/mainwindow.h | 2 +- src/mainwindow.cpp | 5 +++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eed6c36a..50e4bb37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,9 @@ The **"Breaking Changes"** listed below are changes that have been made in the d ### Added - Add `setScale` to the scripting API. +### Fixed +- Fix New Map settings being preserved when switching projects. + ## [5.0.0] - 2022-10-30 ### Breaking Changes - Proper support for pokefirered's clone objects was added, which requires the changes made in [pokefirered/#484](https://github.com/pret/pokefirered/pull/484). diff --git a/include/mainwindow.h b/include/mainwindow.h index 2e110f7f..896034f7 100644 --- a/include/mainwindow.h +++ b/include/mainwindow.h @@ -329,7 +329,7 @@ private: bool isProgrammaticEventTabChange; bool projectHasUnsavedChanges; bool projectOpenFailure = false; - bool openedNewMapDialog = false; + bool newMapDefaultsSet = false; MapSortOrder mapSortOrder; diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index e3ee72c6..3ef1aed9 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -531,6 +531,7 @@ bool MainWindow::openProject(QString dir) { this->closeSupplementaryWindows(); this->setProjectSpecificUIVisibility(); + this->newMapDefaultsSet = false; Scripting::init(this); bool already_open = isProjectOpen() && (editor->project->root == dir); @@ -1193,9 +1194,9 @@ void MainWindow::onNewMapCreated() { } void MainWindow::openNewMapPopupWindow() { - if (!openedNewMapDialog) { + if (!this->newMapDefaultsSet) { NewMapPopup::setDefaultSettings(this->editor->project); - openedNewMapDialog = true; + this->newMapDefaultsSet = true; } if (!this->newMapPrompt) { this->newMapPrompt = new NewMapPopup(this, this->editor->project);