Start match call menu doc

This commit is contained in:
GriffinR 2021-11-12 17:28:06 -05:00
parent ffe2970e30
commit da5752fd0d
12 changed files with 452 additions and 423 deletions

View File

Before

Width:  |  Height:  |  Size: 153 B

After

Width:  |  Height:  |  Size: 153 B

View File

@ -276,7 +276,7 @@ enum
POKENAV_MC_FUNC_CANCEL, POKENAV_MC_FUNC_CANCEL,
POKENAV_MC_FUNC_CALL_MSG, POKENAV_MC_FUNC_CALL_MSG,
POKENAV_MC_FUNC_NEARBY_MSG, POKENAV_MC_FUNC_NEARBY_MSG,
POKENAV_MC_FUNC_10, POKENAV_MC_FUNC_EXIT_CALL,
POKENAV_MC_FUNC_SHOW_CHECK_PAGE, POKENAV_MC_FUNC_SHOW_CHECK_PAGE,
POKENAV_MC_FUNC_CHECK_PAGE_UP, POKENAV_MC_FUNC_CHECK_PAGE_UP,
POKENAV_MC_FUNC_CHECK_PAGE_DOWN, POKENAV_MC_FUNC_CHECK_PAGE_DOWN,
@ -293,6 +293,14 @@ enum
POKENAV_MAP_FUNC_EXIT, POKENAV_MAP_FUNC_EXIT,
}; };
// Modes for PokenavFadeScreen
enum {
POKENAV_FADE_TO_BLACK,
POKENAV_FADE_FROM_BLACK,
POKENAV_FADE_TO_BLACK_ALL,
POKENAV_FADE_FROM_BLACK_ALL,
};
// pokenav.c // pokenav.c
void SetSelectedConditionSearch(u32); void SetSelectedConditionSearch(u32);
u32 GetSelectedConditionSearch(void); u32 GetSelectedConditionSearch(void);
@ -359,8 +367,8 @@ bool32 MainMenuLoopedTaskIsBusy(void);
void SetLeftHeaderSpritesInvisibility(void); void SetLeftHeaderSpritesInvisibility(void);
void PokenavCopyPalette(const u16 *a0, const u16 *a1, int a2, int a3, int a4, u16 *palette); void PokenavCopyPalette(const u16 *a0, const u16 *a1, int a2, int a3, int a4, u16 *palette);
void FadeToBlackExceptPrimary(void); void FadeToBlackExceptPrimary(void);
struct Sprite *PauseSpinningPokenavSprite(void); struct Sprite *GetSpinningPokenavSprite(void);
void ResumeSpinningPokenavSprite(void); void HideSpinningPokenavSprite(void);
void UpdateRegionMapRightHeaderTiles(u32 arg0); void UpdateRegionMapRightHeaderTiles(u32 arg0);
void HideMainOrSubMenuLeftHeader(u32 id, bool32 onRightSide); void HideMainOrSubMenuLeftHeader(u32 id, bool32 onRightSide);
void SlideMenuHeaderUp(void); void SlideMenuHeaderUp(void);

View File

@ -295,7 +295,7 @@ static u32 LoopedTask_OpenConditionGraphMenu(s32 state)
PrintHelpBarText(HELPBAR_CONDITION_MON_STATUS); PrintHelpBarText(HELPBAR_CONDITION_MON_STATUS);
return LT_INC_AND_PAUSE; return LT_INC_AND_PAUSE;
case 15: case 15:
PokenavFadeScreen(1); PokenavFadeScreen(POKENAV_FADE_FROM_BLACK);
if (!IsConditionMenuSearchMode()) if (!IsConditionMenuSearchMode())
{ {
LoadLeftHeaderGfxForIndex(POKENAV_GFX_PARTY_MENU); LoadLeftHeaderGfxForIndex(POKENAV_GFX_PARTY_MENU);
@ -352,7 +352,7 @@ static u32 LoopedTask_ExitConditionGraphMenu(s32 state)
ToggleGraphData(FALSE); ToggleGraphData(FALSE);
return LT_INC_AND_CONTINUE; return LT_INC_AND_CONTINUE;
case 2: case 2:
PokenavFadeScreen(0); PokenavFadeScreen(POKENAV_FADE_TO_BLACK);
if (!IsConditionMenuSearchMode()) if (!IsConditionMenuSearchMode())
SlideMenuHeaderDown(); SlideMenuHeaderDown();
return LT_INC_AND_PAUSE; return LT_INC_AND_PAUSE;

View File

@ -467,7 +467,7 @@ static u32 LoopedTask_OpenConditionSearchResults(s32 state)
ShowLeftHeaderGfx(searchGfxId, 1, 0); ShowLeftHeaderGfx(searchGfxId, 1, 0);
ShowLeftHeaderGfx(POKENAV_GFX_CONDITION_MENU, 1, 0); ShowLeftHeaderGfx(POKENAV_GFX_CONDITION_MENU, 1, 0);
} }
PokenavFadeScreen(1); PokenavFadeScreen(POKENAV_FADE_FROM_BLACK);
return LT_INC_AND_PAUSE; return LT_INC_AND_PAUSE;
case 5: case 5:
if (IsPaletteFadeActive()) if (IsPaletteFadeActive())
@ -617,7 +617,7 @@ static u32 LoopedTask_ExitConditionSearchMenu(s32 state)
{ {
case 0: case 0:
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
PokenavFadeScreen(0); PokenavFadeScreen(POKENAV_FADE_TO_BLACK);
SlideMenuHeaderDown(); SlideMenuHeaderDown();
return LT_INC_AND_PAUSE; return LT_INC_AND_PAUSE;
case 1: case 1:
@ -637,7 +637,7 @@ static u32 LoopedTask_SelectSearchResult(s32 state)
{ {
case 0: case 0:
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
PokenavFadeScreen(0); PokenavFadeScreen(POKENAV_FADE_TO_BLACK);
return LT_INC_AND_PAUSE; return LT_INC_AND_PAUSE;
case 1: case 1:
if (IsPaletteFadeActive()) if (IsPaletteFadeActive())

View File

@ -473,7 +473,6 @@ void PokenavFillPalette(u32 palIndex, u16 fillValue)
void PokenavCopyPalette(const u16 *src, const u16 *dest, int size, int a3, int a4, u16 *palette) void PokenavCopyPalette(const u16 *src, const u16 *dest, int size, int a3, int a4, u16 *palette)
{ {
if (a4 == 0) if (a4 == 0)
{ {
CpuCopy16(src, palette, size * 2); CpuCopy16(src, palette, size * 2);
@ -496,11 +495,11 @@ void PokenavCopyPalette(const u16 *src, const u16 *dest, int size, int a3, int a
g1 = ((((GET_G(*dest) << 8) - (g << 8)) / a3) * a4) >> 8; g1 = ((((GET_G(*dest) << 8) - (g << 8)) / a3) * a4) >> 8;
b1 = ((((GET_B(*dest) << 8) - (b << 8)) / a3) * a4) >> 8; b1 = ((((GET_B(*dest) << 8) - (b << 8)) / a3) * a4) >> 8;
r = (r + r1) & 0x1F; //_RGB(r + r1, g + g1, b + b1); doesn't match; I have to assign the value of ((r + r1) & 0x1F) to r r = (r + r1) & 0x1F; //_RGB(r + r1, g + g1, b + b1); doesn't match
g = (g + g1) & 0x1F; //See above g = (g + g1) & 0x1F;
b = (b + b1) & 0x1F; //See above b = (b + b1) & 0x1F;
*palette = RGB2(r, g, b); //See above comment *palette = RGB2(r, g, b);
src++, dest++; src++, dest++;
palette++; palette++;
@ -514,16 +513,16 @@ void PokenavFadeScreen(s32 fadeType)
switch (fadeType) switch (fadeType)
{ {
case 0: case POKENAV_FADE_TO_BLACK:
BeginNormalPaletteFade(menu->palettes, -2, 0, 16, RGB_BLACK); BeginNormalPaletteFade(menu->palettes, -2, 0, 16, RGB_BLACK);
break; break;
case 1: case POKENAV_FADE_FROM_BLACK:
BeginNormalPaletteFade(menu->palettes, -2, 16, 0, RGB_BLACK); BeginNormalPaletteFade(menu->palettes, -2, 16, 0, RGB_BLACK);
break; break;
case 2: case POKENAV_FADE_TO_BLACK_ALL:
BeginNormalPaletteFade(PALETTES_ALL, -2, 0, 16, RGB_BLACK); BeginNormalPaletteFade(PALETTES_ALL, -2, 0, 16, RGB_BLACK);
break; break;
case 3: case POKENAV_FADE_FROM_BLACK_ALL:
BeginNormalPaletteFade(PALETTES_ALL, -2, 16, 0, RGB_BLACK); BeginNormalPaletteFade(PALETTES_ALL, -2, 16, 0, RGB_BLACK);
break; break;
} }
@ -608,7 +607,7 @@ static void SpriteCB_SpinningPokenav(struct Sprite *sprite)
sprite->y2 = (GetBgY(0) / 256u) * -1; sprite->y2 = (GetBgY(0) / 256u) * -1;
} }
struct Sprite *PauseSpinningPokenavSprite(void) struct Sprite *GetSpinningPokenavSprite(void)
{ {
struct Pokenav_MainMenu *menu = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU); struct Pokenav_MainMenu *menu = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
@ -616,10 +615,11 @@ struct Sprite *PauseSpinningPokenavSprite(void)
return menu->spinningPokenav; return menu->spinningPokenav;
} }
void ResumeSpinningPokenavSprite(void) void HideSpinningPokenavSprite(void)
{ {
struct Pokenav_MainMenu *menu = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU); struct Pokenav_MainMenu *menu = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
// Move sprite so it's no longer visible
menu->spinningPokenav->x = 220; menu->spinningPokenav->x = 220;
menu->spinningPokenav->y = 12; menu->spinningPokenav->y = 12;
menu->spinningPokenav->callback = SpriteCB_SpinningPokenav; menu->spinningPokenav->callback = SpriteCB_SpinningPokenav;

View File

@ -32,9 +32,9 @@ static u32 CB2_HandleMatchCallInput(struct Pokenav3Struct *);
static u32 GetExitMatchCallMenuId(struct Pokenav3Struct *); static u32 GetExitMatchCallMenuId(struct Pokenav3Struct *);
static u32 CB2_HandleMatchCallOptionsInput(struct Pokenav3Struct *); static u32 CB2_HandleMatchCallOptionsInput(struct Pokenav3Struct *);
static u32 CB2_HandleCheckPageInput(struct Pokenav3Struct *); static u32 CB2_HandleCheckPageInput(struct Pokenav3Struct *);
static u32 CB2_HandleCallInput(struct Pokenav3Struct *); static u32 CB2_HandleCallExitInput(struct Pokenav3Struct *);
static u32 sub_81CAD20(s32); static u32 sub_81CAD20(s32);
static bool32 sub_81CB1D0(void); static bool32 ShouldDoNearbyMessage(void);
#include "data/text/match_call_messages.h" #include "data/text/match_call_messages.h"
@ -155,8 +155,8 @@ static u32 CB2_HandleMatchCallOptionsInput(struct Pokenav3Struct *state)
if (GetPokenavMode() == POKENAV_MODE_FORCE_CALL_READY) if (GetPokenavMode() == POKENAV_MODE_FORCE_CALL_READY)
SetPokenavMode(POKENAV_MODE_FORCE_CALL_EXIT); SetPokenavMode(POKENAV_MODE_FORCE_CALL_EXIT);
state->callback = CB2_HandleCallInput; state->callback = CB2_HandleCallExitInput;
if (sub_81CB1D0()) if (ShouldDoNearbyMessage())
return POKENAV_MC_FUNC_NEARBY_MSG; return POKENAV_MC_FUNC_NEARBY_MSG;
return POKENAV_MC_FUNC_CALL_MSG; return POKENAV_MC_FUNC_CALL_MSG;
@ -191,12 +191,12 @@ static u32 CB2_HandleCheckPageInput(struct Pokenav3Struct *state)
return POKENAV_MC_FUNC_NONE; return POKENAV_MC_FUNC_NONE;
} }
static u32 CB2_HandleCallInput(struct Pokenav3Struct *state) static u32 CB2_HandleCallExitInput(struct Pokenav3Struct *state)
{ {
if (JOY_NEW(A_BUTTON | B_BUTTON)) if (JOY_NEW(A_BUTTON | B_BUTTON))
{ {
state->callback = CB2_HandleMatchCallInput; state->callback = CB2_HandleMatchCallInput;
return POKENAV_MC_FUNC_10; return POKENAV_MC_FUNC_EXIT_CALL;
} }
return POKENAV_MC_FUNC_NONE; return POKENAV_MC_FUNC_NONE;
@ -486,7 +486,7 @@ bool32 unref_sub_81CB16C(void)
return FALSE; return FALSE;
} }
static bool32 sub_81CB1D0(void) static bool32 ShouldDoNearbyMessage(void)
{ {
struct Pokenav3Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_MAIN); struct Pokenav3Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_MAIN);
int selection = GetSelectedPokenavListIndex(); int selection = GetSelectedPokenavListIndex();

File diff suppressed because it is too large Load Diff

View File

@ -468,10 +468,10 @@ void sub_81C877C(void)
structPtr->loopedTaskId = CreateLoopedTask(LoopedTask_sub_81C8870, 6); structPtr->loopedTaskId = CreateLoopedTask(LoopedTask_sub_81C8870, 6);
} }
void PrintCheckPageInfo(s16 a0) void PrintCheckPageInfo(s16 delta)
{ {
struct PokenavSub17 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_LIST); struct PokenavSub17 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_LIST);
structPtr->unk888.windowTopIndex += a0; structPtr->unk888.windowTopIndex += delta;
structPtr->unk89C = 0; structPtr->unk89C = 0;
structPtr->loopedTaskId = CreateLoopedTask(LoopedTask_PrintCheckPageInfo, 6); structPtr->loopedTaskId = CreateLoopedTask(LoopedTask_PrintCheckPageInfo, 6);
} }

View File

@ -505,11 +505,11 @@ static u32 LoopedTask_OpenMenu(s32 state)
ShowBg(2); ShowBg(2);
ShowBg(3); ShowBg(3);
if (gfx->pokenavAlreadyOpen) if (gfx->pokenavAlreadyOpen)
PokenavFadeScreen(1); PokenavFadeScreen(POKENAV_FADE_FROM_BLACK);
else else
{ {
PlaySE(SE_POKENAV_ON); PlaySE(SE_POKENAV_ON);
PokenavFadeScreen(3); PokenavFadeScreen(POKENAV_FADE_FROM_BLACK_ALL);
} }
switch (GetPokenavMenuType()) switch (GetPokenavMenuType())
{ {
@ -779,7 +779,7 @@ static u32 LoopedTask_OpenPokenavFeature(s32 state)
return LT_PAUSE; return LT_PAUSE;
if (AreLeftHeaderSpritesMoving()) if (AreLeftHeaderSpritesMoving())
return LT_PAUSE; return LT_PAUSE;
PokenavFadeScreen(0); PokenavFadeScreen(POKENAV_FADE_TO_BLACK);
return LT_INC_AND_PAUSE; return LT_INC_AND_PAUSE;
case 3: case 3:
if (IsPaletteFadeActive()) if (IsPaletteFadeActive())

View File

@ -364,7 +364,7 @@ static u32 LoopedTask_OpenRegionMap(s32 taskState)
LoadLeftHeaderGfxForIndex(menuGfxId); LoadLeftHeaderGfxForIndex(menuGfxId);
ShowLeftHeaderGfx(menuGfxId, 1, 1); ShowLeftHeaderGfx(menuGfxId, 1, 1);
PokenavFadeScreen(1); PokenavFadeScreen(POKENAV_FADE_FROM_BLACK);
return LT_INC_AND_PAUSE; return LT_INC_AND_PAUSE;
case 7: case 7:
if (IsPaletteFadeActive() || AreLeftHeaderSpritesMoving()) if (IsPaletteFadeActive() || AreLeftHeaderSpritesMoving())
@ -457,7 +457,7 @@ static u32 LoopedTask_ExitRegionMap(s32 taskState)
{ {
case 0: case 0:
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
PokenavFadeScreen(0); PokenavFadeScreen(POKENAV_FADE_TO_BLACK);
return LT_INC_AND_PAUSE; return LT_INC_AND_PAUSE;
case 1: case 1:
if (IsPaletteFadeActive()) if (IsPaletteFadeActive())

View File

@ -460,7 +460,7 @@ static u32 LoopedTask_OpenRibbonsMonList(s32 state)
ShowBg(2); ShowBg(2);
HideBg(3); HideBg(3);
PrintHelpBarText(HELPBAR_RIBBONS_MON_LIST); PrintHelpBarText(HELPBAR_RIBBONS_MON_LIST);
PokenavFadeScreen(1); PokenavFadeScreen(POKENAV_FADE_FROM_BLACK);
if (!menu->fromSummary) if (!menu->fromSummary)
{ {
LoadLeftHeaderGfxForIndex(POKENAV_GFX_RIBBONS_MENU); LoadLeftHeaderGfxForIndex(POKENAV_GFX_RIBBONS_MENU);
@ -615,7 +615,7 @@ static u32 LoopedTask_RibbonsListReturnToMainMenu(s32 state)
{ {
case 0: case 0:
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
PokenavFadeScreen(0); PokenavFadeScreen(POKENAV_FADE_TO_BLACK);
SlideMenuHeaderDown(); SlideMenuHeaderDown();
return LT_INC_AND_PAUSE; return LT_INC_AND_PAUSE;
case 1: case 1:
@ -635,7 +635,7 @@ static u32 LoopedTask_RibbonsListOpenSummary(s32 state)
{ {
case 0: case 0:
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
PokenavFadeScreen(0); PokenavFadeScreen(POKENAV_FADE_TO_BLACK);
return LT_INC_AND_PAUSE; return LT_INC_AND_PAUSE;
case 1: case 1:
if (IsPaletteFadeActive()) if (IsPaletteFadeActive())

View File

@ -638,7 +638,7 @@ static u32 LoopedTask_OpenRibbonsSummaryMenu(s32 state)
ShowBg(1); ShowBg(1);
ShowBg(2); ShowBg(2);
HideBg(3); HideBg(3);
PokenavFadeScreen(1); PokenavFadeScreen(POKENAV_FADE_FROM_BLACK);
return LT_INC_AND_PAUSE; return LT_INC_AND_PAUSE;
} }
return LT_PAUSE; return LT_PAUSE;
@ -655,7 +655,7 @@ static u32 LoopedTask_ExitRibbonsSummaryMenu(s32 state)
{ {
case 0: case 0:
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
PokenavFadeScreen(0); PokenavFadeScreen(POKENAV_FADE_TO_BLACK);
return LT_INC_AND_PAUSE; return LT_INC_AND_PAUSE;
case 1: case 1:
if (IsPaletteFadeActive()) if (IsPaletteFadeActive())