From 083874ce9e56f91f0f698514a7bcc492313a4900 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 18 Mar 2020 03:12:43 -0400 Subject: [PATCH] Minor fixes --- src/core/metatileparser.cpp | 2 ++ src/mainwindow.cpp | 2 ++ src/project.cpp | 6 ++++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/core/metatileparser.cpp b/src/core/metatileparser.cpp index da7de6b1..d1b936ff 100644 --- a/src/core/metatileparser.cpp +++ b/src/core/metatileparser.cpp @@ -84,6 +84,8 @@ QList *MetatileParser::parse(QString filepath, bool *error, bool prim (static_cast(in.at(attrOffset + 1)) << 8); metatile->behavior = value & 0xFF; metatile->layerType = (value & 0xF000) >> 12; + metatile->encounterType = 0; + metatile->terrainType = 0; metatile->tiles = tiles; metatiles->append(metatile); } diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index c5130f2e..436a1702 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -164,6 +164,7 @@ void MainWindow::setProjectSpecificUIVisibility() ui->label_AllowBiking->setVisible(false); ui->label_AllowEscapeRope->setVisible(false); ui->label_FloorNumber->setVisible(false); + ui->actionRegion_Map_Editor->setVisible(true); break; case BaseGameVersion::pokeemerald: ui->checkBox_AllowRunning->setVisible(true); @@ -174,6 +175,7 @@ void MainWindow::setProjectSpecificUIVisibility() ui->label_AllowBiking->setVisible(true); ui->label_AllowEscapeRope->setVisible(true); ui->label_FloorNumber->setVisible(false); + ui->actionRegion_Map_Editor->setVisible(true); break; case BaseGameVersion::pokefirered: ui->checkBox_AllowRunning->setVisible(true); diff --git a/src/project.cpp b/src/project.cpp index c9822afa..00f6a894 100644 --- a/src/project.cpp +++ b/src/project.cpp @@ -533,7 +533,7 @@ bool Project::readMapLayouts() { layout->border_width = QString::number(bwidth); int bheight = layoutObj["border_height"].toInt(); if (bheight <= 0) { - logWarn(QString("Invalid layout 'border_height value '%1' on layout %2 in %3. Must be greater than 0. Using default (%4) instead.").arg(bheight).arg(i).arg(layoutsFilepath).arg(DEFAULT_BORDER_HEIGHT)); + logWarn(QString("Invalid layout 'border_height' value '%1' on layout %2 in %3. Must be greater than 0. Using default (%4) instead.").arg(bheight).arg(i).arg(layoutsFilepath).arg(DEFAULT_BORDER_HEIGHT)); bheight = DEFAULT_BORDER_HEIGHT; } layout->border_height = QString::number(bheight); @@ -1221,7 +1221,9 @@ void Project::saveMap(Map *map) { mapObj["allow_escaping"] = map->allowEscapeRope.toInt() > 0 || map->allowEscapeRope == "TRUE"; mapObj["allow_running"] = map->allowRunning.toInt() > 0 || map->allowRunning == "TRUE"; mapObj["show_map_name"] = map->show_location.toInt() > 0 || map->show_location == "TRUE"; - mapObj["floor_number"] = map->floorNumber; + if (projectConfig.getBaseGameVersion() == BaseGameVersion::pokefirered) { + mapObj["floor_number"] = map->floorNumber; + } mapObj["battle_scene"] = map->battle_scene; // Connections