Set default New Map settings when switching projects

This commit is contained in:
GriffinR 2022-12-03 08:49:08 -05:00
parent 3a4ce68232
commit 32903e0d18
3 changed files with 7 additions and 3 deletions

View file

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

View file

@ -329,7 +329,7 @@ private:
bool isProgrammaticEventTabChange;
bool projectHasUnsavedChanges;
bool projectOpenFailure = false;
bool openedNewMapDialog = false;
bool newMapDefaultsSet = false;
MapSortOrder mapSortOrder;

View file

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