Done requested changes

This commit is contained in:
KDSKardabox
2018-04-12 22:36:07 +05:30
parent 66e76d9633
commit ac7d69eb6e
3 changed files with 62 additions and 40 deletions
+38 -16
View File
@@ -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);