From ef535b98b5e1384ce5f663a4ab4dfcb003fbe1c7 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 31 Oct 2017 21:51:11 -0400 Subject: through GetMapName --- src/region_map.c | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/region_map.c b/src/region_map.c index 9e76b43c1..5284922cc 100644 --- a/src/region_map.c +++ b/src/region_map.c @@ -11,6 +11,9 @@ #include "flags.h" #include "event_data.h" #include "rom6.h" +#include "secret_base.h" +#include "string_util.h" +#include "text.h" #include "region_map.h" #define MAP_WIDTH 28 @@ -30,7 +33,7 @@ struct RegionMapLocation { u8 x, y; u8 width, height; - const u8 *regionMapSectionId; + const u8 *name; }; // Static RAM declarations @@ -1165,3 +1168,43 @@ static void RegionMapPlayerIconSpriteCallback(struct Sprite *sprite) sprite->invisible = FALSE; } } + +void sub_812454C(void) +{ + if (gRegionMap->playerIsInCave) + { + gRegionMap->blinkPlayerIcon = TRUE; + } +} + +u8 *GetMapName(u8 *dest, u16 regionMapId, u16 padLength) +{ + u8 *str; + u16 i; + + if (regionMapId == MAPSEC_SECRET_BASE) + { + str = GetSecretBaseMapName(dest); + } + else if (regionMapId < MAPSEC_NONE) + { + str = StringCopy(dest, gRegionMapEntries[regionMapId].name); + } + else + { + if (padLength == 0) + { + padLength = 18; + } + return StringFill(dest, CHAR_SPACE, padLength); + } + if (padLength != 0) + { + for (i = str - dest; i < padLength; i ++) + { + *str++ = CHAR_SPACE; + } + *str = EOS; + } + return str; +} -- cgit v1.2.3