Clean up pokenav general menus, organize pokenav graphics
Before Width: | Height: | Size: 194 B |
Before Width: | Height: | Size: 197 B After Width: | Height: | Size: 197 B |
Before Width: | Height: | Size: 153 B After Width: | Height: | Size: 153 B |
Before Width: | Height: | Size: 641 B After Width: | Height: | Size: 641 B |
Before Width: | Height: | Size: 164 B After Width: | Height: | Size: 164 B |
Before Width: | Height: | Size: 251 B After Width: | Height: | Size: 251 B |
Before Width: | Height: | Size: 209 B After Width: | Height: | Size: 209 B |
Before Width: | Height: | Size: 630 B After Width: | Height: | Size: 630 B |
@ -1,35 +0,0 @@
|
||||
JASC-PAL
|
||||
0100
|
||||
32
|
||||
0 197 0
|
||||
246 197 123
|
||||
255 255 255
|
||||
106 115 123
|
||||
0 0 0
|
||||
189 106 65
|
||||
49 65 74
|
||||
255 222 156
|
||||
180 131 82
|
||||
189 139 106
|
||||
197 197 197
|
||||
255 255 255
|
||||
0 0 0
|
||||
0 0 0
|
||||
0 0 0
|
||||
255 74 16
|
||||
0 197 0
|
||||
246 197 123
|
||||
255 255 255
|
||||
106 115 123
|
||||
0 0 0
|
||||
189 106 65
|
||||
49 65 74
|
||||
255 222 156
|
||||
180 131 82
|
||||
189 139 106
|
||||
197 197 197
|
||||
197 197 197
|
||||
0 0 0
|
||||
0 0 0
|
||||
0 0 0
|
||||
189 106 65
|
Before Width: | Height: | Size: 239 B After Width: | Height: | Size: 239 B |
Before Width: | Height: | Size: 194 B After Width: | Height: | Size: 194 B |
Before Width: | Height: | Size: 168 B After Width: | Height: | Size: 168 B |
Before Width: | Height: | Size: 291 B After Width: | Height: | Size: 291 B |
Before Width: | Height: | Size: 160 B After Width: | Height: | Size: 160 B |
Before Width: | Height: | Size: 245 B After Width: | Height: | Size: 245 B |
@ -697,7 +697,7 @@ $(PKNAVGFXDIR)/header.4bpp: %.4bpp: %.png
|
||||
$(PKNAVGFXDIR)/device_outline.4bpp: %.4bpp: %.png
|
||||
$(GFX) $< $@ -num_tiles 53
|
||||
|
||||
$(PKNAVGFXDIR)/ui_matchcall.4bpp: %.4bpp: %.png
|
||||
$(PKNAVGFXDIR)/match_call/ui.4bpp: %.4bpp: %.png
|
||||
$(GFX) $< $@ -num_tiles 13
|
||||
|
||||
$(INTERFACEGFXDIR)/region_map.8bpp: %.8bpp: %.png
|
||||
|
@ -69,7 +69,7 @@ enum
|
||||
{
|
||||
POKENAV_SUBSTRUCT_MAIN_MENU,
|
||||
POKENAV_SUBSTRUCT_MAIN_MENU_HANDLER,
|
||||
POKENAV_SUBSTRUCT_MENU_ICONS,
|
||||
POKENAV_SUBSTRUCT_MENU_GFX,
|
||||
POKENAV_SUBSTRUCT_REGION_MAP_STATE,
|
||||
POKENAV_SUBSTRUCT_REGION_MAP_ZOOM,
|
||||
POKENAV_SUBSTRUCT_MATCH_CALL_MAIN,
|
||||
@ -82,7 +82,7 @@ enum
|
||||
POKENAV_SUBSTRUCT_CONDITION_GRAPH_MENU_GFX,
|
||||
POKENAV_SUBSTRUCT_RIBBONS_SUMMARY_LIST,
|
||||
POKENAV_SUBSTRUCT_RIBBONS_SUMMARY_MENU,
|
||||
POKENAV_SUBSTRUCT_15, //unused
|
||||
POKENAV_SUBSTRUCT_UNUSED,
|
||||
POKENAV_SUBSTRUCT_REGION_MAP,
|
||||
POKENAV_SUBSTRUCT_MATCH_CALL_LIST,
|
||||
POKENAV_SUBSTRUCT_MON_LIST,
|
||||
@ -358,7 +358,7 @@ void SlideMenuHeaderDown(void);
|
||||
bool32 MainMenuLoopedTaskIsBusy(void);
|
||||
void SetLeftHeaderSpritesInvisibility(void);
|
||||
void PokenavCopyPalette(const u16 *a0, const u16 *a1, int a2, int a3, int a4, u16 *palette);
|
||||
void sub_81C7B40(void);
|
||||
void FadeToBlackExceptPrimary(void);
|
||||
struct Sprite *PauseSpinningPokenavSprite(void);
|
||||
void ResumeSpinningPokenavSprite(void);
|
||||
void UpdateRegionMapRightHeaderTiles(u32 arg0);
|
||||
|
@ -1187,10 +1187,10 @@ static void StartMatchCall(void)
|
||||
CreateTask(ExecuteMatchCall, 1);
|
||||
}
|
||||
|
||||
static const u16 sMatchCallWindow_Pal[] = INCBIN_U16("graphics/pokenav/match_call_window.gbapal");
|
||||
static const u8 sMatchCallWindow_Gfx[] = INCBIN_U8("graphics/pokenav/match_call_window.4bpp");
|
||||
static const u16 sPokenavIcon_Pal[] = INCBIN_U16("graphics/pokenav/icon.gbapal");
|
||||
static const u32 sPokenavIcon_Gfx[] = INCBIN_U32("graphics/pokenav/icon.4bpp.lz");
|
||||
static const u16 sMatchCallWindow_Pal[] = INCBIN_U16("graphics/pokenav/match_call/window.gbapal");
|
||||
static const u8 sMatchCallWindow_Gfx[] = INCBIN_U8("graphics/pokenav/match_call/window.4bpp");
|
||||
static const u16 sPokenavIcon_Pal[] = INCBIN_U16("graphics/pokenav/match_call/nav_icon.gbapal");
|
||||
static const u32 sPokenavIcon_Gfx[] = INCBIN_U32("graphics/pokenav/match_call/nav_icon.4bpp.lz");
|
||||
|
||||
static const u8 sText_PokenavCallEllipsis[] = _("………………\p");
|
||||
|
||||
|
@ -49,7 +49,6 @@ static void Task_RunLoopedTask(u8 taskId);
|
||||
static void Task_Pokenav(u8 taskId);
|
||||
static void CB2_InitPokenavForTutorial(void);
|
||||
|
||||
// TODO: Use MENU ids
|
||||
const struct PokenavCallbacks PokenavMenuCallbacks[15] =
|
||||
{
|
||||
[POKENAV_MAIN_MENU - POKENAV_MENU_IDS_START] =
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "menu.h"
|
||||
#include "dma3.h"
|
||||
|
||||
struct PokenavMainMenuResources
|
||||
struct Pokenav_MainMenu
|
||||
{
|
||||
void (*loopTask)(u32);
|
||||
u32 (*isLoopTaskActiveFunc)(void);
|
||||
@ -24,7 +24,7 @@ struct PokenavMainMenuResources
|
||||
struct Sprite *spinningPokenav;
|
||||
struct Sprite *leftHeaderSprites[2];
|
||||
struct Sprite *submenuLeftHeaderSprites[2];
|
||||
u8 tilemapBuffer[0x800];
|
||||
u8 tilemapBuffer[BG_SCREEN_SIZE];
|
||||
};
|
||||
|
||||
// This struct uses a 32bit tag, and doesn't have a size field.
|
||||
@ -36,26 +36,26 @@ struct CompressedSpriteSheetNoSize
|
||||
};
|
||||
|
||||
static void CleanupPokenavMainMenuResources(void);
|
||||
static void LoadLeftHeaderGfxForSubMenu(u32 arg0);
|
||||
static void LoadLeftHeaderGfxForMenu(u32 index);
|
||||
static void HideLeftHeaderSubmenuSprites(bool32 isOnRightSide);
|
||||
static void HideLeftHeaderSprites(bool32 isOnRightSide);
|
||||
static void ShowLeftHeaderSprites(u32 startY, bool32 isOnRightSide);
|
||||
static void ShowLeftHeaderSubmenuSprites(u32 startY, bool32 isOnRightSide);
|
||||
static void MoveLeftHeader(struct Sprite *sprite, s32 startX, s32 endX, s32 duration);
|
||||
static void SpriteCB_MoveLeftHeader(struct Sprite *sprite);
|
||||
static void LoadLeftHeaderGfxForSubMenu(u32);
|
||||
static void LoadLeftHeaderGfxForMenu(u32);
|
||||
static void HideLeftHeaderSubmenuSprites(bool32);
|
||||
static void HideLeftHeaderSprites(bool32);
|
||||
static void ShowLeftHeaderSprites(u32, bool32);
|
||||
static void ShowLeftHeaderSubmenuSprites(u32, bool32);
|
||||
static void MoveLeftHeader(struct Sprite *, s32, s32, s32);
|
||||
static void SpriteCB_MoveLeftHeader(struct Sprite *);
|
||||
static void InitPokenavMainMenuResources(void);
|
||||
static void InitHoennMapHeaderSprites(void);
|
||||
static void CreateLeftHeaderSprites(void);
|
||||
static void InitHelpBar(void);
|
||||
static u32 LoopedTask_SlideMenuHeaderUp(s32 a0);
|
||||
static u32 LoopedTask_SlideMenuHeaderDown(s32 a0);
|
||||
static void DrawHelpBar(u32 windowId);
|
||||
static void SpriteCB_SpinningPokenav(struct Sprite* sprite);
|
||||
static u32 LoopedTask_InitPokenavMenu(s32 a0);
|
||||
static u32 LoopedTask_SlideMenuHeaderUp(s32);
|
||||
static u32 LoopedTask_SlideMenuHeaderDown(s32);
|
||||
static void DrawHelpBar(u32);
|
||||
static void SpriteCB_SpinningPokenav(struct Sprite*);
|
||||
static u32 LoopedTask_InitPokenavMenu(s32);
|
||||
|
||||
const u16 gSpinningPokenavPaletteData[] = INCBIN_U16("graphics/pokenav/icon2.gbapal");
|
||||
const u32 gSpinningPokenavGfx[] = INCBIN_U32("graphics/pokenav/icon2.4bpp.lz");
|
||||
const u32 gUnused_SpinningPokenavGfx2[] = INCBIN_U32("graphics/pokenav/icon2_unused.4bpp.lz");
|
||||
static const u16 sSpinningPokenav_Pal[] = INCBIN_U16("graphics/pokenav/nav_icon.gbapal");
|
||||
static const u32 sSpinningPokenav_Gfx[] = INCBIN_U32("graphics/pokenav/nav_icon.4bpp.lz");
|
||||
static const u32 sBlueLightCopy[] = INCBIN_U32("graphics/pokenav/blue_light.4bpp.lz"); // Unused copy of sMatchCallBlueLightTiles
|
||||
|
||||
const struct BgTemplate gPokenavMainMenuBgTemplates[] =
|
||||
{
|
||||
@ -108,7 +108,7 @@ static const u8 sHelpBarTextColors[3] =
|
||||
static const struct CompressedSpriteSheet gSpinningPokenavSpriteSheet[] =
|
||||
{
|
||||
{
|
||||
.data = gSpinningPokenavGfx,
|
||||
.data = sSpinningPokenav_Gfx,
|
||||
.size = 0x1000,
|
||||
.tag = 0,
|
||||
}
|
||||
@ -117,20 +117,20 @@ static const struct CompressedSpriteSheet gSpinningPokenavSpriteSheet[] =
|
||||
static const struct SpritePalette gSpinningNavgearPalettes[] =
|
||||
{
|
||||
{
|
||||
.data = gSpinningPokenavPaletteData,
|
||||
.data = sSpinningPokenav_Pal,
|
||||
.tag = 0,
|
||||
},
|
||||
{}
|
||||
};
|
||||
|
||||
static const struct CompressedSpriteSheet sPokenavHoennMapLeftHeaderSpriteSheet =
|
||||
static const struct CompressedSpriteSheet sMenuLeftHeaderSpriteSheet =
|
||||
{
|
||||
.data = gPokenavLeftHeaderHoennMap_Gfx,
|
||||
.data = gPokenavLeftHeaderHoennMap_Gfx, // Hoenn map is the first of the headers listed
|
||||
.size = 0xC00,
|
||||
.tag = 2
|
||||
};
|
||||
|
||||
static const struct CompressedSpriteSheet sPokenavMenuLeftHeaderSpriteSheets[] =
|
||||
static const struct CompressedSpriteSheet sMenuLeftHeaderSpriteSheets[] =
|
||||
{
|
||||
[POKENAV_GFX_MAIN_MENU] = {
|
||||
.data = gPokenavLeftHeaderMainMenu_Gfx,
|
||||
@ -239,7 +239,7 @@ static const struct SpriteTemplate sSpinningPokenavSpriteTemplate =
|
||||
.callback = SpriteCB_SpinningPokenav
|
||||
};
|
||||
|
||||
static const struct OamData sPokenavLeftHeaderHoennMapSpriteOam =
|
||||
static const struct OamData sOamData_LeftHeader =
|
||||
{
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
@ -253,7 +253,7 @@ static const struct OamData sPokenavLeftHeaderHoennMapSpriteOam =
|
||||
.paletteNum = 0,
|
||||
};
|
||||
|
||||
static const struct OamData sUnknown_0861FB24 =
|
||||
static const struct OamData sOamData_SubmenuLeftHeader =
|
||||
{
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
@ -268,22 +268,22 @@ static const struct OamData sUnknown_0861FB24 =
|
||||
.paletteNum = 0,
|
||||
};
|
||||
|
||||
static const struct SpriteTemplate sPokenavLeftHeaderHoennMapSpriteTemplate =
|
||||
static const struct SpriteTemplate sLeftHeaderSpriteTemplate =
|
||||
{
|
||||
.tileTag = 2,
|
||||
.paletteTag = 1,
|
||||
.oam = &sPokenavLeftHeaderHoennMapSpriteOam,
|
||||
.oam = &sOamData_LeftHeader,
|
||||
.anims = gDummySpriteAnimTable,
|
||||
.images = NULL,
|
||||
.affineAnims = gDummySpriteAffineAnimTable,
|
||||
.callback = SpriteCallbackDummy
|
||||
};
|
||||
|
||||
static const struct SpriteTemplate sUnknown_0861FB44 =
|
||||
static const struct SpriteTemplate sSubmenuLeftHeaderSpriteTemplate =
|
||||
{
|
||||
.tileTag = 2,
|
||||
.paletteTag = 2,
|
||||
.oam = &sUnknown_0861FB24,
|
||||
.oam = &sOamData_SubmenuLeftHeader,
|
||||
.anims = gDummySpriteAnimTable,
|
||||
.images = NULL,
|
||||
.affineAnims = gDummySpriteAffineAnimTable,
|
||||
@ -292,22 +292,22 @@ static const struct SpriteTemplate sUnknown_0861FB44 =
|
||||
|
||||
bool32 InitPokenavMainMenu(void)
|
||||
{
|
||||
struct PokenavMainMenuResources *structPtr;
|
||||
struct Pokenav_MainMenu *menu;
|
||||
|
||||
structPtr = AllocSubstruct(POKENAV_SUBSTRUCT_MAIN_MENU, sizeof(struct PokenavMainMenuResources));
|
||||
if (structPtr == NULL)
|
||||
menu = AllocSubstruct(POKENAV_SUBSTRUCT_MAIN_MENU, sizeof(struct Pokenav_MainMenu));
|
||||
if (menu == NULL)
|
||||
return FALSE;
|
||||
|
||||
ResetSpriteData();
|
||||
FreeAllSpritePalettes();
|
||||
structPtr->currentTaskId = CreateLoopedTask(LoopedTask_InitPokenavMenu, 1);
|
||||
menu->currentTaskId = CreateLoopedTask(LoopedTask_InitPokenavMenu, 1);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
u32 PokenavMainMenuLoopedTaskIsActive(void)
|
||||
{
|
||||
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
return IsLoopedTaskActive(structPtr->currentTaskId);
|
||||
struct Pokenav_MainMenu *menu = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
return IsLoopedTaskActive(menu->currentTaskId);
|
||||
}
|
||||
|
||||
void ShutdownPokenav(void)
|
||||
@ -330,11 +330,11 @@ bool32 WaitForPokenavShutdownFade(void)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static u32 LoopedTask_InitPokenavMenu(s32 a0)
|
||||
static u32 LoopedTask_InitPokenavMenu(s32 state)
|
||||
{
|
||||
struct PokenavMainMenuResources *structPtr;
|
||||
struct Pokenav_MainMenu *menu;
|
||||
|
||||
switch (a0)
|
||||
switch (state)
|
||||
{
|
||||
case 0:
|
||||
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP);
|
||||
@ -345,9 +345,9 @@ static u32 LoopedTask_InitPokenavMenu(s32 a0)
|
||||
ResetTempTileDataBuffers();
|
||||
return LT_INC_AND_CONTINUE;
|
||||
case 1:
|
||||
structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
menu = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
DecompressAndCopyTileDataToVram(0, &gPokenavHeader_Gfx, 0, 0, 0);
|
||||
SetBgTilemapBuffer(0, structPtr->tilemapBuffer);
|
||||
SetBgTilemapBuffer(0, menu->tilemapBuffer);
|
||||
CopyToBgTilemapBuffer(0, &gPokenavHeader_Tilemap, 0, 0);
|
||||
CopyPaletteIntoBufferUnfaded(gPokenavHeader_Pal, 0, 0x20);
|
||||
CopyBgTilemapBufferToVram(0);
|
||||
@ -363,7 +363,7 @@ static u32 LoopedTask_InitPokenavMenu(s32 a0)
|
||||
return LT_PAUSE;
|
||||
|
||||
InitPokenavMainMenuResources();
|
||||
InitHoennMapHeaderSprites();
|
||||
CreateLeftHeaderSprites();
|
||||
ShowBg(0);
|
||||
return LT_FINISH;
|
||||
default:
|
||||
@ -373,46 +373,46 @@ static u32 LoopedTask_InitPokenavMenu(s32 a0)
|
||||
|
||||
void SetActiveMenuLoopTasks(void *createLoopTask, void *isLoopTaskActive) // Fix types later.
|
||||
{
|
||||
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
structPtr->loopTask = createLoopTask;
|
||||
structPtr->isLoopTaskActiveFunc = isLoopTaskActive;
|
||||
structPtr->unused = 0;
|
||||
struct Pokenav_MainMenu *menu = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
menu->loopTask = createLoopTask;
|
||||
menu->isLoopTaskActiveFunc = isLoopTaskActive;
|
||||
menu->unused = 0;
|
||||
}
|
||||
|
||||
void RunMainMenuLoopedTask(u32 a0)
|
||||
void RunMainMenuLoopedTask(u32 state)
|
||||
{
|
||||
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
structPtr->unused = 0;
|
||||
structPtr->loopTask(a0);
|
||||
struct Pokenav_MainMenu *menu = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
menu->unused = 0;
|
||||
menu->loopTask(state);
|
||||
}
|
||||
|
||||
u32 IsActiveMenuLoopTaskActive(void)
|
||||
{
|
||||
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
return structPtr->isLoopTaskActiveFunc();
|
||||
struct Pokenav_MainMenu *menu = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
return menu->isLoopTaskActiveFunc();
|
||||
}
|
||||
|
||||
void SlideMenuHeaderUp(void)
|
||||
{
|
||||
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
structPtr->currentTaskId = CreateLoopedTask(LoopedTask_SlideMenuHeaderUp, 4);
|
||||
struct Pokenav_MainMenu *menu = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
menu->currentTaskId = CreateLoopedTask(LoopedTask_SlideMenuHeaderUp, 4);
|
||||
}
|
||||
|
||||
void SlideMenuHeaderDown(void)
|
||||
{
|
||||
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
structPtr->currentTaskId = CreateLoopedTask(LoopedTask_SlideMenuHeaderDown, 4);
|
||||
struct Pokenav_MainMenu *menu = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
menu->currentTaskId = CreateLoopedTask(LoopedTask_SlideMenuHeaderDown, 4);
|
||||
}
|
||||
|
||||
bool32 MainMenuLoopedTaskIsBusy(void)
|
||||
{
|
||||
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
return IsLoopedTaskActive(structPtr->currentTaskId);
|
||||
struct Pokenav_MainMenu *menu = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
return IsLoopedTaskActive(menu->currentTaskId);
|
||||
}
|
||||
|
||||
static u32 LoopedTask_SlideMenuHeaderUp(s32 a0)
|
||||
static u32 LoopedTask_SlideMenuHeaderUp(s32 state)
|
||||
{
|
||||
switch (a0)
|
||||
switch (state)
|
||||
{
|
||||
default:
|
||||
return LT_FINISH;
|
||||
@ -431,7 +431,7 @@ static u32 LoopedTask_SlideMenuHeaderUp(s32 a0)
|
||||
}
|
||||
}
|
||||
|
||||
static u32 LoopedTask_SlideMenuHeaderDown(s32 a0)
|
||||
static u32 LoopedTask_SlideMenuHeaderDown(s32 state)
|
||||
{
|
||||
if (ChangeBgY(0, 384, BG_COORD_SUB) <= 0)
|
||||
{
|
||||
@ -510,15 +510,15 @@ void PokenavCopyPalette(const u16 *src, const u16 *dest, int size, int a3, int a
|
||||
|
||||
void PokenavFadeScreen(s32 fadeType)
|
||||
{
|
||||
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
struct Pokenav_MainMenu *menu = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
|
||||
switch (fadeType)
|
||||
{
|
||||
case 0:
|
||||
BeginNormalPaletteFade(structPtr->palettes, -2, 0, 16, RGB_BLACK);
|
||||
BeginNormalPaletteFade(menu->palettes, -2, 0, 16, RGB_BLACK);
|
||||
break;
|
||||
case 1:
|
||||
BeginNormalPaletteFade(structPtr->palettes, -2, 16, 0, RGB_BLACK);
|
||||
BeginNormalPaletteFade(menu->palettes, -2, 16, 0, RGB_BLACK);
|
||||
break;
|
||||
case 2:
|
||||
BeginNormalPaletteFade(PALETTES_ALL, -2, 0, 16, RGB_BLACK);
|
||||
@ -534,9 +534,10 @@ bool32 IsPaletteFadeActive(void)
|
||||
return gPaletteFade.active;
|
||||
}
|
||||
|
||||
void sub_81C7B40(void)
|
||||
// Excludes the first obj and bg palettes
|
||||
void FadeToBlackExceptPrimary(void)
|
||||
{
|
||||
BlendPalettes(PALETTES_ALL & ~(0x10000 | 0x1), 16, RGB_BLACK);
|
||||
BlendPalettes(PALETTES_ALL & ~(1 << 16 | 1), 16, RGB_BLACK);
|
||||
}
|
||||
|
||||
void InitBgTemplates(const struct BgTemplate *templates, int count)
|
||||
@ -549,21 +550,21 @@ void InitBgTemplates(const struct BgTemplate *templates, int count)
|
||||
|
||||
static void InitHelpBar(void)
|
||||
{
|
||||
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
struct Pokenav_MainMenu *menu = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
|
||||
InitWindows(&sHelpBarWindowTemplate[0]);
|
||||
structPtr->helpBarWindowId = 0;
|
||||
DrawHelpBar(structPtr->helpBarWindowId);
|
||||
PutWindowTilemap(structPtr->helpBarWindowId);
|
||||
CopyWindowToVram(structPtr->helpBarWindowId, COPYWIN_FULL);
|
||||
menu->helpBarWindowId = 0;
|
||||
DrawHelpBar(menu->helpBarWindowId);
|
||||
PutWindowTilemap(menu->helpBarWindowId);
|
||||
CopyWindowToVram(menu->helpBarWindowId, COPYWIN_FULL);
|
||||
}
|
||||
|
||||
void PrintHelpBarText(u32 textId)
|
||||
{
|
||||
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
struct Pokenav_MainMenu *menu = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
|
||||
DrawHelpBar(structPtr->helpBarWindowId);
|
||||
AddTextPrinterParameterized3(structPtr->helpBarWindowId, FONT_NORMAL, 0, 1, sHelpBarTextColors, 0, sHelpBarTexts[textId]);
|
||||
DrawHelpBar(menu->helpBarWindowId);
|
||||
AddTextPrinterParameterized3(menu->helpBarWindowId, FONT_NORMAL, 0, 1, sHelpBarTextColors, 0, sHelpBarTexts[textId]);
|
||||
}
|
||||
|
||||
bool32 WaitForHelpBar(void)
|
||||
@ -581,22 +582,22 @@ static void InitPokenavMainMenuResources(void)
|
||||
{
|
||||
s32 i;
|
||||
u8 spriteId;
|
||||
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
struct Pokenav_MainMenu *menu = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(gSpinningPokenavSpriteSheet); i++)
|
||||
LoadCompressedSpriteSheet(&gSpinningPokenavSpriteSheet[i]);
|
||||
|
||||
Pokenav_AllocAndLoadPalettes(gSpinningNavgearPalettes);
|
||||
structPtr->palettes = ~1 & ~(0x10000 << IndexOfSpritePaletteTag(0));
|
||||
menu->palettes = ~1 & ~(0x10000 << IndexOfSpritePaletteTag(0));
|
||||
spriteId = CreateSprite(&sSpinningPokenavSpriteTemplate, 220, 12, 0);
|
||||
structPtr->spinningPokenav = &gSprites[spriteId];
|
||||
menu->spinningPokenav = &gSprites[spriteId];
|
||||
}
|
||||
|
||||
static void CleanupPokenavMainMenuResources(void)
|
||||
{
|
||||
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
struct Pokenav_MainMenu *menu = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
|
||||
DestroySprite(structPtr->spinningPokenav);
|
||||
DestroySprite(menu->spinningPokenav);
|
||||
FreeSpriteTilesByTag(0);
|
||||
FreeSpritePaletteByTag(0);
|
||||
}
|
||||
@ -609,45 +610,47 @@ static void SpriteCB_SpinningPokenav(struct Sprite *sprite)
|
||||
|
||||
struct Sprite *PauseSpinningPokenavSprite(void)
|
||||
{
|
||||
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
struct Pokenav_MainMenu *menu = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
|
||||
structPtr->spinningPokenav->callback = SpriteCallbackDummy;
|
||||
return structPtr->spinningPokenav;
|
||||
menu->spinningPokenav->callback = SpriteCallbackDummy;
|
||||
return menu->spinningPokenav;
|
||||
}
|
||||
|
||||
void ResumeSpinningPokenavSprite(void)
|
||||
{
|
||||
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
struct Pokenav_MainMenu *menu = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
|
||||
structPtr->spinningPokenav->x = 220;
|
||||
structPtr->spinningPokenav->y = 12;
|
||||
structPtr->spinningPokenav->callback = SpriteCB_SpinningPokenav;
|
||||
structPtr->spinningPokenav->invisible = FALSE;
|
||||
structPtr->spinningPokenav->oam.priority = 0;
|
||||
structPtr->spinningPokenav->subpriority = 0;
|
||||
menu->spinningPokenav->x = 220;
|
||||
menu->spinningPokenav->y = 12;
|
||||
menu->spinningPokenav->callback = SpriteCB_SpinningPokenav;
|
||||
menu->spinningPokenav->invisible = FALSE;
|
||||
menu->spinningPokenav->oam.priority = 0;
|
||||
menu->spinningPokenav->subpriority = 0;
|
||||
}
|
||||
|
||||
static void InitHoennMapHeaderSprites(void)
|
||||
static void CreateLeftHeaderSprites(void)
|
||||
{
|
||||
s32 i, spriteId;
|
||||
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
struct Pokenav_MainMenu *menu = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
|
||||
LoadCompressedSpriteSheet(&sPokenavHoennMapLeftHeaderSpriteSheet);
|
||||
LoadCompressedSpriteSheet(&sMenuLeftHeaderSpriteSheet);
|
||||
AllocSpritePalette(1);
|
||||
AllocSpritePalette(2);
|
||||
for (i = 0; i < (s32)ARRAY_COUNT(structPtr->leftHeaderSprites); i++)
|
||||
for (i = 0; i < (s32)ARRAY_COUNT(menu->leftHeaderSprites); i++)
|
||||
{
|
||||
spriteId = CreateSprite(&sPokenavLeftHeaderHoennMapSpriteTemplate, 0, 0, 1);
|
||||
structPtr->leftHeaderSprites[i] = &gSprites[spriteId];
|
||||
structPtr->leftHeaderSprites[i]->invisible = TRUE;
|
||||
structPtr->leftHeaderSprites[i]->x2 = i * 64;
|
||||
// Create main left header
|
||||
spriteId = CreateSprite(&sLeftHeaderSpriteTemplate, 0, 0, 1);
|
||||
menu->leftHeaderSprites[i] = &gSprites[spriteId];
|
||||
menu->leftHeaderSprites[i]->invisible = TRUE;
|
||||
menu->leftHeaderSprites[i]->x2 = i * 64;
|
||||
|
||||
spriteId = CreateSprite(&sUnknown_0861FB44, 0, 0, 2);
|
||||
structPtr->submenuLeftHeaderSprites[i] = &gSprites[spriteId];
|
||||
structPtr->submenuLeftHeaderSprites[i]->invisible = TRUE;
|
||||
structPtr->submenuLeftHeaderSprites[i]->x2 = i * 32;
|
||||
structPtr->submenuLeftHeaderSprites[i]->y2 = 18;
|
||||
structPtr->submenuLeftHeaderSprites[i]->oam.tileNum += (i * 8) + 64;
|
||||
// Create submenu left header
|
||||
spriteId = CreateSprite(&sSubmenuLeftHeaderSpriteTemplate, 0, 0, 2);
|
||||
menu->submenuLeftHeaderSprites[i] = &gSprites[spriteId];
|
||||
menu->submenuLeftHeaderSprites[i]->invisible = TRUE;
|
||||
menu->submenuLeftHeaderSprites[i]->x2 = i * 32;
|
||||
menu->submenuLeftHeaderSprites[i]->y2 = 18;
|
||||
menu->submenuLeftHeaderSprites[i]->oam.tileNum += (i * 8) + 64;
|
||||
}
|
||||
}
|
||||
|
||||
@ -661,34 +664,34 @@ void LoadLeftHeaderGfxForIndex(u32 menuGfxId)
|
||||
|
||||
void UpdateRegionMapRightHeaderTiles(u32 menuGfxId)
|
||||
{
|
||||
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
struct Pokenav_MainMenu *menu = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
|
||||
if (menuGfxId == POKENAV_GFX_MAP_MENU_ZOOMED_OUT)
|
||||
structPtr->leftHeaderSprites[1]->oam.tileNum = GetSpriteTileStartByTag(2) + 32;
|
||||
menu->leftHeaderSprites[1]->oam.tileNum = GetSpriteTileStartByTag(2) + 32;
|
||||
else
|
||||
structPtr->leftHeaderSprites[1]->oam.tileNum = GetSpriteTileStartByTag(2) + 64;
|
||||
menu->leftHeaderSprites[1]->oam.tileNum = GetSpriteTileStartByTag(2) + 64;
|
||||
}
|
||||
|
||||
static void LoadLeftHeaderGfxForMenu(u32 menuGfxId)
|
||||
{
|
||||
struct PokenavMainMenuResources *structPtr;
|
||||
struct Pokenav_MainMenu *menu;
|
||||
u32 size, tag;
|
||||
|
||||
if (menuGfxId >= POKENAV_GFX_SUBMENUS_START)
|
||||
return;
|
||||
|
||||
structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
tag = sPokenavMenuLeftHeaderSpriteSheets[menuGfxId].tag;
|
||||
size = GetDecompressedDataSize(sPokenavMenuLeftHeaderSpriteSheets[menuGfxId].data);
|
||||
menu = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
tag = sMenuLeftHeaderSpriteSheets[menuGfxId].tag;
|
||||
size = GetDecompressedDataSize(sMenuLeftHeaderSpriteSheets[menuGfxId].data);
|
||||
LoadPalette(&gPokenavLeftHeader_Pal[tag * 16], (IndexOfSpritePaletteTag(1) * 16) + 0x100, 0x20);
|
||||
LZ77UnCompWram(sPokenavMenuLeftHeaderSpriteSheets[menuGfxId].data, gDecompressionBuffer);
|
||||
LZ77UnCompWram(sMenuLeftHeaderSpriteSheets[menuGfxId].data, gDecompressionBuffer);
|
||||
RequestDma3Copy(gDecompressionBuffer, (void *)OBJ_VRAM0 + (GetSpriteTileStartByTag(2) * 32), size, 1);
|
||||
structPtr->leftHeaderSprites[1]->oam.tileNum = GetSpriteTileStartByTag(2) + sPokenavMenuLeftHeaderSpriteSheets[menuGfxId].size;
|
||||
menu->leftHeaderSprites[1]->oam.tileNum = GetSpriteTileStartByTag(2) + sMenuLeftHeaderSpriteSheets[menuGfxId].size;
|
||||
|
||||
if (menuGfxId == POKENAV_GFX_MAP_MENU_ZOOMED_OUT || menuGfxId == POKENAV_GFX_MAP_MENU_ZOOMED_IN)
|
||||
structPtr->leftHeaderSprites[1]->x2 = 56;
|
||||
menu->leftHeaderSprites[1]->x2 = 56;
|
||||
else
|
||||
structPtr->leftHeaderSprites[1]->x2 = 64;
|
||||
menu->leftHeaderSprites[1]->x2 = 64;
|
||||
}
|
||||
|
||||
static void LoadLeftHeaderGfxForSubMenu(u32 menuGfxId)
|
||||
@ -731,20 +734,20 @@ void HideMainOrSubMenuLeftHeader(u32 id, bool32 onRightSide)
|
||||
void SetLeftHeaderSpritesInvisibility(void)
|
||||
{
|
||||
s32 i;
|
||||
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
struct Pokenav_MainMenu *menu = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
|
||||
for (i = 0; i < (s32)ARRAY_COUNT(structPtr->leftHeaderSprites); i++)
|
||||
for (i = 0; i < (s32)ARRAY_COUNT(menu->leftHeaderSprites); i++)
|
||||
{
|
||||
structPtr->leftHeaderSprites[i]->invisible = TRUE;
|
||||
structPtr->submenuLeftHeaderSprites[i]->invisible = TRUE;
|
||||
menu->leftHeaderSprites[i]->invisible = TRUE;
|
||||
menu->submenuLeftHeaderSprites[i]->invisible = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
bool32 AreLeftHeaderSpritesMoving(void)
|
||||
{
|
||||
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
struct Pokenav_MainMenu *menu = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
|
||||
if (structPtr->leftHeaderSprites[0]->callback == SpriteCallbackDummy && structPtr->submenuLeftHeaderSprites[0]->callback == SpriteCallbackDummy)
|
||||
if (menu->leftHeaderSprites[0]->callback == SpriteCallbackDummy && menu->submenuLeftHeaderSprites[0]->callback == SpriteCallbackDummy)
|
||||
return FALSE;
|
||||
else
|
||||
return TRUE;
|
||||
@ -753,66 +756,66 @@ bool32 AreLeftHeaderSpritesMoving(void)
|
||||
static void ShowLeftHeaderSprites(u32 startY, bool32 isOnRightSide)
|
||||
{
|
||||
s32 start, end, i;
|
||||
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
struct Pokenav_MainMenu *menu = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
|
||||
if (!isOnRightSide)
|
||||
start = -96, end = 32;
|
||||
else
|
||||
start = 256, end = 160;
|
||||
|
||||
for (i = 0; i < (s32)ARRAY_COUNT(structPtr->leftHeaderSprites); i++)
|
||||
for (i = 0; i < (s32)ARRAY_COUNT(menu->leftHeaderSprites); i++)
|
||||
{
|
||||
structPtr->leftHeaderSprites[i]->y = startY;
|
||||
MoveLeftHeader(structPtr->leftHeaderSprites[i], start, end, 12);
|
||||
menu->leftHeaderSprites[i]->y = startY;
|
||||
MoveLeftHeader(menu->leftHeaderSprites[i], start, end, 12);
|
||||
}
|
||||
}
|
||||
|
||||
static void ShowLeftHeaderSubmenuSprites(u32 startY, bool32 isOnRightSide)
|
||||
{
|
||||
s32 start, end, i;
|
||||
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
struct Pokenav_MainMenu *menu = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
|
||||
if (!isOnRightSide)
|
||||
start = -96, end = 16;
|
||||
else
|
||||
start = 256, end = 192;
|
||||
|
||||
for (i = 0; i < (s32)ARRAY_COUNT(structPtr->submenuLeftHeaderSprites); i++)
|
||||
for (i = 0; i < (s32)ARRAY_COUNT(menu->submenuLeftHeaderSprites); i++)
|
||||
{
|
||||
structPtr->submenuLeftHeaderSprites[i]->y = startY;
|
||||
MoveLeftHeader(structPtr->submenuLeftHeaderSprites[i], start, end, 12);
|
||||
menu->submenuLeftHeaderSprites[i]->y = startY;
|
||||
MoveLeftHeader(menu->submenuLeftHeaderSprites[i], start, end, 12);
|
||||
}
|
||||
}
|
||||
|
||||
static void HideLeftHeaderSprites(bool32 isOnRightSide)
|
||||
{
|
||||
s32 start, end, i;
|
||||
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
struct Pokenav_MainMenu *menu = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
|
||||
if (!isOnRightSide)
|
||||
start = 32, end = -96;
|
||||
else
|
||||
start = 192, end = 256;
|
||||
|
||||
for (i = 0; i < (s32)ARRAY_COUNT(structPtr->leftHeaderSprites); i++)
|
||||
for (i = 0; i < (s32)ARRAY_COUNT(menu->leftHeaderSprites); i++)
|
||||
{
|
||||
MoveLeftHeader(structPtr->leftHeaderSprites[i], start, end, 12);
|
||||
MoveLeftHeader(menu->leftHeaderSprites[i], start, end, 12);
|
||||
}
|
||||
}
|
||||
|
||||
static void HideLeftHeaderSubmenuSprites(bool32 isOnRightSide)
|
||||
{
|
||||
s32 start, end, i;
|
||||
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
struct Pokenav_MainMenu *menu = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
|
||||
|
||||
if (!isOnRightSide)
|
||||
start = 16, end = -96;
|
||||
else
|
||||
start = 192, end = 256;
|
||||
|
||||
for (i = 0; i < (s32)ARRAY_COUNT(structPtr->submenuLeftHeaderSprites); i++)
|
||||
for (i = 0; i < (s32)ARRAY_COUNT(menu->submenuLeftHeaderSprites); i++)
|
||||
{
|
||||
MoveLeftHeader(structPtr->submenuLeftHeaderSprites[i], start, end, 12);
|
||||
MoveLeftHeader(menu->submenuLeftHeaderSprites[i], start, end, 12);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -109,15 +109,15 @@ u32 ShowCheckPageDown(s32);
|
||||
u32 ExitCheckPage(s32);
|
||||
u32 ExitMatchCall(s32);
|
||||
|
||||
static const u16 sMatchCallUI_Pal[] = INCBIN_U16("graphics/pokenav/ui_matchcall.gbapal");
|
||||
static const u32 sMatchCallUI_Gfx[] = INCBIN_U32("graphics/pokenav/ui_matchcall.4bpp.lz");
|
||||
static const u32 sMatchCallUI_Tilemap[] = INCBIN_U32("graphics/pokenav/ui_matchcall.bin.lz");
|
||||
static const u16 gUnknown_08622698[] = INCBIN_U16("graphics/pokenav/arrow2.gbapal");
|
||||
static const u32 gUnknown_086226B8[] = INCBIN_U32("graphics/pokenav/arrow2.4bpp.lz");
|
||||
static const u16 gUnknown_086226E0[] = INCBIN_U16("graphics/pokenav/86226E0.gbapal");
|
||||
static const u16 gUnknown_08622700[] = INCBIN_U16("graphics/pokenav/8622700.gbapal");
|
||||
static const u16 gUnknown_08622720[] = INCBIN_U16("graphics/pokenav/pokeball_matchcall.gbapal");
|
||||
static const u32 gUnknown_08622760[] = INCBIN_U32("graphics/pokenav/pokeball_matchcall.4bpp.lz");
|
||||
static const u16 sMatchCallUI_Pal[] = INCBIN_U16("graphics/pokenav/match_call/ui.gbapal");
|
||||
static const u32 sMatchCallUI_Gfx[] = INCBIN_U32("graphics/pokenav/match_call/ui.4bpp.lz");
|
||||
static const u32 sMatchCallUI_Tilemap[] = INCBIN_U32("graphics/pokenav/match_call/ui.bin.lz");
|
||||
static const u16 gUnknown_08622698[] = INCBIN_U16("graphics/pokenav/match_call/arrow.gbapal");
|
||||
static const u32 gUnknown_086226B8[] = INCBIN_U32("graphics/pokenav/match_call/arrow.4bpp.lz");
|
||||
static const u16 gUnknown_086226E0[] = INCBIN_U16("graphics/pokenav/match_call/86226E0.gbapal");
|
||||
static const u16 gUnknown_08622700[] = INCBIN_U16("graphics/pokenav/match_call/8622700.gbapal");
|
||||
static const u16 gUnknown_08622720[] = INCBIN_U16("graphics/pokenav/match_call/pokeball.gbapal");
|
||||
static const u32 gUnknown_08622760[] = INCBIN_U32("graphics/pokenav/match_call/pokeball.4bpp.lz");
|
||||
|
||||
const struct BgTemplate sMatchCallBgTemplates[3] =
|
||||
{
|
||||
@ -1062,7 +1062,7 @@ static void sub_81CC034(struct Pokenav4Struct *state)
|
||||
{
|
||||
state->msgBoxWindowId = AddWindow(&sCallMsgBoxWindowTemplate);
|
||||
LoadMatchCallWindowGfx(state->msgBoxWindowId, 1, 4);
|
||||
sub_81C7B40();
|
||||
FadeToBlackExceptPrimary();
|
||||
}
|
||||
|
||||
static void DrawMsgBoxForMatchCallMsg(struct Pokenav4Struct *state)
|
||||
|
@ -94,8 +94,8 @@ u32 LoopedTask_sub_81C8870(s32 state);
|
||||
u32 LoopedTask_sub_81C8A28(s32 state);
|
||||
u32 LoopedTask_PrintCheckPageInfo(s32 state);
|
||||
|
||||
static const u16 sMatchcallArrowPaletteData[] = INCBIN_U16("graphics/pokenav/arrows_matchcall.gbapal");
|
||||
static const u32 sMatchcallArrowSpriteSheetData[] = INCBIN_U32("graphics/pokenav/arrows_matchcall.4bpp.lz");
|
||||
static const u16 sMatchcallArrowPaletteData[] = INCBIN_U16("graphics/pokenav/list_arrows.gbapal");
|
||||
static const u32 sMatchcallArrowSpriteSheetData[] = INCBIN_U32("graphics/pokenav/list_arrows.4bpp.lz");
|
||||
|
||||
EWRAM_DATA u32 gUnknown_0203CF44 = 0;
|
||||
|
||||
|
@ -5,31 +5,31 @@
|
||||
#include "sound.h"
|
||||
#include "constants/songs.h"
|
||||
|
||||
struct Pokenav1Struct
|
||||
struct Pokenav_Menu
|
||||
{
|
||||
u16 menuType;
|
||||
s16 cursorPos;
|
||||
u16 currMenuItem;
|
||||
u16 helpBarIndex;
|
||||
u32 menuId;
|
||||
u32 (*callback)(struct Pokenav1Struct*);
|
||||
u32 (*callback)(struct Pokenav_Menu*);
|
||||
};
|
||||
|
||||
static bool32 UpdateMenuCursorPos(struct Pokenav1Struct *state);
|
||||
static void ReturnToConditionMenu(struct Pokenav1Struct *state);
|
||||
static void ReturnToMainMenu(struct Pokenav1Struct *state);
|
||||
static u32 GetMenuId(struct Pokenav1Struct *state);
|
||||
static void SetMenuIdAndCB(struct Pokenav1Struct *state, u32 a1);
|
||||
static u32 CB2_ReturnToConditionMenu(struct Pokenav1Struct *state);
|
||||
static u32 CB2_ReturnToMainMenu(struct Pokenav1Struct *state);
|
||||
static u32 HandleConditionSearchMenuInput(struct Pokenav1Struct *state);
|
||||
static u32 HandleConditionMenuInput(struct Pokenav1Struct *state);
|
||||
static u32 HandleCantOpenRibbonsInput(struct Pokenav1Struct *state);
|
||||
static u32 HandleMainMenuInputEndTutorial(struct Pokenav1Struct *state);
|
||||
static u32 HandleMainMenuInputTutorial(struct Pokenav1Struct *state);
|
||||
static u32 HandleMainMenuInput(struct Pokenav1Struct *state);
|
||||
static u32 (*GetMainMenuInputHandler(void))(struct Pokenav1Struct*);
|
||||
static void SetMenuInputHandler(struct Pokenav1Struct *state);
|
||||
static bool32 UpdateMenuCursorPos(struct Pokenav_Menu *);
|
||||
static void ReturnToConditionMenu(struct Pokenav_Menu *);
|
||||
static void ReturnToMainMenu(struct Pokenav_Menu *);
|
||||
static u32 GetMenuId(struct Pokenav_Menu *);
|
||||
static void SetMenuIdAndCB(struct Pokenav_Menu *, u32);
|
||||
static u32 CB2_ReturnToConditionMenu(struct Pokenav_Menu *);
|
||||
static u32 CB2_ReturnToMainMenu(struct Pokenav_Menu *);
|
||||
static u32 HandleConditionSearchMenuInput(struct Pokenav_Menu *);
|
||||
static u32 HandleConditionMenuInput(struct Pokenav_Menu *);
|
||||
static u32 HandleCantOpenRibbonsInput(struct Pokenav_Menu *);
|
||||
static u32 HandleMainMenuInputEndTutorial(struct Pokenav_Menu *);
|
||||
static u32 HandleMainMenuInputTutorial(struct Pokenav_Menu *);
|
||||
static u32 HandleMainMenuInput(struct Pokenav_Menu *);
|
||||
static u32 (*GetMainMenuInputHandler(void))(struct Pokenav_Menu*);
|
||||
static void SetMenuInputHandler(struct Pokenav_Menu *);
|
||||
|
||||
// Number of entries - 1 for that menu type
|
||||
static const u8 sLastCursorPositions[] =
|
||||
@ -41,20 +41,20 @@ static const u8 sLastCursorPositions[] =
|
||||
[POKENAV_MENU_TYPE_CONDITION_SEARCH] = 5
|
||||
};
|
||||
|
||||
static const u8 sMenuItems[][6] =
|
||||
static const u8 sMenuItems[][MAX_POKENAV_MENUITEMS] =
|
||||
{
|
||||
[POKENAV_MENU_TYPE_DEFAULT] =
|
||||
{
|
||||
POKENAV_MENUITEM_MAP,
|
||||
POKENAV_MENUITEM_CONDITION,
|
||||
[2 ... 5] = POKENAV_MENUITEM_SWITCH_OFF
|
||||
[2 ... MAX_POKENAV_MENUITEMS - 1] = POKENAV_MENUITEM_SWITCH_OFF
|
||||
},
|
||||
[POKENAV_MENU_TYPE_UNLOCK_MC] =
|
||||
{
|
||||
POKENAV_MENUITEM_MAP,
|
||||
POKENAV_MENUITEM_CONDITION,
|
||||
POKENAV_MENUITEM_MATCH_CALL,
|
||||
[3 ... 5] = POKENAV_MENUITEM_SWITCH_OFF
|
||||
[3 ... MAX_POKENAV_MENUITEMS - 1] = POKENAV_MENUITEM_SWITCH_OFF
|
||||
},
|
||||
[POKENAV_MENU_TYPE_UNLOCK_MC_RIBBONS] =
|
||||
{
|
||||
@ -62,14 +62,14 @@ static const u8 sMenuItems[][6] =
|
||||
POKENAV_MENUITEM_CONDITION,
|
||||
POKENAV_MENUITEM_MATCH_CALL,
|
||||
POKENAV_MENUITEM_RIBBONS,
|
||||
[4 ... 5] = POKENAV_MENUITEM_SWITCH_OFF
|
||||
[4 ... MAX_POKENAV_MENUITEMS - 1] = POKENAV_MENUITEM_SWITCH_OFF
|
||||
},
|
||||
[POKENAV_MENU_TYPE_CONDITION] =
|
||||
{
|
||||
POKENAV_MENUITEM_CONDITION_PARTY,
|
||||
POKENAV_MENUITEM_CONDITION_SEARCH,
|
||||
POKENAV_MENUITEM_CONDITION_CANCEL,
|
||||
[3 ... 5] = POKENAV_MENUITEM_SWITCH_OFF
|
||||
[3 ... MAX_POKENAV_MENUITEMS - 1] = POKENAV_MENUITEM_SWITCH_OFF
|
||||
},
|
||||
[POKENAV_MENU_TYPE_CONDITION_SEARCH] =
|
||||
{
|
||||
@ -99,94 +99,94 @@ static u8 GetPokenavMainMenuType(void)
|
||||
|
||||
bool32 PokenavCallback_Init_MainMenuCursorOnMap(void)
|
||||
{
|
||||
struct Pokenav1Struct *state = AllocSubstruct(POKENAV_SUBSTRUCT_MAIN_MENU_HANDLER, sizeof(struct Pokenav1Struct));
|
||||
if (!state)
|
||||
struct Pokenav_Menu *menu = AllocSubstruct(POKENAV_SUBSTRUCT_MAIN_MENU_HANDLER, sizeof(struct Pokenav_Menu));
|
||||
if (!menu)
|
||||
return FALSE;
|
||||
|
||||
state->menuType = GetPokenavMainMenuType();
|
||||
state->cursorPos = POKENAV_MENUITEM_MAP;
|
||||
state->currMenuItem = POKENAV_MENUITEM_MAP;
|
||||
state->helpBarIndex = HELPBAR_NONE;
|
||||
SetMenuInputHandler(state);
|
||||
menu->menuType = GetPokenavMainMenuType();
|
||||
menu->cursorPos = POKENAV_MENUITEM_MAP;
|
||||
menu->currMenuItem = POKENAV_MENUITEM_MAP;
|
||||
menu->helpBarIndex = HELPBAR_NONE;
|
||||
SetMenuInputHandler(menu);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool32 PokenavCallback_Init_MainMenuCursorOnMatchCall(void)
|
||||
{
|
||||
struct Pokenav1Struct *state = AllocSubstruct(POKENAV_SUBSTRUCT_MAIN_MENU_HANDLER, sizeof(struct Pokenav1Struct));
|
||||
if (!state)
|
||||
struct Pokenav_Menu *menu = AllocSubstruct(POKENAV_SUBSTRUCT_MAIN_MENU_HANDLER, sizeof(struct Pokenav_Menu));
|
||||
if (!menu)
|
||||
return FALSE;
|
||||
|
||||
state->menuType = GetPokenavMainMenuType();
|
||||
state->cursorPos = POKENAV_MENUITEM_MATCH_CALL;
|
||||
state->currMenuItem = POKENAV_MENUITEM_MATCH_CALL;
|
||||
state->helpBarIndex = HELPBAR_NONE;
|
||||
SetMenuInputHandler(state);
|
||||
menu->menuType = GetPokenavMainMenuType();
|
||||
menu->cursorPos = POKENAV_MENUITEM_MATCH_CALL;
|
||||
menu->currMenuItem = POKENAV_MENUITEM_MATCH_CALL;
|
||||
menu->helpBarIndex = HELPBAR_NONE;
|
||||
SetMenuInputHandler(menu);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool32 PokenavCallback_Init_MainMenuCursorOnRibbons(void)
|
||||
{
|
||||
struct Pokenav1Struct *state = AllocSubstruct(POKENAV_SUBSTRUCT_MAIN_MENU_HANDLER, sizeof(struct Pokenav1Struct));
|
||||
if (!state)
|
||||
struct Pokenav_Menu *menu = AllocSubstruct(POKENAV_SUBSTRUCT_MAIN_MENU_HANDLER, sizeof(struct Pokenav_Menu));
|
||||
if (!menu)
|
||||
return FALSE;
|
||||
|
||||
state->menuType = GetPokenavMainMenuType();
|
||||
state->cursorPos = POKENAV_MENUITEM_RIBBONS;
|
||||
state->currMenuItem = POKENAV_MENUITEM_RIBBONS;
|
||||
SetMenuInputHandler(state);
|
||||
menu->menuType = GetPokenavMainMenuType();
|
||||
menu->cursorPos = POKENAV_MENUITEM_RIBBONS;
|
||||
menu->currMenuItem = POKENAV_MENUITEM_RIBBONS;
|
||||
SetMenuInputHandler(menu);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool32 PokenavCallback_Init_ConditionMenu(void)
|
||||
{
|
||||
struct Pokenav1Struct *state = AllocSubstruct(POKENAV_SUBSTRUCT_MAIN_MENU_HANDLER, sizeof(struct Pokenav1Struct));
|
||||
if (!state)
|
||||
struct Pokenav_Menu *menu = AllocSubstruct(POKENAV_SUBSTRUCT_MAIN_MENU_HANDLER, sizeof(struct Pokenav_Menu));
|
||||
if (!menu)
|
||||
return FALSE;
|
||||
|
||||
state->menuType = POKENAV_MENU_TYPE_CONDITION;
|
||||
state->cursorPos = 0; //party
|
||||
state->currMenuItem = POKENAV_MENUITEM_CONDITION_PARTY;
|
||||
state->helpBarIndex = HELPBAR_NONE;
|
||||
SetMenuInputHandler(state);
|
||||
menu->menuType = POKENAV_MENU_TYPE_CONDITION;
|
||||
menu->cursorPos = 0; //party
|
||||
menu->currMenuItem = POKENAV_MENUITEM_CONDITION_PARTY;
|
||||
menu->helpBarIndex = HELPBAR_NONE;
|
||||
SetMenuInputHandler(menu);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool32 PokenavCallback_Init_ConditionSearchMenu(void)
|
||||
{
|
||||
struct Pokenav1Struct *state = AllocSubstruct(POKENAV_SUBSTRUCT_MAIN_MENU_HANDLER, sizeof(struct Pokenav1Struct));
|
||||
if (!state)
|
||||
struct Pokenav_Menu *menu = AllocSubstruct(POKENAV_SUBSTRUCT_MAIN_MENU_HANDLER, sizeof(struct Pokenav_Menu));
|
||||
if (!menu)
|
||||
return FALSE;
|
||||
|
||||
state->menuType = POKENAV_MENU_TYPE_CONDITION_SEARCH;
|
||||
state->cursorPos = GetSelectedConditionSearch();
|
||||
state->currMenuItem = state->cursorPos + POKENAV_MENUITEM_CONDITION_SEARCH_COOL;
|
||||
state->helpBarIndex = HELPBAR_NONE;
|
||||
SetMenuInputHandler(state);
|
||||
menu->menuType = POKENAV_MENU_TYPE_CONDITION_SEARCH;
|
||||
menu->cursorPos = GetSelectedConditionSearch();
|
||||
menu->currMenuItem = menu->cursorPos + POKENAV_MENUITEM_CONDITION_SEARCH_COOL;
|
||||
menu->helpBarIndex = HELPBAR_NONE;
|
||||
SetMenuInputHandler(menu);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void SetMenuInputHandler(struct Pokenav1Struct *state)
|
||||
static void SetMenuInputHandler(struct Pokenav_Menu *menu)
|
||||
{
|
||||
switch (state->menuType)
|
||||
switch (menu->menuType)
|
||||
{
|
||||
case POKENAV_MENU_TYPE_DEFAULT:
|
||||
SetPokenavMode(POKENAV_MODE_NORMAL);
|
||||
// fallthrough
|
||||
case POKENAV_MENU_TYPE_UNLOCK_MC:
|
||||
case POKENAV_MENU_TYPE_UNLOCK_MC_RIBBONS:
|
||||
state->callback = GetMainMenuInputHandler();
|
||||
menu->callback = GetMainMenuInputHandler();
|
||||
break;
|
||||
case POKENAV_MENU_TYPE_CONDITION:
|
||||
state->callback = HandleConditionMenuInput;
|
||||
menu->callback = HandleConditionMenuInput;
|
||||
break;
|
||||
case POKENAV_MENU_TYPE_CONDITION_SEARCH:
|
||||
state->callback = HandleConditionSearchMenuInput;
|
||||
menu->callback = HandleConditionSearchMenuInput;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static u32 (*GetMainMenuInputHandler(void))(struct Pokenav1Struct*)
|
||||
static u32 (*GetMainMenuInputHandler(void))(struct Pokenav_Menu*)
|
||||
{
|
||||
switch (GetPokenavMode())
|
||||
{
|
||||
@ -202,8 +202,8 @@ static u32 (*GetMainMenuInputHandler(void))(struct Pokenav1Struct*)
|
||||
|
||||
u32 GetMenuHandlerCallback(void)
|
||||
{
|
||||
struct Pokenav1Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU_HANDLER);
|
||||
return state->callback(state);
|
||||
struct Pokenav_Menu *menu = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU_HANDLER);
|
||||
return menu->callback(menu);
|
||||
}
|
||||
|
||||
void FreeMenuHandlerSubstruct1(void)
|
||||
@ -211,39 +211,39 @@ void FreeMenuHandlerSubstruct1(void)
|
||||
FreePokenavSubstruct(POKENAV_SUBSTRUCT_MAIN_MENU_HANDLER);
|
||||
}
|
||||
|
||||
static u32 HandleMainMenuInput(struct Pokenav1Struct *state)
|
||||
static u32 HandleMainMenuInput(struct Pokenav_Menu *menu)
|
||||
{
|
||||
if (UpdateMenuCursorPos(state))
|
||||
if (UpdateMenuCursorPos(menu))
|
||||
return POKENAV_MENU_FUNC_MOVE_CURSOR;
|
||||
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
switch (sMenuItems[state->menuType][state->cursorPos])
|
||||
switch (sMenuItems[menu->menuType][menu->cursorPos])
|
||||
{
|
||||
case POKENAV_MENUITEM_MAP:
|
||||
state->helpBarIndex = gSaveBlock2Ptr->regionMapZoom ? HELPBAR_MAP_ZOOMED_IN : HELPBAR_MAP_ZOOMED_OUT;
|
||||
SetMenuIdAndCB(state, POKENAV_REGION_MAP);
|
||||
menu->helpBarIndex = gSaveBlock2Ptr->regionMapZoom ? HELPBAR_MAP_ZOOMED_IN : HELPBAR_MAP_ZOOMED_OUT;
|
||||
SetMenuIdAndCB(menu, POKENAV_REGION_MAP);
|
||||
return POKENAV_MENU_FUNC_OPEN_FEATURE;
|
||||
case POKENAV_MENUITEM_CONDITION:
|
||||
state->menuType = POKENAV_MENU_TYPE_CONDITION;
|
||||
state->cursorPos = 0;
|
||||
state->currMenuItem = sMenuItems[POKENAV_MENU_TYPE_CONDITION][0];
|
||||
state->callback = HandleConditionMenuInput;
|
||||
menu->menuType = POKENAV_MENU_TYPE_CONDITION;
|
||||
menu->cursorPos = 0;
|
||||
menu->currMenuItem = sMenuItems[POKENAV_MENU_TYPE_CONDITION][0];
|
||||
menu->callback = HandleConditionMenuInput;
|
||||
return POKENAV_MENU_FUNC_OPEN_CONDITION;
|
||||
case POKENAV_MENUITEM_MATCH_CALL:
|
||||
state->helpBarIndex = HELPBAR_MC_TRAINER_LIST;
|
||||
SetMenuIdAndCB(state, POKENAV_MATCH_CALL);
|
||||
menu->helpBarIndex = HELPBAR_MC_TRAINER_LIST;
|
||||
SetMenuIdAndCB(menu, POKENAV_MATCH_CALL);
|
||||
return POKENAV_MENU_FUNC_OPEN_FEATURE;
|
||||
case POKENAV_MENUITEM_RIBBONS:
|
||||
if (CanViewRibbonsMenu())
|
||||
{
|
||||
state->helpBarIndex = HELPBAR_RIBBONS_MON_LIST;
|
||||
SetMenuIdAndCB(state, POKENAV_RIBBONS_MON_LIST);
|
||||
menu->helpBarIndex = HELPBAR_RIBBONS_MON_LIST;
|
||||
SetMenuIdAndCB(menu, POKENAV_RIBBONS_MON_LIST);
|
||||
return POKENAV_MENU_FUNC_OPEN_FEATURE;
|
||||
}
|
||||
else
|
||||
{
|
||||
state->callback = HandleCantOpenRibbonsInput;
|
||||
menu->callback = HandleCantOpenRibbonsInput;
|
||||
return POKENAV_MENU_FUNC_NO_RIBBON_WINNERS;
|
||||
}
|
||||
case POKENAV_MENUITEM_SWITCH_OFF:
|
||||
@ -258,17 +258,17 @@ static u32 HandleMainMenuInput(struct Pokenav1Struct *state)
|
||||
}
|
||||
|
||||
// Force the player to select Match Call during the call Mr. Stone pokenav tutorial
|
||||
static u32 HandleMainMenuInputTutorial(struct Pokenav1Struct *state)
|
||||
static u32 HandleMainMenuInputTutorial(struct Pokenav_Menu *menu)
|
||||
{
|
||||
if (UpdateMenuCursorPos(state))
|
||||
if (UpdateMenuCursorPos(menu))
|
||||
return POKENAV_MENU_FUNC_MOVE_CURSOR;
|
||||
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
if (sMenuItems[state->menuType][state->cursorPos] == POKENAV_MENUITEM_MATCH_CALL)
|
||||
if (sMenuItems[menu->menuType][menu->cursorPos] == POKENAV_MENUITEM_MATCH_CALL)
|
||||
{
|
||||
state->helpBarIndex = HELPBAR_MC_TRAINER_LIST;
|
||||
SetMenuIdAndCB(state, POKENAV_MATCH_CALL);
|
||||
menu->helpBarIndex = HELPBAR_MC_TRAINER_LIST;
|
||||
SetMenuIdAndCB(menu, POKENAV_MATCH_CALL);
|
||||
return POKENAV_MENU_FUNC_OPEN_FEATURE;
|
||||
}
|
||||
else
|
||||
@ -288,14 +288,14 @@ static u32 HandleMainMenuInputTutorial(struct Pokenav1Struct *state)
|
||||
}
|
||||
|
||||
// After calling Mr. Stone during the pokenav tutorial, force player to exit or use Match Call again
|
||||
static u32 HandleMainMenuInputEndTutorial(struct Pokenav1Struct *state)
|
||||
static u32 HandleMainMenuInputEndTutorial(struct Pokenav_Menu *menu)
|
||||
{
|
||||
if (UpdateMenuCursorPos(state))
|
||||
if (UpdateMenuCursorPos(menu))
|
||||
return POKENAV_MENU_FUNC_MOVE_CURSOR;
|
||||
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
u32 menuItem = sMenuItems[state->menuType][state->cursorPos];
|
||||
u32 menuItem = sMenuItems[menu->menuType][menu->cursorPos];
|
||||
if (menuItem != POKENAV_MENUITEM_MATCH_CALL && menuItem != POKENAV_MENUITEM_SWITCH_OFF)
|
||||
{
|
||||
PlaySE(SE_FAILURE);
|
||||
@ -303,8 +303,8 @@ static u32 HandleMainMenuInputEndTutorial(struct Pokenav1Struct *state)
|
||||
}
|
||||
else if (menuItem == POKENAV_MENUITEM_MATCH_CALL)
|
||||
{
|
||||
state->helpBarIndex = HELPBAR_MC_TRAINER_LIST;
|
||||
SetMenuIdAndCB(state, POKENAV_MATCH_CALL);
|
||||
menu->helpBarIndex = HELPBAR_MC_TRAINER_LIST;
|
||||
SetMenuIdAndCB(menu, POKENAV_MATCH_CALL);
|
||||
return POKENAV_MENU_FUNC_OPEN_FEATURE;
|
||||
}
|
||||
else
|
||||
@ -321,60 +321,60 @@ static u32 HandleMainMenuInputEndTutorial(struct Pokenav1Struct *state)
|
||||
|
||||
// Handles input after selecting Ribbons when there are no ribbon winners left
|
||||
// Selecting it again just reprints the Ribbon description to replace the "No Ribbon winners" message
|
||||
static u32 HandleCantOpenRibbonsInput(struct Pokenav1Struct *state)
|
||||
static u32 HandleCantOpenRibbonsInput(struct Pokenav_Menu *menu)
|
||||
{
|
||||
if (UpdateMenuCursorPos(state))
|
||||
if (UpdateMenuCursorPos(menu))
|
||||
{
|
||||
state->callback = GetMainMenuInputHandler();
|
||||
menu->callback = GetMainMenuInputHandler();
|
||||
return POKENAV_MENU_FUNC_MOVE_CURSOR;
|
||||
}
|
||||
|
||||
if (JOY_NEW(A_BUTTON | B_BUTTON))
|
||||
{
|
||||
state->callback = GetMainMenuInputHandler();
|
||||
menu->callback = GetMainMenuInputHandler();
|
||||
return POKENAV_MENU_FUNC_RESHOW_DESCRIPTION;
|
||||
}
|
||||
|
||||
return POKENAV_MENU_FUNC_NONE;
|
||||
}
|
||||
|
||||
static u32 HandleConditionMenuInput(struct Pokenav1Struct *state)
|
||||
static u32 HandleConditionMenuInput(struct Pokenav_Menu *menu)
|
||||
{
|
||||
if (UpdateMenuCursorPos(state))
|
||||
if (UpdateMenuCursorPos(menu))
|
||||
return POKENAV_MENU_FUNC_MOVE_CURSOR;
|
||||
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
switch (sMenuItems[state->menuType][state->cursorPos])
|
||||
switch (sMenuItems[menu->menuType][menu->cursorPos])
|
||||
{
|
||||
case POKENAV_MENUITEM_CONDITION_SEARCH:
|
||||
state->menuType = POKENAV_MENU_TYPE_CONDITION_SEARCH;
|
||||
state->cursorPos = 0;
|
||||
state->currMenuItem = sMenuItems[POKENAV_MENU_TYPE_CONDITION_SEARCH][0];
|
||||
state->callback = HandleConditionSearchMenuInput;
|
||||
menu->menuType = POKENAV_MENU_TYPE_CONDITION_SEARCH;
|
||||
menu->cursorPos = 0;
|
||||
menu->currMenuItem = sMenuItems[POKENAV_MENU_TYPE_CONDITION_SEARCH][0];
|
||||
menu->callback = HandleConditionSearchMenuInput;
|
||||
return POKENAV_MENU_FUNC_OPEN_CONDITION_SEARCH;
|
||||
case POKENAV_MENUITEM_CONDITION_PARTY:
|
||||
state->helpBarIndex = 0;
|
||||
SetMenuIdAndCB(state, POKENAV_CONDITION_GRAPH_PARTY);
|
||||
menu->helpBarIndex = 0;
|
||||
SetMenuIdAndCB(menu, POKENAV_CONDITION_GRAPH_PARTY);
|
||||
return POKENAV_MENU_FUNC_OPEN_FEATURE;
|
||||
case POKENAV_MENUITEM_CONDITION_CANCEL:
|
||||
PlaySE(SE_SELECT);
|
||||
ReturnToMainMenu(state);
|
||||
ReturnToMainMenu(menu);
|
||||
return POKENAV_MENU_FUNC_RETURN_TO_MAIN;
|
||||
}
|
||||
}
|
||||
if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
if (state->cursorPos != sLastCursorPositions[state->menuType])
|
||||
if (menu->cursorPos != sLastCursorPositions[menu->menuType])
|
||||
{
|
||||
state->cursorPos = sLastCursorPositions[state->menuType];
|
||||
state->callback = CB2_ReturnToMainMenu;
|
||||
menu->cursorPos = sLastCursorPositions[menu->menuType];
|
||||
menu->callback = CB2_ReturnToMainMenu;
|
||||
return POKENAV_MENU_FUNC_MOVE_CURSOR;
|
||||
}
|
||||
else
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
ReturnToMainMenu(state);
|
||||
ReturnToMainMenu(menu);
|
||||
return POKENAV_MENU_FUNC_RETURN_TO_MAIN;
|
||||
}
|
||||
}
|
||||
@ -382,102 +382,102 @@ static u32 HandleConditionMenuInput(struct Pokenav1Struct *state)
|
||||
return POKENAV_MENU_FUNC_NONE;
|
||||
}
|
||||
|
||||
static u32 HandleConditionSearchMenuInput(struct Pokenav1Struct *state)
|
||||
static u32 HandleConditionSearchMenuInput(struct Pokenav_Menu *menu)
|
||||
{
|
||||
if (UpdateMenuCursorPos(state))
|
||||
if (UpdateMenuCursorPos(menu))
|
||||
return POKENAV_MENU_FUNC_MOVE_CURSOR;
|
||||
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
u8 menuItem = sMenuItems[state->menuType][state->cursorPos];
|
||||
u8 menuItem = sMenuItems[menu->menuType][menu->cursorPos];
|
||||
if (menuItem != POKENAV_MENUITEM_CONDITION_SEARCH_CANCEL)
|
||||
{
|
||||
SetSelectedConditionSearch(menuItem - POKENAV_MENUITEM_CONDITION_SEARCH_COOL);
|
||||
SetMenuIdAndCB(state, POKENAV_CONDITION_SEARCH_RESULTS);
|
||||
state->helpBarIndex = HELPBAR_CONDITION_MON_LIST;
|
||||
SetMenuIdAndCB(menu, POKENAV_CONDITION_SEARCH_RESULTS);
|
||||
menu->helpBarIndex = HELPBAR_CONDITION_MON_LIST;
|
||||
return POKENAV_MENU_FUNC_OPEN_FEATURE;
|
||||
}
|
||||
else
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
ReturnToConditionMenu(state);
|
||||
ReturnToConditionMenu(menu);
|
||||
return POKENAV_MENU_FUNC_RETURN_TO_CONDITION;
|
||||
}
|
||||
}
|
||||
if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
if (state->cursorPos != sLastCursorPositions[state->menuType])
|
||||
if (menu->cursorPos != sLastCursorPositions[menu->menuType])
|
||||
{
|
||||
state->cursorPos = sLastCursorPositions[state->menuType];
|
||||
state->callback = CB2_ReturnToConditionMenu;
|
||||
menu->cursorPos = sLastCursorPositions[menu->menuType];
|
||||
menu->callback = CB2_ReturnToConditionMenu;
|
||||
return POKENAV_MENU_FUNC_MOVE_CURSOR;
|
||||
}
|
||||
else
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
ReturnToConditionMenu(state);
|
||||
ReturnToConditionMenu(menu);
|
||||
return POKENAV_MENU_FUNC_RETURN_TO_CONDITION;
|
||||
}
|
||||
}
|
||||
return POKENAV_MENU_FUNC_NONE;
|
||||
}
|
||||
|
||||
static u32 CB2_ReturnToMainMenu(struct Pokenav1Struct *state)
|
||||
static u32 CB2_ReturnToMainMenu(struct Pokenav_Menu *menu)
|
||||
{
|
||||
ReturnToMainMenu(state);
|
||||
ReturnToMainMenu(menu);
|
||||
return POKENAV_MENU_FUNC_RETURN_TO_MAIN;
|
||||
}
|
||||
|
||||
static u32 CB2_ReturnToConditionMenu(struct Pokenav1Struct *state)
|
||||
static u32 CB2_ReturnToConditionMenu(struct Pokenav_Menu *menu)
|
||||
{
|
||||
ReturnToConditionMenu(state);
|
||||
ReturnToConditionMenu(menu);
|
||||
return POKENAV_MENU_FUNC_RETURN_TO_CONDITION;
|
||||
}
|
||||
|
||||
static void SetMenuIdAndCB(struct Pokenav1Struct *state, u32 menuId)
|
||||
static void SetMenuIdAndCB(struct Pokenav_Menu *menu, u32 menuId)
|
||||
{
|
||||
state->menuId = menuId;
|
||||
state->callback = GetMenuId;
|
||||
menu->menuId = menuId;
|
||||
menu->callback = GetMenuId;
|
||||
}
|
||||
|
||||
static u32 GetMenuId(struct Pokenav1Struct *state)
|
||||
static u32 GetMenuId(struct Pokenav_Menu *menu)
|
||||
{
|
||||
return state->menuId;
|
||||
return menu->menuId;
|
||||
}
|
||||
|
||||
static void ReturnToMainMenu(struct Pokenav1Struct *state)
|
||||
static void ReturnToMainMenu(struct Pokenav_Menu *menu)
|
||||
{
|
||||
state->menuType = GetPokenavMainMenuType();
|
||||
state->cursorPos = 1;
|
||||
state->currMenuItem = sMenuItems[state->menuType][state->cursorPos];
|
||||
state->callback = HandleMainMenuInput;
|
||||
menu->menuType = GetPokenavMainMenuType();
|
||||
menu->cursorPos = 1;
|
||||
menu->currMenuItem = sMenuItems[menu->menuType][menu->cursorPos];
|
||||
menu->callback = HandleMainMenuInput;
|
||||
}
|
||||
|
||||
static void ReturnToConditionMenu(struct Pokenav1Struct *state)
|
||||
static void ReturnToConditionMenu(struct Pokenav_Menu *menu)
|
||||
{
|
||||
state->menuType = POKENAV_MENU_TYPE_CONDITION;
|
||||
state->cursorPos = 1;
|
||||
state->currMenuItem = sMenuItems[POKENAV_MENU_TYPE_CONDITION][1];
|
||||
state->callback = HandleConditionMenuInput;
|
||||
menu->menuType = POKENAV_MENU_TYPE_CONDITION;
|
||||
menu->cursorPos = 1;
|
||||
menu->currMenuItem = sMenuItems[POKENAV_MENU_TYPE_CONDITION][1];
|
||||
menu->callback = HandleConditionMenuInput;
|
||||
}
|
||||
|
||||
static bool32 UpdateMenuCursorPos(struct Pokenav1Struct *state)
|
||||
static bool32 UpdateMenuCursorPos(struct Pokenav_Menu *menu)
|
||||
{
|
||||
if (JOY_NEW(DPAD_UP))
|
||||
{
|
||||
if (--state->cursorPos < 0)
|
||||
state->cursorPos = sLastCursorPositions[state->menuType];
|
||||
if (--menu->cursorPos < 0)
|
||||
menu->cursorPos = sLastCursorPositions[menu->menuType];
|
||||
|
||||
state->currMenuItem = sMenuItems[state->menuType][state->cursorPos];
|
||||
menu->currMenuItem = sMenuItems[menu->menuType][menu->cursorPos];
|
||||
return TRUE;
|
||||
}
|
||||
else if (JOY_NEW(DPAD_DOWN))
|
||||
{
|
||||
state->cursorPos++;
|
||||
if (state->cursorPos > sLastCursorPositions[state->menuType])
|
||||
state->cursorPos = 0;
|
||||
menu->cursorPos++;
|
||||
if (menu->cursorPos > sLastCursorPositions[menu->menuType])
|
||||
menu->cursorPos = 0;
|
||||
|
||||
state->currMenuItem = sMenuItems[state->menuType][state->cursorPos];
|
||||
menu->currMenuItem = sMenuItems[menu->menuType][menu->cursorPos];
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
@ -488,26 +488,26 @@ static bool32 UpdateMenuCursorPos(struct Pokenav1Struct *state)
|
||||
|
||||
int GetPokenavMenuType(void)
|
||||
{
|
||||
struct Pokenav1Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU_HANDLER);
|
||||
return state->menuType;
|
||||
struct Pokenav_Menu *menu = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU_HANDLER);
|
||||
return menu->menuType;
|
||||
}
|
||||
|
||||
// Position of cursor relative to number of current menu options
|
||||
int GetPokenavCursorPos(void)
|
||||
{
|
||||
struct Pokenav1Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU_HANDLER);
|
||||
return state->cursorPos;
|
||||
struct Pokenav_Menu *menu = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU_HANDLER);
|
||||
return menu->cursorPos;
|
||||
}
|
||||
|
||||
// ID of menu item the cursor is currently on
|
||||
int GetCurrentMenuItemId(void)
|
||||
{
|
||||
struct Pokenav1Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU_HANDLER);
|
||||
return state->currMenuItem;
|
||||
struct Pokenav_Menu *menu = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU_HANDLER);
|
||||
return menu->currMenuItem;
|
||||
}
|
||||
|
||||
u16 GetHelpBarTextId(void)
|
||||
{
|
||||
struct Pokenav1Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU_HANDLER);
|
||||
return state->helpBarIndex;
|
||||
struct Pokenav_Menu *menu = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU_HANDLER);
|
||||
return menu->helpBarIndex;
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ static u32 LoopedTask_ExitRegionMap(s32);
|
||||
extern const u16 gRegionMapCityZoomTiles_Pal[];
|
||||
extern const u32 gRegionMapCityZoomText_Gfx[];
|
||||
|
||||
static const u16 sMapSecInfoWindow_Pal[] = INCBIN_U16("graphics/pokenav/region_map_info_window.gbapal");
|
||||
static const u16 sMapSecInfoWindow_Pal[] = INCBIN_U16("graphics/pokenav/region_map/info_window.gbapal");
|
||||
static const u32 sRegionMapCityZoomTiles_Gfx[] = INCBIN_U32("graphics/pokenav/zoom_tiles.4bpp.lz");
|
||||
|
||||
#include "data/region_map/city_map_tilemaps.h"
|
||||
@ -346,7 +346,7 @@ static u32 LoopedTask_OpenRegionMap(s32 taskState)
|
||||
return LT_PAUSE;
|
||||
|
||||
UpdateMapSecInfoWindow(state);
|
||||
sub_81C7B40();
|
||||
FadeToBlackExceptPrimary();
|
||||
return LT_INC_AND_PAUSE;
|
||||
case 5:
|
||||
if (IsDma3ManagerBusyWithBgCopy_(state))
|
||||
|
@ -116,19 +116,18 @@ static void CB_FadeInFlyMap(void);
|
||||
static void CB_HandleFlyMapInput(void);
|
||||
static void CB_ExitFlyMap(void);
|
||||
|
||||
// .rodata
|
||||
|
||||
static const u16 sRegionMapCursorPal[] = INCBIN_U16("graphics/pokenav/cursor.gbapal");
|
||||
static const u32 sRegionMapCursorSmallGfxLZ[] = INCBIN_U32("graphics/pokenav/cursor_small.4bpp.lz");
|
||||
static const u32 sRegionMapCursorLargeGfxLZ[] = INCBIN_U32("graphics/pokenav/cursor_large.4bpp.lz");
|
||||
// NOTE: Some of the below graphics are not in graphics/pokenav/region_map
|
||||
// because porymap expects them to be in their current location.
|
||||
static const u16 sRegionMapCursorPal[] = INCBIN_U16("graphics/pokenav/region_map/cursor.gbapal");
|
||||
static const u32 sRegionMapCursorSmallGfxLZ[] = INCBIN_U32("graphics/pokenav/region_map/cursor_small.4bpp.lz");
|
||||
static const u32 sRegionMapCursorLargeGfxLZ[] = INCBIN_U32("graphics/pokenav/region_map/cursor_large.4bpp.lz");
|
||||
static const u16 sRegionMapBg_Pal[] = INCBIN_U16("graphics/pokenav/region_map.gbapal");
|
||||
static const u32 sRegionMapBg_GfxLZ[] = INCBIN_U32("graphics/pokenav/region_map.8bpp.lz");
|
||||
static const u32 sRegionMapBg_TilemapLZ[] = INCBIN_U32("graphics/pokenav/region_map_map.bin.lz");
|
||||
static const u16 sRegionMapPlayerIcon_BrendanPal[] = INCBIN_U16("graphics/pokenav/brendan_icon.gbapal");
|
||||
static const u8 sRegionMapPlayerIcon_BrendanGfx[] = INCBIN_U8("graphics/pokenav/brendan_icon.4bpp");
|
||||
static const u16 sRegionMapPlayerIcon_MayPal[] = INCBIN_U16("graphics/pokenav/may_icon.gbapal");
|
||||
static const u8 sRegionMapPlayerIcon_MayGfx[] = INCBIN_U8("graphics/pokenav/may_icon.4bpp");
|
||||
|
||||
static const u16 sRegionMapPlayerIcon_BrendanPal[] = INCBIN_U16("graphics/pokenav/region_map/brendan_icon.gbapal");
|
||||
static const u8 sRegionMapPlayerIcon_BrendanGfx[] = INCBIN_U8("graphics/pokenav/region_map/brendan_icon.4bpp");
|
||||
static const u16 sRegionMapPlayerIcon_MayPal[] = INCBIN_U16("graphics/pokenav/region_map/may_icon.gbapal");
|
||||
static const u8 sRegionMapPlayerIcon_MayGfx[] = INCBIN_U8("graphics/pokenav/region_map/may_icon.4bpp");
|
||||
static const u8 sRegionMap_MapSectionLayout[] = INCBIN_U8("graphics/pokenav/region_map_section_layout.bin");
|
||||
|
||||
#include "data/region_map/region_map_entries.h"
|
||||
@ -283,15 +282,11 @@ static const u8 sMapSecIdsOffMap[] =
|
||||
MAPSEC_NAVEL_ROCK
|
||||
};
|
||||
|
||||
static const u16 sRegionMapFramePal[] = INCBIN_U16("graphics/pokenav/map_frame.gbapal");
|
||||
|
||||
static const u32 sRegionMapFrameGfxLZ[] = INCBIN_U32("graphics/pokenav/map_frame.4bpp.lz");
|
||||
|
||||
static const u32 sRegionMapFrameTilemapLZ[] = INCBIN_U32("graphics/pokenav/map_frame.bin.lz");
|
||||
|
||||
static const u16 sFlyTargetIcons_Pal[] = INCBIN_U16("graphics/pokenav/fly_target_icons.gbapal");
|
||||
|
||||
static const u32 sFlyTargetIcons_Gfx[] = INCBIN_U32("graphics/pokenav/fly_target_icons.4bpp.lz");
|
||||
static const u16 sRegionMapFramePal[] = INCBIN_U16("graphics/pokenav/region_map/frame.gbapal");
|
||||
static const u32 sRegionMapFrameGfxLZ[] = INCBIN_U32("graphics/pokenav/region_map/frame.4bpp.lz");
|
||||
static const u32 sRegionMapFrameTilemapLZ[] = INCBIN_U32("graphics/pokenav/region_map/frame.bin.lz");
|
||||
static const u16 sFlyTargetIcons_Pal[] = INCBIN_U16("graphics/pokenav/region_map/fly_target_icons.gbapal");
|
||||
static const u32 sFlyTargetIcons_Gfx[] = INCBIN_U32("graphics/pokenav/region_map/fly_target_icons.4bpp.lz");
|
||||
|
||||
static const u8 sMapHealLocations[][3] =
|
||||
{
|
||||
|