2019-01-07 23:14:44 +00:00
|
|
|
#include "newmappopup.h"
|
|
|
|
#include "maplayout.h"
|
|
|
|
#include "mainwindow.h"
|
|
|
|
#include "ui_newmappopup.h"
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <QMap>
|
|
|
|
#include <QSet>
|
|
|
|
#include <QPalette>
|
|
|
|
#include <QStringList>
|
|
|
|
|
|
|
|
NewMapPopup::NewMapPopup(QWidget *parent, Project *project) :
|
|
|
|
QMainWindow(parent),
|
|
|
|
ui(new Ui::NewMapPopup)
|
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
|
|
|
this->project = project;
|
2019-02-01 17:43:25 +00:00
|
|
|
this->existingLayout = false;
|
2020-09-19 20:05:27 +01:00
|
|
|
this->importedMap = false;
|
2019-01-07 23:14:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
NewMapPopup::~NewMapPopup()
|
|
|
|
{
|
|
|
|
delete ui;
|
|
|
|
}
|
|
|
|
|
2019-02-01 17:43:25 +00:00
|
|
|
void NewMapPopup::init(int type, int group, QString sec, QString layoutId) {
|
2019-01-07 23:14:44 +00:00
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case MapSortOrder::Group:
|
|
|
|
setDefaultValues(group, QString());
|
|
|
|
break;
|
|
|
|
case MapSortOrder::Area:
|
|
|
|
setDefaultValues(group, sec);
|
|
|
|
break;
|
|
|
|
case MapSortOrder::Layout:
|
2019-02-01 17:43:25 +00:00
|
|
|
useLayout(layoutId);
|
2019-01-07 23:14:44 +00:00
|
|
|
setDefaultValues(group, QString());
|
|
|
|
break;
|
|
|
|
}
|
2020-05-17 02:19:36 +01:00
|
|
|
connectSignals();
|
|
|
|
}
|
|
|
|
|
2020-09-19 20:05:27 +01:00
|
|
|
void NewMapPopup::initImportMap(MapLayout *mapLayout) {
|
|
|
|
this->importedMap = true;
|
|
|
|
setDefaultValuesImportMap(mapLayout);
|
|
|
|
connectSignals();
|
|
|
|
}
|
|
|
|
|
2020-05-17 02:19:36 +01:00
|
|
|
bool NewMapPopup::checkNewMapDimensions() {
|
|
|
|
int numMetatiles = project->getMapDataSize(ui->spinBox_NewMap_Width->value(), ui->spinBox_NewMap_Height->value());
|
|
|
|
int maxMetatiles = project->getMaxMapDataSize();
|
|
|
|
|
|
|
|
if (numMetatiles > maxMetatiles) {
|
|
|
|
ui->frame_NewMap_Warning->setVisible(true);
|
2020-05-18 02:10:31 +01:00
|
|
|
//ui->label_NewMap_WarningMessage->setText("WARNING: The specified map dimensions are too large.");
|
|
|
|
QString errorText = QString("Error: The specified width and height are too large.\n"
|
|
|
|
"The maximum map width and height is the following: (width + 15) * (height + 14) <= %1\n"
|
|
|
|
"The specified map width and height was: (%2 + 15) * (%3 + 14) = %4")
|
|
|
|
.arg(maxMetatiles)
|
|
|
|
.arg(ui->spinBox_NewMap_Width->value())
|
|
|
|
.arg(ui->spinBox_NewMap_Height->value())
|
|
|
|
.arg(numMetatiles);
|
|
|
|
ui->label_NewMap_WarningMessage->setText(errorText);
|
|
|
|
ui->label_NewMap_WarningMessage->setWordWrap(true);
|
2020-05-17 02:19:36 +01:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
ui->frame_NewMap_Warning->setVisible(false);
|
|
|
|
ui->label_NewMap_WarningMessage->clear();
|
|
|
|
return true;
|
|
|
|
}
|
2021-02-19 07:15:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool NewMapPopup::checkNewMapGroup() {
|
|
|
|
group = project->groupNames.indexOf(this->ui->comboBox_NewMap_Group->currentText());
|
|
|
|
|
|
|
|
if (group < 0) {
|
|
|
|
ui->frame_NewMap_Warning->setVisible(true);
|
|
|
|
QString errorText = QString("Error: The specified map group '%1' does not exist.")
|
|
|
|
.arg(ui->comboBox_NewMap_Group->currentText());
|
|
|
|
ui->label_NewMap_WarningMessage->setText(errorText);
|
|
|
|
ui->label_NewMap_WarningMessage->setWordWrap(true);
|
|
|
|
return false;
|
|
|
|
} else {
|
|
|
|
ui->frame_NewMap_Warning->setVisible(false);
|
|
|
|
ui->label_NewMap_WarningMessage->clear();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
2020-05-17 02:19:36 +01:00
|
|
|
|
|
|
|
void NewMapPopup::connectSignals() {
|
|
|
|
ui->spinBox_NewMap_Width->setMinimum(1);
|
|
|
|
ui->spinBox_NewMap_Height->setMinimum(1);
|
|
|
|
ui->spinBox_NewMap_Width->setMaximum(project->getMaxMapWidth());
|
|
|
|
ui->spinBox_NewMap_Height->setMaximum(project->getMaxMapHeight());
|
2021-02-19 07:15:49 +00:00
|
|
|
|
2020-05-17 02:19:36 +01:00
|
|
|
//ui->icon_NewMap_WarningIcon->setPixmap();
|
|
|
|
connect(ui->spinBox_NewMap_Width, QOverload<int>::of(&QSpinBox::valueChanged), [=](int){checkNewMapDimensions();});
|
|
|
|
connect(ui->spinBox_NewMap_Height, QOverload<int>::of(&QSpinBox::valueChanged), [=](int){checkNewMapDimensions();});
|
2019-01-07 23:14:44 +00:00
|
|
|
}
|
|
|
|
|
2019-02-01 17:43:25 +00:00
|
|
|
void NewMapPopup::useLayout(QString layoutId) {
|
|
|
|
this->existingLayout = true;
|
|
|
|
this->layoutId = layoutId;
|
2019-01-07 23:14:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void NewMapPopup::setDefaultValues(int groupNum, QString mapSec) {
|
|
|
|
ui->lineEdit_NewMap_Name->setText(project->getNewMapName());
|
|
|
|
|
2022-09-28 01:17:55 +01:00
|
|
|
ui->comboBox_NewMap_Primary_Tileset->addItems(project->tilesetLabels.value("primary"));
|
|
|
|
ui->comboBox_NewMap_Secondary_Tileset->addItems(project->tilesetLabels.value("secondary"));
|
2019-01-07 23:14:44 +00:00
|
|
|
|
2021-02-15 09:21:41 +00:00
|
|
|
ui->comboBox_NewMap_Group->addItems(project->groupNames);
|
|
|
|
ui->comboBox_NewMap_Group->setCurrentText(project->groupNames.at(groupNum));
|
2019-01-07 23:14:44 +00:00
|
|
|
|
2022-01-21 20:22:20 +00:00
|
|
|
ui->comboBox_Song->addItems(project->songNames);
|
2019-01-07 23:14:44 +00:00
|
|
|
|
2019-02-01 17:43:25 +00:00
|
|
|
if (existingLayout) {
|
|
|
|
ui->spinBox_NewMap_Width->setValue(project->mapLayouts.value(layoutId)->width.toInt(nullptr, 0));
|
|
|
|
ui->spinBox_NewMap_Height->setValue(project->mapLayouts.value(layoutId)->height.toInt(nullptr, 0));
|
|
|
|
ui->comboBox_NewMap_Primary_Tileset->setCurrentText(project->mapLayouts.value(layoutId)->tileset_primary_label);
|
|
|
|
ui->comboBox_NewMap_Secondary_Tileset->setCurrentText(project->mapLayouts.value(layoutId)->tileset_secondary_label);
|
2019-01-07 23:14:44 +00:00
|
|
|
ui->spinBox_NewMap_Width->setDisabled(true);
|
|
|
|
ui->spinBox_NewMap_Height->setDisabled(true);
|
2020-03-14 07:44:55 +00:00
|
|
|
ui->spinBox_NewMap_BorderWidth->setDisabled(true);
|
|
|
|
ui->spinBox_NewMap_BorderHeight->setDisabled(true);
|
2019-01-07 23:14:44 +00:00
|
|
|
ui->comboBox_NewMap_Primary_Tileset->setDisabled(true);
|
|
|
|
ui->comboBox_NewMap_Secondary_Tileset->setDisabled(true);
|
|
|
|
} else {
|
2020-05-16 21:57:03 +01:00
|
|
|
ui->spinBox_NewMap_Width->setValue(project->getDefaultMapSize());
|
|
|
|
ui->spinBox_NewMap_Height->setValue(project->getDefaultMapSize());
|
2020-03-14 07:44:55 +00:00
|
|
|
ui->spinBox_NewMap_BorderWidth->setValue(DEFAULT_BORDER_WIDTH);
|
|
|
|
ui->spinBox_NewMap_BorderHeight->setValue(DEFAULT_BORDER_HEIGHT);
|
2019-01-07 23:14:44 +00:00
|
|
|
}
|
|
|
|
|
2021-02-15 16:33:30 +00:00
|
|
|
ui->comboBox_NewMap_Type->addItems(project->mapTypes);
|
2019-02-25 18:31:34 +00:00
|
|
|
ui->comboBox_NewMap_Location->addItems(project->mapSectionValueToName.values());
|
2019-01-07 23:14:44 +00:00
|
|
|
if (!mapSec.isEmpty()) ui->comboBox_NewMap_Location->setCurrentText(mapSec);
|
2020-08-31 15:19:58 +01:00
|
|
|
ui->checkBox_NewMap_Show_Location->setChecked(true);
|
2019-01-07 23:14:44 +00:00
|
|
|
|
|
|
|
ui->frame_NewMap_Options->setEnabled(true);
|
|
|
|
|
2021-07-24 00:20:41 +01:00
|
|
|
setDefaultValuesProjectConfig(false, NULL);
|
2019-01-07 23:14:44 +00:00
|
|
|
}
|
|
|
|
|
2020-09-19 20:05:27 +01:00
|
|
|
void NewMapPopup::setDefaultValuesImportMap(MapLayout *mapLayout) {
|
|
|
|
ui->lineEdit_NewMap_Name->setText(project->getNewMapName());
|
|
|
|
|
2022-09-28 01:17:55 +01:00
|
|
|
ui->comboBox_NewMap_Primary_Tileset->addItems(project->tilesetLabels.value("primary"));
|
|
|
|
ui->comboBox_NewMap_Secondary_Tileset->addItems(project->tilesetLabels.value("secondary"));
|
2020-09-19 20:05:27 +01:00
|
|
|
|
2021-07-24 07:35:56 +01:00
|
|
|
ui->comboBox_NewMap_Group->addItems(project->groupNames);
|
|
|
|
ui->comboBox_NewMap_Group->setCurrentText(project->groupNames.at(0));
|
2020-09-19 20:05:27 +01:00
|
|
|
|
2022-06-19 19:48:02 +01:00
|
|
|
ui->comboBox_Song->addItems(project->songNames);
|
|
|
|
|
2020-09-19 20:05:27 +01:00
|
|
|
ui->spinBox_NewMap_Width->setValue(mapLayout->width.toInt(nullptr, 0));
|
|
|
|
ui->spinBox_NewMap_Height->setValue(mapLayout->height.toInt(nullptr, 0));
|
|
|
|
ui->comboBox_NewMap_Primary_Tileset->setCurrentText(mapLayout->tileset_primary_label);
|
|
|
|
ui->comboBox_NewMap_Secondary_Tileset->setCurrentText(mapLayout->tileset_secondary_label);
|
|
|
|
|
2021-07-24 07:35:56 +01:00
|
|
|
ui->comboBox_NewMap_Type->addItems(project->mapTypes);
|
2020-09-19 20:05:27 +01:00
|
|
|
ui->comboBox_NewMap_Location->addItems(project->mapSectionValueToName.values());
|
|
|
|
ui->checkBox_NewMap_Show_Location->setChecked(true);
|
|
|
|
|
|
|
|
ui->frame_NewMap_Options->setEnabled(true);
|
|
|
|
|
2021-07-24 00:20:41 +01:00
|
|
|
setDefaultValuesProjectConfig(true, mapLayout);
|
|
|
|
|
|
|
|
map = new Map();
|
|
|
|
map->layout = new MapLayout();
|
2021-07-24 07:35:56 +01:00
|
|
|
map->layout->blockdata = mapLayout->blockdata;
|
2021-07-24 00:20:41 +01:00
|
|
|
|
2021-07-24 07:35:56 +01:00
|
|
|
if (!mapLayout->border.isEmpty()) {
|
|
|
|
map->layout->border = mapLayout->border;
|
2021-07-24 00:20:41 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void NewMapPopup::setDefaultValuesProjectConfig(bool importedMap, MapLayout *mapLayout) {
|
2020-09-19 20:05:27 +01:00
|
|
|
switch (projectConfig.getBaseGameVersion())
|
|
|
|
{
|
|
|
|
case BaseGameVersion::pokeruby:
|
|
|
|
ui->checkBox_NewMap_Allow_Running->setVisible(false);
|
|
|
|
ui->checkBox_NewMap_Allow_Biking->setVisible(false);
|
|
|
|
ui->checkBox_NewMap_Allow_Escape_Rope->setVisible(false);
|
|
|
|
ui->label_NewMap_Allow_Running->setVisible(false);
|
|
|
|
ui->label_NewMap_Allow_Biking->setVisible(false);
|
|
|
|
ui->label_NewMap_Allow_Escape_Rope->setVisible(false);
|
|
|
|
break;
|
|
|
|
case BaseGameVersion::pokeemerald:
|
|
|
|
ui->checkBox_NewMap_Allow_Running->setVisible(true);
|
|
|
|
ui->checkBox_NewMap_Allow_Biking->setVisible(true);
|
|
|
|
ui->checkBox_NewMap_Allow_Escape_Rope->setVisible(true);
|
|
|
|
ui->label_NewMap_Allow_Running->setVisible(true);
|
|
|
|
ui->label_NewMap_Allow_Biking->setVisible(true);
|
|
|
|
ui->label_NewMap_Allow_Escape_Rope->setVisible(true);
|
|
|
|
break;
|
|
|
|
case BaseGameVersion::pokefirered:
|
|
|
|
ui->checkBox_NewMap_Allow_Running->setVisible(true);
|
|
|
|
ui->checkBox_NewMap_Allow_Biking->setVisible(true);
|
|
|
|
ui->checkBox_NewMap_Allow_Escape_Rope->setVisible(true);
|
|
|
|
ui->label_NewMap_Allow_Running->setVisible(true);
|
|
|
|
ui->label_NewMap_Allow_Biking->setVisible(true);
|
|
|
|
ui->label_NewMap_Allow_Escape_Rope->setVisible(true);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (projectConfig.getUseCustomBorderSize()) {
|
2021-07-24 00:20:41 +01:00
|
|
|
if (importedMap) {
|
|
|
|
ui->spinBox_NewMap_BorderWidth->setValue(mapLayout->border_width.toInt(nullptr, 0));
|
|
|
|
ui->spinBox_NewMap_BorderHeight->setValue(mapLayout->border_height.toInt(nullptr, 0));
|
|
|
|
}
|
2020-09-19 20:05:27 +01:00
|
|
|
ui->spinBox_NewMap_BorderWidth->setVisible(true);
|
|
|
|
ui->spinBox_NewMap_BorderHeight->setVisible(true);
|
|
|
|
ui->label_NewMap_BorderWidth->setVisible(true);
|
|
|
|
ui->label_NewMap_BorderHeight->setVisible(true);
|
|
|
|
} else {
|
2021-07-24 00:20:41 +01:00
|
|
|
if (importedMap) {
|
|
|
|
ui->spinBox_NewMap_BorderWidth->setValue(DEFAULT_BORDER_WIDTH);
|
|
|
|
ui->spinBox_NewMap_BorderHeight->setValue(DEFAULT_BORDER_HEIGHT);
|
|
|
|
}
|
2020-09-19 20:05:27 +01:00
|
|
|
ui->spinBox_NewMap_BorderWidth->setVisible(false);
|
|
|
|
ui->spinBox_NewMap_BorderHeight->setVisible(false);
|
|
|
|
ui->label_NewMap_BorderWidth->setVisible(false);
|
|
|
|
ui->label_NewMap_BorderHeight->setVisible(false);
|
|
|
|
}
|
|
|
|
if (projectConfig.getFloorNumberEnabled()) {
|
|
|
|
ui->spinBox_NewMap_Floor_Number->setVisible(true);
|
|
|
|
ui->label_NewMap_Floor_Number->setVisible(true);
|
|
|
|
} else {
|
|
|
|
ui->spinBox_NewMap_Floor_Number->setVisible(false);
|
|
|
|
ui->label_NewMap_Floor_Number->setVisible(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-07 23:14:44 +00:00
|
|
|
void NewMapPopup::on_lineEdit_NewMap_Name_textChanged(const QString &text) {
|
2021-02-15 09:21:41 +00:00
|
|
|
if (project->mapNames.contains(text)) {
|
2019-01-07 23:14:44 +00:00
|
|
|
QPalette palette = this->ui->lineEdit_NewMap_Name->palette();
|
|
|
|
QColor color = Qt::red;
|
|
|
|
color.setAlpha(25);
|
|
|
|
palette.setColor(QPalette::Base, color);
|
|
|
|
this->ui->lineEdit_NewMap_Name->setPalette(palette);
|
|
|
|
} else {
|
|
|
|
this->ui->lineEdit_NewMap_Name->setPalette(QPalette());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void NewMapPopup::on_pushButton_NewMap_Accept_clicked() {
|
2021-02-19 07:15:49 +00:00
|
|
|
if (!checkNewMapDimensions() || !checkNewMapGroup()) {
|
|
|
|
// ignore when map dimensions or map group are invalid
|
2020-05-17 02:19:36 +01:00
|
|
|
return;
|
|
|
|
}
|
2019-01-07 23:14:44 +00:00
|
|
|
Map *newMap = new Map;
|
2019-02-01 17:43:25 +00:00
|
|
|
MapLayout *layout;
|
2019-01-07 23:14:44 +00:00
|
|
|
|
|
|
|
// If map name is not unique, use default value. Also use only valid characters.
|
2020-12-05 22:39:02 +00:00
|
|
|
// After stripping invalid characters, strip any leading digits.
|
2019-01-07 23:14:44 +00:00
|
|
|
QString newMapName = this->ui->lineEdit_NewMap_Name->text().remove(QRegularExpression("[^a-zA-Z0-9_]+"));
|
2020-12-05 22:47:51 +00:00
|
|
|
newMapName.remove(QRegularExpression("^[0-9]*"));
|
2021-02-15 09:21:41 +00:00
|
|
|
if (project->mapNames.contains(newMapName) || newMapName.isEmpty()) {
|
2019-01-07 23:14:44 +00:00
|
|
|
newMapName = project->getNewMapName();
|
|
|
|
}
|
|
|
|
|
2019-02-01 17:43:25 +00:00
|
|
|
newMap->name = newMapName;
|
2019-01-07 23:14:44 +00:00
|
|
|
newMap->type = this->ui->comboBox_NewMap_Type->currentText();
|
|
|
|
newMap->location = this->ui->comboBox_NewMap_Location->currentText();
|
2021-03-07 03:19:38 +00:00
|
|
|
newMap->song = this->ui->comboBox_Song->currentText();
|
2019-02-01 17:43:25 +00:00
|
|
|
newMap->requiresFlash = "0";
|
2021-02-15 16:33:30 +00:00
|
|
|
newMap->weather = this->project->weatherNames.value(0, "WEATHER_NONE");
|
2020-08-31 15:19:58 +01:00
|
|
|
newMap->show_location = this->ui->checkBox_NewMap_Show_Location->isChecked() ? "1" : "0";
|
2021-02-15 16:33:30 +00:00
|
|
|
newMap->battle_scene = this->project->mapBattleScenes.value(0, "MAP_BATTLE_SCENE_NORMAL");
|
2019-02-01 17:43:25 +00:00
|
|
|
|
|
|
|
if (this->existingLayout) {
|
|
|
|
layout = this->project->mapLayouts.value(this->layoutId);
|
2021-07-24 00:20:41 +01:00
|
|
|
newMap->needsLayoutDir = false;
|
2019-01-07 23:14:44 +00:00
|
|
|
} else {
|
2019-02-01 17:43:25 +00:00
|
|
|
layout = new MapLayout;
|
|
|
|
layout->id = MapLayout::layoutConstantFromName(newMapName);
|
|
|
|
layout->name = QString("%1_Layout").arg(newMap->name);
|
|
|
|
layout->width = QString::number(this->ui->spinBox_NewMap_Width->value());
|
|
|
|
layout->height = QString::number(this->ui->spinBox_NewMap_Height->value());
|
2020-03-14 07:44:55 +00:00
|
|
|
if (projectConfig.getUseCustomBorderSize()) {
|
|
|
|
layout->border_width = QString::number(this->ui->spinBox_NewMap_BorderWidth->value());
|
|
|
|
layout->border_height = QString::number(this->ui->spinBox_NewMap_BorderHeight->value());
|
|
|
|
} else {
|
|
|
|
layout->border_width = QString::number(DEFAULT_BORDER_WIDTH);
|
|
|
|
layout->border_height = QString::number(DEFAULT_BORDER_HEIGHT);
|
|
|
|
}
|
2019-02-01 17:43:25 +00:00
|
|
|
layout->tileset_primary_label = this->ui->comboBox_NewMap_Primary_Tileset->currentText();
|
|
|
|
layout->tileset_secondary_label = this->ui->comboBox_NewMap_Secondary_Tileset->currentText();
|
2022-09-27 23:06:43 +01:00
|
|
|
QString basePath = projectConfig.getFilePath(ProjectFilePath::data_layouts_folders);
|
|
|
|
layout->border_path = QString("%1%2/border.bin").arg(basePath, newMapName);
|
|
|
|
layout->blockdata_path = QString("%1%2/map.bin").arg(basePath, newMapName);
|
2019-01-07 23:14:44 +00:00
|
|
|
}
|
|
|
|
|
2020-09-19 20:05:27 +01:00
|
|
|
if (this->importedMap) {
|
2021-07-24 07:35:56 +01:00
|
|
|
layout->blockdata = map->layout->blockdata;
|
|
|
|
if (!map->layout->border.isEmpty())
|
|
|
|
layout->border = map->layout->border;
|
2020-09-19 20:05:27 +01:00
|
|
|
}
|
|
|
|
|
2019-01-07 23:14:44 +00:00
|
|
|
if (this->ui->checkBox_NewMap_Flyable->isChecked()) {
|
|
|
|
newMap->isFlyable = "TRUE";
|
|
|
|
}
|
|
|
|
|
2020-05-22 22:51:56 +01:00
|
|
|
if (projectConfig.getBaseGameVersion() != BaseGameVersion::pokeruby) {
|
2020-03-11 05:52:00 +00:00
|
|
|
newMap->allowRunning = this->ui->checkBox_NewMap_Allow_Running->isChecked() ? "1" : "0";
|
|
|
|
newMap->allowBiking = this->ui->checkBox_NewMap_Allow_Biking->isChecked() ? "1" : "0";
|
|
|
|
newMap->allowEscapeRope = this->ui->checkBox_NewMap_Allow_Escape_Rope->isChecked() ? "1" : "0";
|
2020-05-22 22:51:56 +01:00
|
|
|
}
|
|
|
|
if (projectConfig.getFloorNumberEnabled()) {
|
2020-03-11 05:52:00 +00:00
|
|
|
newMap->floorNumber = this->ui->spinBox_NewMap_Floor_Number->value();
|
2019-01-07 23:14:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
newMap->layout = layout;
|
2019-02-01 17:43:25 +00:00
|
|
|
newMap->layoutId = layout->id;
|
2020-02-12 16:22:40 +00:00
|
|
|
if (this->existingLayout) {
|
|
|
|
project->loadMapLayout(newMap);
|
|
|
|
}
|
2019-01-07 23:14:44 +00:00
|
|
|
map = newMap;
|
|
|
|
emit applied();
|
|
|
|
this->close();
|
|
|
|
}
|