Merge pull request #134 from garakmon/map-grp-num

Create New Maps In Correct Group When Group Names Are Not Numbered
This commit is contained in:
garak 2019-05-20 22:54:22 -04:00 committed by GitHub
commit ca438fdc50
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -53,7 +53,7 @@ void NewMapPopup::setDefaultValues(int groupNum, QString mapSec) {
ui->comboBox_NewMap_Secondary_Tileset->addItems(tilesets.value("secondary"));
ui->comboBox_NewMap_Group->addItems(*project->groupNames);
ui->comboBox_NewMap_Group->setCurrentText("gMapGroup" + QString::number(groupNum));
ui->comboBox_NewMap_Group->setCurrentText(project->groupNames->at(groupNum));
if (existingLayout) {
ui->spinBox_NewMap_Width->setValue(project->mapLayouts.value(layoutId)->width.toInt(nullptr, 0));
@ -151,7 +151,7 @@ void NewMapPopup::on_pushButton_NewMap_Accept_clicked() {
newMap->allowEscapeRope = this->ui->checkBox_NewMap_Allow_Escape_Rope->isChecked() ? "1" : "0";
}
group = this->ui->comboBox_NewMap_Group->currentText().remove("gMapGroup").toInt();
group = project->groupNames->indexOf(this->ui->comboBox_NewMap_Group->currentText());
newMap->layout = layout;
newMap->layoutId = layout->id;
project->loadMapLayout(newMap);