From f505ba1bc7b34c67d7b3b7aef01006def5947639 Mon Sep 17 00:00:00 2001 From: ultima-soul Date: Wed, 5 Sep 2018 01:13:17 +0000 Subject: [PATCH] Implemented gRegionMapSectionId_To_PopUpThemeIdMapping array to be dependent on Map Section ID enum rather than order dependent. --- include/constants/region_map_sections.h | 2 + src/map_name_popup.c | 130 +++++++++++++++++++----- 2 files changed, 106 insertions(+), 26 deletions(-) diff --git a/include/constants/region_map_sections.h b/include/constants/region_map_sections.h index 8ff75dfa98..35c92d7e4d 100644 --- a/include/constants/region_map_sections.h +++ b/include/constants/region_map_sections.h @@ -220,4 +220,6 @@ #define MAPSEC_IN_GAME_TRADE 0xFE #define MAPSEC_FATEFUL_ENCOUNTER 0xFF +#define MAPSEC_SUBSTRACT_KANTO (MAPSEC_SPECIAL_AREA - MAPSEC_DYNAMIC) + #endif //GUARD_REGIONMAPSEC_H diff --git a/src/map_name_popup.c b/src/map_name_popup.c index 578636d403..7906c74ef1 100644 --- a/src/map_name_popup.c +++ b/src/map_name_popup.c @@ -70,32 +70,110 @@ static const u16 gUnknown_0857F444[16] = INCBIN_U16("graphics/interface/map_popu static const u8 gRegionMapSectionId_To_PopUpThemeIdMapping[] = { - MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_WOOD, - MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_BRICK, - MAPPOPUP_THEME_MARBLE, MAPPOPUP_THEME_MARBLE, MAPPOPUP_THEME_MARBLE, MAPPOPUP_THEME_BRICK, - MAPPOPUP_THEME_MARBLE, MAPPOPUP_THEME_BRICK, MAPPOPUP_THEME_MARBLE, MAPPOPUP_THEME_BRICK, - MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_WOOD, - MAPPOPUP_THEME_UNDERWATER, MAPPOPUP_THEME_UNDERWATER, MAPPOPUP_THEME_UNDERWATER, MAPPOPUP_THEME_UNDERWATER, - MAPPOPUP_THEME_UNDERWATER, MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_WOOD, - MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_WOOD, - MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_WOOD, - MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_UNDERWATER, MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_UNDERWATER, - MAPPOPUP_THEME_UNDERWATER, MAPPOPUP_THEME_UNDERWATER, MAPPOPUP_THEME_UNDERWATER, MAPPOPUP_THEME_UNDERWATER, - MAPPOPUP_THEME_UNDERWATER, MAPPOPUP_THEME_UNDERWATER, MAPPOPUP_THEME_UNDERWATER, MAPPOPUP_THEME_UNDERWATER, - MAPPOPUP_THEME_UNDERWATER, MAPPOPUP_THEME_UNDERWATER, MAPPOPUP_THEME_STONE2, MAPPOPUP_THEME_STONE2, - MAPPOPUP_THEME_STONE2, MAPPOPUP_THEME_STONE2, MAPPOPUP_THEME_STONE2, MAPPOPUP_THEME_STONE, - MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_MARBLE, MAPPOPUP_THEME_WOOD, - MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_MARBLE, MAPPOPUP_THEME_STONE, - MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_STONE, - MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_STONE2, MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_WOOD, - MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_STONE, - MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_STONE2, - MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_STONE, - MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_MARBLE, - MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_WOOD, - MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_STONE2, - MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_STONE2, MAPPOPUP_THEME_STONE2, MAPPOPUP_THEME_STONE2, - MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_MARBLE + [MAPSEC_LITTLEROOT_TOWN] = MAPPOPUP_THEME_WOOD, + [MAPSEC_OLDALE_TOWN] = MAPPOPUP_THEME_WOOD, + [MAPSEC_DEWFORD_TOWN] = MAPPOPUP_THEME_WOOD, + [MAPSEC_LAVARIDGE_TOWN] = MAPPOPUP_THEME_WOOD, + [MAPSEC_FALLARBOR_TOWN] = MAPPOPUP_THEME_WOOD, + [MAPSEC_VERDANTURF_TOWN] = MAPPOPUP_THEME_WOOD, + [MAPSEC_PACIFIDLOG_TOWN] = MAPPOPUP_THEME_WOOD, + [MAPSEC_PETALBURG_CITY] = MAPPOPUP_THEME_BRICK, + [MAPSEC_SLATEPORT_CITY] = MAPPOPUP_THEME_MARBLE, + [MAPSEC_MAUVILLE_CITY] = MAPPOPUP_THEME_MARBLE, + [MAPSEC_RUSTBORO_CITY] = MAPPOPUP_THEME_MARBLE, + [MAPSEC_FORTREE_CITY] = MAPPOPUP_THEME_BRICK, + [MAPSEC_LILYCOVE_CITY] = MAPPOPUP_THEME_MARBLE, + [MAPSEC_MOSSDEEP_CITY] = MAPPOPUP_THEME_BRICK, + [MAPSEC_SOOTOPOLIS_CITY] = MAPPOPUP_THEME_MARBLE, + [MAPSEC_EVER_GRANDE_CITY] = MAPPOPUP_THEME_BRICK, + [MAPSEC_ROUTE_101] = MAPPOPUP_THEME_WOOD, + [MAPSEC_ROUTE_102] = MAPPOPUP_THEME_WOOD, + [MAPSEC_ROUTE_103] = MAPPOPUP_THEME_WOOD, + [MAPSEC_ROUTE_104] = MAPPOPUP_THEME_WOOD, + [MAPSEC_ROUTE_105] = MAPPOPUP_THEME_UNDERWATER, + [MAPSEC_ROUTE_106] = MAPPOPUP_THEME_UNDERWATER, + [MAPSEC_ROUTE_107] = MAPPOPUP_THEME_UNDERWATER, + [MAPSEC_ROUTE_108] = MAPPOPUP_THEME_UNDERWATER, + [MAPSEC_ROUTE_109] = MAPPOPUP_THEME_UNDERWATER, + [MAPSEC_ROUTE_110] = MAPPOPUP_THEME_WOOD, + [MAPSEC_ROUTE_111] = MAPPOPUP_THEME_WOOD, + [MAPSEC_ROUTE_112] = MAPPOPUP_THEME_WOOD, + [MAPSEC_ROUTE_113] = MAPPOPUP_THEME_WOOD, + [MAPSEC_ROUTE_114] = MAPPOPUP_THEME_WOOD, + [MAPSEC_ROUTE_115] = MAPPOPUP_THEME_WOOD, + [MAPSEC_ROUTE_116] = MAPPOPUP_THEME_WOOD, + [MAPSEC_ROUTE_117] = MAPPOPUP_THEME_WOOD, + [MAPSEC_ROUTE_118] = MAPPOPUP_THEME_WOOD, + [MAPSEC_ROUTE_119] = MAPPOPUP_THEME_WOOD, + [MAPSEC_ROUTE_120] = MAPPOPUP_THEME_WOOD, + [MAPSEC_ROUTE_121] = MAPPOPUP_THEME_WOOD, + [MAPSEC_ROUTE_122] = MAPPOPUP_THEME_UNDERWATER, + [MAPSEC_ROUTE_123] = MAPPOPUP_THEME_WOOD, + [MAPSEC_ROUTE_124] = MAPPOPUP_THEME_UNDERWATER, + [MAPSEC_ROUTE_125] = MAPPOPUP_THEME_UNDERWATER, + [MAPSEC_ROUTE_126] = MAPPOPUP_THEME_UNDERWATER, + [MAPSEC_ROUTE_127] = MAPPOPUP_THEME_UNDERWATER, + [MAPSEC_ROUTE_128] = MAPPOPUP_THEME_UNDERWATER, + [MAPSEC_ROUTE_129] = MAPPOPUP_THEME_UNDERWATER, + [MAPSEC_ROUTE_130] = MAPPOPUP_THEME_UNDERWATER, + [MAPSEC_ROUTE_131] = MAPPOPUP_THEME_UNDERWATER, + [MAPSEC_ROUTE_132] = MAPPOPUP_THEME_UNDERWATER, + [MAPSEC_ROUTE_133] = MAPPOPUP_THEME_UNDERWATER, + [MAPSEC_ROUTE_134] = MAPPOPUP_THEME_UNDERWATER, + [MAPSEC_UNDERWATER_124] = MAPPOPUP_THEME_STONE2, + [MAPSEC_UNDERWATER_125] = MAPPOPUP_THEME_STONE2, + [MAPSEC_UNDERWATER_126] = MAPPOPUP_THEME_STONE2, + [MAPSEC_UNDERWATER_127] = MAPPOPUP_THEME_STONE2, + [MAPSEC_UNDERWATER_SOOTOPOLIS] = MAPPOPUP_THEME_STONE2, + [MAPSEC_GRANITE_CAVE] = MAPPOPUP_THEME_STONE, + [MAPSEC_MT_CHIMNEY] = MAPPOPUP_THEME_STONE, + [MAPSEC_SAFARI_ZONE] = MAPPOPUP_THEME_WOOD, + [MAPSEC_BATTLE_FRONTIER] = MAPPOPUP_THEME_MARBLE, + [MAPSEC_PETALBURG_WOODS] = MAPPOPUP_THEME_WOOD, + [MAPSEC_RUSTURF_TUNNEL] = MAPPOPUP_THEME_STONE, + [MAPSEC_ABANDONED_SHIP] = MAPPOPUP_THEME_WOOD, + [MAPSEC_NEW_MAUVILLE] = MAPPOPUP_THEME_MARBLE, + [MAPSEC_METEOR_FALLS] = MAPPOPUP_THEME_STONE, + [MAPSEC_METEOR_FALLS2] = MAPPOPUP_THEME_STONE, + [MAPSEC_MT_PYRE] = MAPPOPUP_THEME_STONE, + [MAPSEC_AQUA_HIDEOUT_OLD] = MAPPOPUP_THEME_STONE, + [MAPSEC_SHOAL_CAVE] = MAPPOPUP_THEME_STONE, + [MAPSEC_SEAFLOOR_CAVERN] = MAPPOPUP_THEME_STONE, + [MAPSEC_UNDERWATER_128] = MAPPOPUP_THEME_STONE2, + [MAPSEC_VICTORY_ROAD] = MAPPOPUP_THEME_STONE, + [MAPSEC_MIRAGE_ISLAND] = MAPPOPUP_THEME_WOOD, + [MAPSEC_CAVE_OF_ORIGIN] = MAPPOPUP_THEME_STONE, + [MAPSEC_SOUTHERN_ISLAND] = MAPPOPUP_THEME_WOOD, + [MAPSEC_FIERY_PATH] = MAPPOPUP_THEME_STONE, + [MAPSEC_FIERY_PATH2] = MAPPOPUP_THEME_STONE, + [MAPSEC_JAGGED_PASS] = MAPPOPUP_THEME_WOOD, + [MAPSEC_JAGGED_PASS2] = MAPPOPUP_THEME_WOOD, + [MAPSEC_SEALED_CHAMBER] = MAPPOPUP_THEME_STONE, + [MAPSEC_UNDERWATER_SEALED_CHAMBER] = MAPPOPUP_THEME_STONE2, + [MAPSEC_SCORCHED_SLAB] = MAPPOPUP_THEME_STONE, + [MAPSEC_ISLAND_CAVE] = MAPPOPUP_THEME_STONE, + [MAPSEC_DESERT_RUINS] = MAPPOPUP_THEME_STONE, + [MAPSEC_ANCIENT_TOMB] = MAPPOPUP_THEME_STONE, + [MAPSEC_INSIDE_OF_TRUCK] = MAPPOPUP_THEME_WOOD, + [MAPSEC_SKY_PILLAR] = MAPPOPUP_THEME_STONE, + [MAPSEC_SECRET_BASE] = MAPPOPUP_THEME_STONE, + [MAPSEC_DYNAMIC] = MAPPOPUP_THEME_MARBLE, + [MAPSEC_AQUA_HIDEOUT - MAPSEC_SUBSTRACT_KANTO] = MAPPOPUP_THEME_STONE, + [MAPSEC_MAGMA_HIDEOUT - MAPSEC_SUBSTRACT_KANTO] = MAPPOPUP_THEME_STONE, + [MAPSEC_MIRAGE_TOWER - MAPSEC_SUBSTRACT_KANTO] = MAPPOPUP_THEME_STONE, + [MAPSEC_BIRTH_ISLAND_2 - MAPSEC_SUBSTRACT_KANTO] = MAPPOPUP_THEME_WOOD, + [MAPSEC_FARAWAY_ISLAND - MAPSEC_SUBSTRACT_KANTO] = MAPPOPUP_THEME_WOOD, + [MAPSEC_ARTISAN_CAVE - MAPSEC_SUBSTRACT_KANTO] = MAPPOPUP_THEME_STONE, + [MAPSEC_MARINE_CAVE - MAPSEC_SUBSTRACT_KANTO] = MAPPOPUP_THEME_STONE, + [MAPSEC_UNDERWATER_MARINE_CAVE - MAPSEC_SUBSTRACT_KANTO] = MAPPOPUP_THEME_STONE2, + [MAPSEC_TERRA_CAVE - MAPSEC_SUBSTRACT_KANTO] = MAPPOPUP_THEME_STONE, + [MAPSEC_UNDERWATER_TERRA_CAVE - MAPSEC_SUBSTRACT_KANTO] = MAPPOPUP_THEME_STONE2, + [MAPSEC_UNDERWATER_UNK1 - MAPSEC_SUBSTRACT_KANTO] = MAPPOPUP_THEME_STONE2, + [MAPSEC_UNDERWATER_129 - MAPSEC_SUBSTRACT_KANTO] = MAPPOPUP_THEME_STONE2, + [MAPSEC_DESERT_UNDERPASS - MAPSEC_SUBSTRACT_KANTO] = MAPPOPUP_THEME_STONE, + [MAPSEC_ALTERING_CAVE_2 - MAPSEC_SUBSTRACT_KANTO] = MAPPOPUP_THEME_STONE, + [MAPSEC_NAVEL_ROCK2 - MAPSEC_SUBSTRACT_KANTO] = MAPPOPUP_THEME_STONE, + [MAPSEC_TRAINER_HILL - MAPSEC_SUBSTRACT_KANTO] = MAPPOPUP_THEME_MARBLE }; static const u8 gText_PyramidFloor1[] = _("PYRAMID FLOOR 1");