Simplify new map popup internal
This commit is contained in:
parent
8fbcee7f21
commit
d451aaa8c0
5 changed files with 124 additions and 130 deletions
|
@ -217,7 +217,7 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="10" column="1">
|
<item row="10" column="1">
|
||||||
<widget class="NoScrollComboBox" name="comboBox_Song">
|
<widget class="NoScrollComboBox" name="comboBox_NewMap_Song">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string><html><head/><body><p>The default background music for this map.</p></body></html></string>
|
<string><html><head/><body><p>The default background music for this map.</p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
|
|
|
@ -176,7 +176,7 @@ private slots:
|
||||||
void onMapNeedsRedrawing();
|
void onMapNeedsRedrawing();
|
||||||
void onTilesetsSaved(QString, QString);
|
void onTilesetsSaved(QString, QString);
|
||||||
void onWildMonDataChanged();
|
void onWildMonDataChanged();
|
||||||
void openNewMapPopupWindow(int, QVariant);
|
void openNewMapPopupWindow(MapSortOrder, QVariant);
|
||||||
void openNewMapPopupWindowImportMap(MapLayout *);
|
void openNewMapPopupWindowImportMap(MapLayout *);
|
||||||
void onNewMapCreated();
|
void onNewMapCreated();
|
||||||
void onMapCacheCleared();
|
void onMapCacheCleared();
|
||||||
|
@ -330,6 +330,7 @@ private:
|
||||||
bool isProgrammaticEventTabChange;
|
bool isProgrammaticEventTabChange;
|
||||||
bool projectHasUnsavedChanges;
|
bool projectHasUnsavedChanges;
|
||||||
bool projectOpenFailure = false;
|
bool projectOpenFailure = false;
|
||||||
|
bool openedNewMapDialog = false;
|
||||||
|
|
||||||
MapSortOrder mapSortOrder;
|
MapSortOrder mapSortOrder;
|
||||||
|
|
||||||
|
|
|
@ -22,10 +22,10 @@ public:
|
||||||
bool existingLayout;
|
bool existingLayout;
|
||||||
bool importedMap;
|
bool importedMap;
|
||||||
QString layoutId;
|
QString layoutId;
|
||||||
void init(int, int, QString, QString);
|
void init(MapSortOrder type, QVariant data);
|
||||||
void initImportMap(MapLayout *);
|
void initImportMap(MapLayout *);
|
||||||
void useLayout(QString);
|
|
||||||
void connectSignals();
|
void connectSignals();
|
||||||
|
static void initSettings(Project *project);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void applied();
|
void applied();
|
||||||
|
@ -35,9 +35,30 @@ private:
|
||||||
Project *project;
|
Project *project;
|
||||||
void setDefaultValues(int, QString);
|
void setDefaultValues(int, QString);
|
||||||
void setDefaultValuesImportMap(MapLayout *);
|
void setDefaultValuesImportMap(MapLayout *);
|
||||||
void setDefaultValuesProjectConfig(bool, MapLayout*);
|
void setDefaultValuesProjectConfig();
|
||||||
bool checkNewMapDimensions();
|
bool checkNewMapDimensions();
|
||||||
bool checkNewMapGroup();
|
bool checkNewMapGroup();
|
||||||
|
void populateComboBoxes();
|
||||||
|
|
||||||
|
struct Settings {
|
||||||
|
QString group;
|
||||||
|
int width;
|
||||||
|
int height;
|
||||||
|
int borderWidth;
|
||||||
|
int borderHeight;
|
||||||
|
QString primaryTileset;
|
||||||
|
QString secondaryTileset;
|
||||||
|
QString type;
|
||||||
|
QString location;
|
||||||
|
QString song;
|
||||||
|
bool canFlyTo;
|
||||||
|
bool showLocationName;
|
||||||
|
bool allowRunning;
|
||||||
|
bool allowBiking;
|
||||||
|
bool allowEscaping;
|
||||||
|
int floorNumber;
|
||||||
|
};
|
||||||
|
static struct Settings settings;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void on_pushButton_NewMap_Accept_clicked();
|
void on_pushButton_NewMap_Accept_clicked();
|
||||||
|
|
|
@ -1191,7 +1191,10 @@ void MainWindow::onNewMapCreated() {
|
||||||
delete newMap;
|
delete newMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::openNewMapPopupWindow(int type, QVariant data) {
|
void MainWindow::openNewMapPopupWindow(MapSortOrder type, QVariant data) {
|
||||||
|
if (!openedNewMapDialog) {
|
||||||
|
NewMapPopup::initSettings(this->editor->project);
|
||||||
|
}
|
||||||
if (!this->newMapPrompt) {
|
if (!this->newMapPrompt) {
|
||||||
this->newMapPrompt = new NewMapPopup(this, this->editor->project);
|
this->newMapPrompt = new NewMapPopup(this, this->editor->project);
|
||||||
}
|
}
|
||||||
|
@ -1201,18 +1204,7 @@ void MainWindow::openNewMapPopupWindow(int type, QVariant data) {
|
||||||
this->newMapPrompt->raise();
|
this->newMapPrompt->raise();
|
||||||
this->newMapPrompt->activateWindow();
|
this->newMapPrompt->activateWindow();
|
||||||
}
|
}
|
||||||
switch (type)
|
this->newMapPrompt->init(type, data);
|
||||||
{
|
|
||||||
case MapSortOrder::Group:
|
|
||||||
this->newMapPrompt->init(type, data.toInt(), QString(), QString());
|
|
||||||
break;
|
|
||||||
case MapSortOrder::Area:
|
|
||||||
this->newMapPrompt->init(type, 0, data.toString(), QString());
|
|
||||||
break;
|
|
||||||
case MapSortOrder::Layout:
|
|
||||||
this->newMapPrompt->init(type, 0, QString(), data.toString());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
connect(this->newMapPrompt, &NewMapPopup::applied, this, &MainWindow::onNewMapCreated);
|
connect(this->newMapPrompt, &NewMapPopup::applied, this, &MainWindow::onNewMapCreated);
|
||||||
this->newMapPrompt->setAttribute(Qt::WA_DeleteOnClose);
|
this->newMapPrompt->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,8 @@
|
||||||
#include <QPalette>
|
#include <QPalette>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
|
struct NewMapPopup::Settings NewMapPopup::settings = {};
|
||||||
|
|
||||||
NewMapPopup::NewMapPopup(QWidget *parent, Project *project) :
|
NewMapPopup::NewMapPopup(QWidget *parent, Project *project) :
|
||||||
QMainWindow(parent),
|
QMainWindow(parent),
|
||||||
ui(new Ui::NewMapPopup)
|
ui(new Ui::NewMapPopup)
|
||||||
|
@ -24,36 +26,72 @@ NewMapPopup::~NewMapPopup()
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NewMapPopup::init(int type, int group, QString sec, QString layoutId) {
|
void NewMapPopup::initSettings(Project *project) {
|
||||||
|
settings.group = project->groupNames.at(0);
|
||||||
|
settings.width = project->getDefaultMapSize();
|
||||||
|
settings.height = project->getDefaultMapSize();
|
||||||
|
settings.borderWidth = DEFAULT_BORDER_WIDTH;
|
||||||
|
settings.borderHeight = DEFAULT_BORDER_HEIGHT;
|
||||||
|
settings.primaryTileset = project->getDefaultPrimaryTilesetLabel();
|
||||||
|
settings.secondaryTileset = project->getDefaultSecondaryTilesetLabel();
|
||||||
|
settings.type = project->mapTypes.at(0);
|
||||||
|
settings.location = project->mapSectionValueToName.values().at(0);
|
||||||
|
settings.song = project->songNames.at(0);
|
||||||
|
settings.canFlyTo = false;
|
||||||
|
settings.showLocationName = true;
|
||||||
|
settings.allowRunning = false;
|
||||||
|
settings.allowBiking = false;
|
||||||
|
settings.allowEscaping = false;
|
||||||
|
settings.floorNumber = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void NewMapPopup::init(MapSortOrder type, QVariant data) {
|
||||||
|
int groupNum = 0;
|
||||||
|
QString mapSec = QString();
|
||||||
|
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case MapSortOrder::Group:
|
case MapSortOrder::Group:
|
||||||
setDefaultValues(group, QString());
|
groupNum = data.toInt();
|
||||||
break;
|
break;
|
||||||
case MapSortOrder::Area:
|
case MapSortOrder::Area:
|
||||||
setDefaultValues(group, sec);
|
mapSec = data.toString();
|
||||||
break;
|
break;
|
||||||
case MapSortOrder::Layout:
|
case MapSortOrder::Layout:
|
||||||
useLayout(layoutId);
|
this->existingLayout = true;
|
||||||
setDefaultValues(group, QString());
|
this->layoutId = data.toString();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
populateComboBoxes();
|
||||||
|
setDefaultValues(groupNum, mapSec);
|
||||||
|
setDefaultValuesProjectConfig();
|
||||||
connectSignals();
|
connectSignals();
|
||||||
}
|
}
|
||||||
|
|
||||||
void NewMapPopup::initImportMap(MapLayout *mapLayout) {
|
void NewMapPopup::initImportMap(MapLayout *mapLayout) {
|
||||||
this->importedMap = true;
|
this->importedMap = true;
|
||||||
|
populateComboBoxes();
|
||||||
setDefaultValuesImportMap(mapLayout);
|
setDefaultValuesImportMap(mapLayout);
|
||||||
|
setDefaultValuesProjectConfig();
|
||||||
connectSignals();
|
connectSignals();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NewMapPopup::populateComboBoxes() {
|
||||||
|
ui->comboBox_NewMap_Primary_Tileset->addItems(project->primaryTilesetLabels);
|
||||||
|
ui->comboBox_NewMap_Secondary_Tileset->addItems(project->secondaryTilesetLabels);
|
||||||
|
ui->comboBox_NewMap_Group->addItems(project->groupNames);
|
||||||
|
ui->comboBox_NewMap_Song->addItems(project->songNames);
|
||||||
|
ui->comboBox_NewMap_Type->addItems(project->mapTypes);
|
||||||
|
ui->comboBox_NewMap_Location->addItems(project->mapSectionValueToName.values());
|
||||||
|
}
|
||||||
|
|
||||||
bool NewMapPopup::checkNewMapDimensions() {
|
bool NewMapPopup::checkNewMapDimensions() {
|
||||||
int numMetatiles = project->getMapDataSize(ui->spinBox_NewMap_Width->value(), ui->spinBox_NewMap_Height->value());
|
int numMetatiles = project->getMapDataSize(ui->spinBox_NewMap_Width->value(), ui->spinBox_NewMap_Height->value());
|
||||||
int maxMetatiles = project->getMaxMapDataSize();
|
int maxMetatiles = project->getMaxMapDataSize();
|
||||||
|
|
||||||
if (numMetatiles > maxMetatiles) {
|
if (numMetatiles > maxMetatiles) {
|
||||||
ui->frame_NewMap_Warning->setVisible(true);
|
ui->frame_NewMap_Warning->setVisible(true);
|
||||||
//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"
|
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 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")
|
"The specified map width and height was: (%2 + 15) * (%3 + 14) = %4")
|
||||||
|
@ -95,32 +133,23 @@ void NewMapPopup::connectSignals() {
|
||||||
ui->spinBox_NewMap_Width->setMaximum(project->getMaxMapWidth());
|
ui->spinBox_NewMap_Width->setMaximum(project->getMaxMapWidth());
|
||||||
ui->spinBox_NewMap_Height->setMaximum(project->getMaxMapHeight());
|
ui->spinBox_NewMap_Height->setMaximum(project->getMaxMapHeight());
|
||||||
|
|
||||||
//ui->icon_NewMap_WarningIcon->setPixmap();
|
|
||||||
connect(ui->spinBox_NewMap_Width, QOverload<int>::of(&QSpinBox::valueChanged), [=](int){checkNewMapDimensions();});
|
connect(ui->spinBox_NewMap_Width, QOverload<int>::of(&QSpinBox::valueChanged), [=](int){checkNewMapDimensions();});
|
||||||
connect(ui->spinBox_NewMap_Height, QOverload<int>::of(&QSpinBox::valueChanged), [=](int){checkNewMapDimensions();});
|
connect(ui->spinBox_NewMap_Height, QOverload<int>::of(&QSpinBox::valueChanged), [=](int){checkNewMapDimensions();});
|
||||||
}
|
}
|
||||||
|
|
||||||
void NewMapPopup::useLayout(QString layoutId) {
|
|
||||||
this->existingLayout = true;
|
|
||||||
this->layoutId = layoutId;
|
|
||||||
}
|
|
||||||
|
|
||||||
void NewMapPopup::setDefaultValues(int groupNum, QString mapSec) {
|
void NewMapPopup::setDefaultValues(int groupNum, QString mapSec) {
|
||||||
ui->lineEdit_NewMap_Name->setText(project->getNewMapName());
|
ui->lineEdit_NewMap_Name->setText(project->getNewMapName());
|
||||||
|
|
||||||
ui->comboBox_NewMap_Primary_Tileset->addItems(project->primaryTilesetLabels);
|
ui->comboBox_NewMap_Group->setTextItem(project->groupNames.at(groupNum));
|
||||||
ui->comboBox_NewMap_Secondary_Tileset->addItems(project->secondaryTilesetLabels);
|
|
||||||
|
|
||||||
ui->comboBox_NewMap_Group->addItems(project->groupNames);
|
if (this->existingLayout) {
|
||||||
ui->comboBox_NewMap_Group->setCurrentText(project->groupNames.at(groupNum));
|
MapLayout * layout = project->mapLayouts.value(layoutId);
|
||||||
|
ui->spinBox_NewMap_Width->setValue(layout->width);
|
||||||
ui->comboBox_Song->addItems(project->songNames);
|
ui->spinBox_NewMap_Height->setValue(layout->height);
|
||||||
|
ui->spinBox_NewMap_BorderWidth->setValue(layout->border_width);
|
||||||
if (existingLayout) {
|
ui->spinBox_NewMap_BorderHeight->setValue(layout->border_height);
|
||||||
ui->spinBox_NewMap_Width->setValue(project->mapLayouts.value(layoutId)->width);
|
ui->comboBox_NewMap_Primary_Tileset->setTextItem(layout->tileset_primary_label);
|
||||||
ui->spinBox_NewMap_Height->setValue(project->mapLayouts.value(layoutId)->height);
|
ui->comboBox_NewMap_Secondary_Tileset->setTextItem(layout->tileset_secondary_label);
|
||||||
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);
|
|
||||||
ui->spinBox_NewMap_Width->setDisabled(true);
|
ui->spinBox_NewMap_Width->setDisabled(true);
|
||||||
ui->spinBox_NewMap_Height->setDisabled(true);
|
ui->spinBox_NewMap_Height->setDisabled(true);
|
||||||
ui->spinBox_NewMap_BorderWidth->setDisabled(true);
|
ui->spinBox_NewMap_BorderWidth->setDisabled(true);
|
||||||
|
@ -132,109 +161,60 @@ void NewMapPopup::setDefaultValues(int groupNum, QString mapSec) {
|
||||||
ui->spinBox_NewMap_Height->setValue(project->getDefaultMapSize());
|
ui->spinBox_NewMap_Height->setValue(project->getDefaultMapSize());
|
||||||
ui->spinBox_NewMap_BorderWidth->setValue(DEFAULT_BORDER_WIDTH);
|
ui->spinBox_NewMap_BorderWidth->setValue(DEFAULT_BORDER_WIDTH);
|
||||||
ui->spinBox_NewMap_BorderHeight->setValue(DEFAULT_BORDER_HEIGHT);
|
ui->spinBox_NewMap_BorderHeight->setValue(DEFAULT_BORDER_HEIGHT);
|
||||||
int primaryIdx = ui->comboBox_NewMap_Primary_Tileset->findText(project->getDefaultPrimaryTilesetLabel());
|
ui->comboBox_NewMap_Primary_Tileset->setTextItem(project->getDefaultPrimaryTilesetLabel());
|
||||||
int secondaryIdx = ui->comboBox_NewMap_Secondary_Tileset->findText(project->getDefaultSecondaryTilesetLabel());
|
ui->comboBox_NewMap_Secondary_Tileset->setTextItem(project->getDefaultSecondaryTilesetLabel());
|
||||||
ui->comboBox_NewMap_Primary_Tileset->setCurrentIndex(primaryIdx);
|
|
||||||
ui->comboBox_NewMap_Secondary_Tileset->setCurrentIndex(secondaryIdx);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ui->comboBox_NewMap_Type->addItems(project->mapTypes);
|
if (!mapSec.isEmpty()) ui->comboBox_NewMap_Location->setTextItem(mapSec);
|
||||||
ui->comboBox_NewMap_Location->addItems(project->mapSectionValueToName.values());
|
|
||||||
if (!mapSec.isEmpty()) ui->comboBox_NewMap_Location->setCurrentText(mapSec);
|
|
||||||
ui->checkBox_NewMap_Show_Location->setChecked(true);
|
ui->checkBox_NewMap_Show_Location->setChecked(true);
|
||||||
|
|
||||||
ui->frame_NewMap_Options->setEnabled(true);
|
ui->frame_NewMap_Options->setEnabled(true);
|
||||||
|
|
||||||
setDefaultValuesProjectConfig(false, NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void NewMapPopup::setDefaultValuesImportMap(MapLayout *mapLayout) {
|
void NewMapPopup::setDefaultValuesImportMap(MapLayout *mapLayout) {
|
||||||
ui->lineEdit_NewMap_Name->setText(project->getNewMapName());
|
ui->lineEdit_NewMap_Name->setText(project->getNewMapName());
|
||||||
|
|
||||||
ui->comboBox_NewMap_Primary_Tileset->addItems(project->primaryTilesetLabels);
|
ui->comboBox_NewMap_Group->setTextItem(project->groupNames.at(0));
|
||||||
ui->comboBox_NewMap_Secondary_Tileset->addItems(project->secondaryTilesetLabels);
|
|
||||||
|
|
||||||
ui->comboBox_NewMap_Group->addItems(project->groupNames);
|
|
||||||
ui->comboBox_NewMap_Group->setCurrentText(project->groupNames.at(0));
|
|
||||||
|
|
||||||
ui->comboBox_Song->addItems(project->songNames);
|
|
||||||
|
|
||||||
ui->spinBox_NewMap_Width->setValue(mapLayout->width);
|
ui->spinBox_NewMap_Width->setValue(mapLayout->width);
|
||||||
ui->spinBox_NewMap_Height->setValue(mapLayout->height);
|
ui->spinBox_NewMap_Height->setValue(mapLayout->height);
|
||||||
ui->comboBox_NewMap_Primary_Tileset->setCurrentText(mapLayout->tileset_primary_label);
|
ui->spinBox_NewMap_BorderWidth->setValue(mapLayout->border_width);
|
||||||
ui->comboBox_NewMap_Secondary_Tileset->setCurrentText(mapLayout->tileset_secondary_label);
|
ui->spinBox_NewMap_BorderHeight->setValue(mapLayout->border_height);
|
||||||
|
|
||||||
|
ui->comboBox_NewMap_Primary_Tileset->setTextItem(mapLayout->tileset_primary_label);
|
||||||
|
ui->comboBox_NewMap_Secondary_Tileset->setTextItem(mapLayout->tileset_secondary_label);
|
||||||
|
|
||||||
ui->comboBox_NewMap_Type->addItems(project->mapTypes);
|
|
||||||
ui->comboBox_NewMap_Location->addItems(project->mapSectionValueToName.values());
|
|
||||||
ui->checkBox_NewMap_Show_Location->setChecked(true);
|
ui->checkBox_NewMap_Show_Location->setChecked(true);
|
||||||
|
|
||||||
ui->frame_NewMap_Options->setEnabled(true);
|
ui->frame_NewMap_Options->setEnabled(true);
|
||||||
|
|
||||||
setDefaultValuesProjectConfig(true, mapLayout);
|
this->map = new Map();
|
||||||
|
this->map->layout = new MapLayout();
|
||||||
map = new Map();
|
this->map->layout->blockdata = mapLayout->blockdata;
|
||||||
map->layout = new MapLayout();
|
|
||||||
map->layout->blockdata = mapLayout->blockdata;
|
|
||||||
|
|
||||||
if (!mapLayout->border.isEmpty()) {
|
if (!mapLayout->border.isEmpty()) {
|
||||||
map->layout->border = mapLayout->border;
|
this->map->layout->border = mapLayout->border;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void NewMapPopup::setDefaultValuesProjectConfig(bool importedMap, MapLayout *mapLayout) {
|
void NewMapPopup::setDefaultValuesProjectConfig() {
|
||||||
switch (projectConfig.getBaseGameVersion())
|
bool hasFlags = (projectConfig.getBaseGameVersion() != BaseGameVersion::pokeruby);
|
||||||
{
|
ui->checkBox_NewMap_Allow_Running->setVisible(hasFlags);
|
||||||
case BaseGameVersion::pokeruby:
|
ui->checkBox_NewMap_Allow_Biking->setVisible(hasFlags);
|
||||||
ui->checkBox_NewMap_Allow_Running->setVisible(false);
|
ui->checkBox_NewMap_Allow_Escape_Rope->setVisible(hasFlags);
|
||||||
ui->checkBox_NewMap_Allow_Biking->setVisible(false);
|
ui->label_NewMap_Allow_Running->setVisible(hasFlags);
|
||||||
ui->checkBox_NewMap_Allow_Escape_Rope->setVisible(false);
|
ui->label_NewMap_Allow_Biking->setVisible(hasFlags);
|
||||||
ui->label_NewMap_Allow_Running->setVisible(false);
|
ui->label_NewMap_Allow_Escape_Rope->setVisible(hasFlags);
|
||||||
ui->label_NewMap_Allow_Biking->setVisible(false);
|
|
||||||
ui->label_NewMap_Allow_Escape_Rope->setVisible(false);
|
bool hasCustomBorders = projectConfig.getUseCustomBorderSize();
|
||||||
break;
|
ui->spinBox_NewMap_BorderWidth->setVisible(hasCustomBorders);
|
||||||
case BaseGameVersion::pokeemerald:
|
ui->spinBox_NewMap_BorderHeight->setVisible(hasCustomBorders);
|
||||||
ui->checkBox_NewMap_Allow_Running->setVisible(true);
|
ui->label_NewMap_BorderWidth->setVisible(hasCustomBorders);
|
||||||
ui->checkBox_NewMap_Allow_Biking->setVisible(true);
|
ui->label_NewMap_BorderHeight->setVisible(hasCustomBorders);
|
||||||
ui->checkBox_NewMap_Allow_Escape_Rope->setVisible(true);
|
|
||||||
ui->label_NewMap_Allow_Running->setVisible(true);
|
bool hasFloorNumber = projectConfig.getFloorNumberEnabled();
|
||||||
ui->label_NewMap_Allow_Biking->setVisible(true);
|
ui->spinBox_NewMap_Floor_Number->setVisible(hasFloorNumber);
|
||||||
ui->label_NewMap_Allow_Escape_Rope->setVisible(true);
|
ui->label_NewMap_Floor_Number->setVisible(hasFloorNumber);
|
||||||
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()) {
|
|
||||||
if (importedMap) {
|
|
||||||
ui->spinBox_NewMap_BorderWidth->setValue(mapLayout->border_width);
|
|
||||||
ui->spinBox_NewMap_BorderHeight->setValue(mapLayout->border_height);
|
|
||||||
}
|
|
||||||
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 {
|
|
||||||
if (importedMap) {
|
|
||||||
ui->spinBox_NewMap_BorderWidth->setValue(DEFAULT_BORDER_WIDTH);
|
|
||||||
ui->spinBox_NewMap_BorderHeight->setValue(DEFAULT_BORDER_HEIGHT);
|
|
||||||
}
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void NewMapPopup::on_lineEdit_NewMap_Name_textChanged(const QString &text) {
|
void NewMapPopup::on_lineEdit_NewMap_Name_textChanged(const QString &text) {
|
||||||
|
@ -268,7 +248,7 @@ void NewMapPopup::on_pushButton_NewMap_Accept_clicked() {
|
||||||
newMap->name = newMapName;
|
newMap->name = newMapName;
|
||||||
newMap->type = this->ui->comboBox_NewMap_Type->currentText();
|
newMap->type = this->ui->comboBox_NewMap_Type->currentText();
|
||||||
newMap->location = this->ui->comboBox_NewMap_Location->currentText();
|
newMap->location = this->ui->comboBox_NewMap_Location->currentText();
|
||||||
newMap->song = this->ui->comboBox_Song->currentText();
|
newMap->song = this->ui->comboBox_NewMap_Song->currentText();
|
||||||
newMap->requiresFlash = false;
|
newMap->requiresFlash = false;
|
||||||
newMap->weather = this->project->weatherNames.value(0, "WEATHER_NONE");
|
newMap->weather = this->project->weatherNames.value(0, "WEATHER_NONE");
|
||||||
newMap->show_location = this->ui->checkBox_NewMap_Show_Location->isChecked();
|
newMap->show_location = this->ui->checkBox_NewMap_Show_Location->isChecked();
|
||||||
|
|
Loading…
Reference in a new issue