summaryrefslogtreecommitdiff
path: root/src/map_name_popup.c
diff options
context:
space:
mode:
authorKDSKardabox <bollygame94@gmail.com>2018-04-12 22:36:07 +0530
committerKDSKardabox <bollygame94@gmail.com>2018-04-12 22:36:07 +0530
commitac7d69eb6e491541837455a2fba0ee63586c6191 (patch)
tree9003393ec7c964e42c39b09b871ea1e252b7372c /src/map_name_popup.c
parent66e76d96332c377b2da839158677747e2a6572fd (diff)
Done requested changes
Diffstat (limited to 'src/map_name_popup.c')
-rw-r--r--src/map_name_popup.c54
1 files changed, 38 insertions, 16 deletions
diff --git a/src/map_name_popup.c b/src/map_name_popup.c
index 1faecf9ac..59b1622eb 100644
--- a/src/map_name_popup.c
+++ b/src/map_name_popup.c
@@ -1,4 +1,6 @@
#include "global.h"
+#include "constants/region_map_sections.h"
+#include "constants/weather.h"
#include "bg.h"
#include "event_data.h"
#include "gpu_regs.h"
@@ -11,6 +13,8 @@
#include "start_menu.h"
#include "string_util.h"
#include "task.h"
+#include "text.h"
+
// enums
enum MapPopUp_Themes
@@ -66,14 +70,32 @@ static const u16 gUnknown_0857F444[16] = INCBIN_U16("graphics/interface/map_popu
static const u8 gRegionMapSectionId_To_PopUpThemeIdMapping[] =
{
- //TO-DO: Replace with enum entries
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x01, 0x01, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03,
- 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, 0x05, 0x02, 0x02, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x05, 0x02, 0x00, 0x02, 0x00, 0x02, 0x02, 0x00, 0x00, 0x02, 0x05,
- 0x02, 0x02, 0x02, 0x02, 0x00, 0x02, 0x02, 0x01, 0x02, 0x02, 0x02, 0x00, 0x00, 0x02, 0x02, 0x05,
- 0x02, 0x05, 0x05, 0x05, 0x02, 0x02, 0x02, 0x01
+ 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
};
static const u8 gText_PyramidFloor1[] = _("PYRAMID FLOOR 1");
@@ -226,9 +248,9 @@ static void ShowMapNamePopUpWindow(void)
AddMapNamePopUpWindow();
LoadMapNamePopUpWindowBg();
x = GetStringCenterAlignXOffset(7, withoutPrefixPtr, 80);
- mapDisplayHeader[0] = 0xFC;
- mapDisplayHeader[1] = 0x2;
- mapDisplayHeader[2] = 0x0;
+ mapDisplayHeader[0] = EXT_CTRL_CODE_BEGIN;
+ mapDisplayHeader[1] = EXT_CTRL_CODE_HIGHLIGHT;
+ mapDisplayHeader[2] = TEXT_COLOR_TRANSPARENT;
PrintTextOnWindow(GetMapNamePopUpWindowId(), 7, mapDisplayHeader, x, 3, 0xFF, NULL);
CopyWindowToVram(GetMapNamePopUpWindowId(), 3);
}
@@ -432,19 +454,19 @@ static void LoadMapNamePopUpWindowBg(void)
popupWindowId = GetMapNamePopUpWindowId();
regionMapSectionId = gMapHeader.regionMapSectionId;
- if(regionMapSectionId > 0x57)
+ if(regionMapSectionId > MAPSEC_DYNAMIC)
{
- if(regionMapSectionId > 0xC4)
- regionMapSectionId -= 0x6D;
+ if(regionMapSectionId > MAPSEC_SPECIAL_AREA)
+ regionMapSectionId -= (MAPSEC_SPECIAL_AREA - MAPSEC_DYNAMIC);
else
- regionMapSectionId = 0;
+ regionMapSectionId = 0; //discard kanto region sections
}
popUpThemeId = gRegionMapSectionId_To_PopUpThemeIdMapping[regionMapSectionId];
LoadBgTiles(GetWindowAttribute(popupWindowId, 0), &(gMapPopUp_Outline_Table[popUpThemeId][0]), 0x400, 0x21D);
CallWindowFunction(popupWindowId, sub_80D4A78);
PutWindowTilemap(popupWindowId);
- if(gMapHeader.weather == 0xE)
+ if(gMapHeader.weather == WEATHER_BUBBLES)
LoadPalette(&gUnknown_0857F444, 0xE0, 0x20);
else
LoadPalette(&(gMapPopUp_Palette_Table[popUpThemeId][0]), 0xE0, 0x20);