summaryrefslogtreecommitdiff
path: root/src/pokemon_summary_screen.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pokemon_summary_screen.c')
-rw-r--r--src/pokemon_summary_screen.c71
1 files changed, 35 insertions, 36 deletions
diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c
index d016c455c..fce2a893c 100644
--- a/src/pokemon_summary_screen.c
+++ b/src/pokemon_summary_screen.c
@@ -46,7 +46,6 @@
#include "constants/region_map_sections.h"
#include "constants/rgb.h"
#include "constants/songs.h"
-#include "constants/species.h"
// Screen titles (upper left)
#define PSS_LABEL_WINDOW_POKEMON_INFO_TITLE 0
@@ -1497,23 +1496,23 @@ static void Task_HandleInput(u8 taskId)
{
if (MenuHelpers_CallLinkSomething() != TRUE && !gPaletteFade.active)
{
- if (gMain.newKeys & DPAD_UP)
+ if (JOY_NEW(DPAD_UP))
{
ChangeSummaryPokemon(taskId, -1);
}
- else if (gMain.newKeys & DPAD_DOWN)
+ else if (JOY_NEW(DPAD_DOWN))
{
ChangeSummaryPokemon(taskId, 1);
}
- else if ((gMain.newKeys & DPAD_LEFT) || GetLRKeysPressed() == MENU_L_PRESSED)
+ else if ((JOY_NEW(DPAD_LEFT)) || GetLRKeysPressed() == MENU_L_PRESSED)
{
ChangePage(taskId, -1);
}
- else if ((gMain.newKeys & DPAD_RIGHT) || GetLRKeysPressed() == MENU_R_PRESSED)
+ else if ((JOY_NEW(DPAD_RIGHT)) || GetLRKeysPressed() == MENU_R_PRESSED)
{
ChangePage(taskId, 1);
}
- else if (gMain.newKeys & A_BUTTON)
+ else if (JOY_NEW(A_BUTTON))
{
if (sMonSummaryScreen->currPageIndex != PSS_PAGE_SKILLS)
{
@@ -1530,7 +1529,7 @@ static void Task_HandleInput(u8 taskId)
}
}
}
- else if (gMain.newKeys & B_BUTTON)
+ else if (JOY_NEW(B_BUTTON))
{
StopPokemonAnimations();
PlaySE(SE_SELECT);
@@ -1878,17 +1877,17 @@ static void Task_HandleInput_MoveSelect(u8 taskId)
if (MenuHelpers_CallLinkSomething() != 1)
{
- if (gMain.newKeys & DPAD_UP)
+ if (JOY_NEW(DPAD_UP))
{
data[0] = 4;
ChangeSelectedMove(data, -1, &sMonSummaryScreen->firstMoveIndex);
}
- else if (gMain.newKeys & DPAD_DOWN)
+ else if (JOY_NEW(DPAD_DOWN))
{
data[0] = 4;
ChangeSelectedMove(data, 1, &sMonSummaryScreen->firstMoveIndex);
}
- else if (gMain.newKeys & A_BUTTON)
+ else if (JOY_NEW(A_BUTTON))
{
if (sMonSummaryScreen->lockMovesFlag == TRUE
|| (sMonSummaryScreen->newMove == MOVE_NONE && sMonSummaryScreen->firstMoveIndex == MAX_MON_MOVES))
@@ -1906,7 +1905,7 @@ static void Task_HandleInput_MoveSelect(u8 taskId)
PlaySE(SE_FAILURE);
}
}
- else if (gMain.newKeys & B_BUTTON)
+ else if (JOY_NEW(B_BUTTON))
{
PlaySE(SE_SELECT);
CloseMoveSelectMode(taskId);
@@ -2018,24 +2017,24 @@ static void Task_HandleInput_MovePositionSwitch(u8 taskId)
if (MenuHelpers_CallLinkSomething() != TRUE)
{
- if (gMain.newKeys & DPAD_UP)
+ if (JOY_NEW(DPAD_UP))
{
data[0] = 3;
ChangeSelectedMove(&data[0], -1, &sMonSummaryScreen->secondMoveIndex);
}
- else if (gMain.newKeys & DPAD_DOWN)
+ else if (JOY_NEW(DPAD_DOWN))
{
data[0] = 3;
ChangeSelectedMove(&data[0], 1, &sMonSummaryScreen->secondMoveIndex);
}
- else if (gMain.newKeys & A_BUTTON)
+ else if (JOY_NEW(A_BUTTON))
{
if (sMonSummaryScreen->firstMoveIndex == sMonSummaryScreen->secondMoveIndex)
ExitMovePositionSwitchMode(taskId, FALSE);
else
ExitMovePositionSwitchMode(taskId, TRUE);
}
- else if (gMain.newKeys & B_BUTTON)
+ else if (JOY_NEW(B_BUTTON))
{
ExitMovePositionSwitchMode(taskId, FALSE);
}
@@ -2161,25 +2160,25 @@ static void Task_HandleReplaceMoveInput(u8 taskId)
{
if (gPaletteFade.active != TRUE)
{
- if (gMain.newKeys & DPAD_UP)
+ if (JOY_NEW(DPAD_UP))
{
data[0] = 4;
ChangeSelectedMove(data, -1, &sMonSummaryScreen->firstMoveIndex);
}
- else if (gMain.newKeys & DPAD_DOWN)
+ else if (JOY_NEW(DPAD_DOWN))
{
data[0] = 4;
ChangeSelectedMove(data, 1, &sMonSummaryScreen->firstMoveIndex);
}
- else if (gMain.newKeys & DPAD_LEFT || GetLRKeysPressed() == MENU_L_PRESSED)
+ else if (JOY_NEW(DPAD_LEFT) || GetLRKeysPressed() == MENU_L_PRESSED)
{
ChangePage(taskId, -1);
}
- else if (gMain.newKeys & DPAD_RIGHT || GetLRKeysPressed() == MENU_R_PRESSED)
+ else if (JOY_NEW(DPAD_RIGHT) || GetLRKeysPressed() == MENU_R_PRESSED)
{
ChangePage(taskId, 1);
}
- else if (gMain.newKeys & A_BUTTON)
+ else if (JOY_NEW(A_BUTTON))
{
if (CanReplaceMove() == TRUE)
{
@@ -2195,7 +2194,7 @@ static void Task_HandleReplaceMoveInput(u8 taskId)
ShowCantForgetHMsWindow(taskId);
}
}
- else if (gMain.newKeys & B_BUTTON)
+ else if (JOY_NEW(B_BUTTON))
{
StopPokemonAnimations();
PlaySE(SE_SELECT);
@@ -2235,7 +2234,7 @@ static void Task_HandleInputCantForgetHMsMoves(u8 taskId)
u16 move;
if (FuncIsActiveTask(Task_ShowPowerAccWindow) != 1)
{
- if (gMain.newKeys & DPAD_UP)
+ if (JOY_NEW(DPAD_UP))
{
data[1] = 1;
data[0] = 4;
@@ -2243,7 +2242,7 @@ static void Task_HandleInputCantForgetHMsMoves(u8 taskId)
data[1] = 0;
gTasks[taskId].func = Task_HandleReplaceMoveInput;
}
- else if (gMain.newKeys & DPAD_DOWN)
+ else if (JOY_NEW(DPAD_DOWN))
{
data[1] = 1;
data[0] = 4;
@@ -2251,7 +2250,7 @@ static void Task_HandleInputCantForgetHMsMoves(u8 taskId)
data[1] = 0;
gTasks[taskId].func = Task_HandleReplaceMoveInput;
}
- else if (gMain.newKeys & DPAD_LEFT || GetLRKeysPressed() == MENU_L_PRESSED)
+ else if (JOY_NEW(DPAD_LEFT) || GetLRKeysPressed() == MENU_L_PRESSED)
{
if (sMonSummaryScreen->currPageIndex != PSS_PAGE_BATTLE_MOVES)
{
@@ -2265,7 +2264,7 @@ static void Task_HandleInputCantForgetHMsMoves(u8 taskId)
HandleAppealJamTilemap(9, -2, move);
}
}
- else if (gMain.newKeys & DPAD_RIGHT || GetLRKeysPressed() == MENU_R_PRESSED)
+ else if (JOY_NEW(DPAD_RIGHT) || GetLRKeysPressed() == MENU_R_PRESSED)
{
if (sMonSummaryScreen->currPageIndex != PSS_PAGE_CONTEST_MOVES)
{
@@ -2279,7 +2278,7 @@ static void Task_HandleInputCantForgetHMsMoves(u8 taskId)
HandleAppealJamTilemap(9, -2, move);
}
}
- else if (gMain.newKeys & (A_BUTTON | B_BUTTON))
+ else if (JOY_NEW(A_BUTTON | B_BUTTON))
{
ClearWindowTilemap(PSS_LABEL_WINDOW_PORTRAIT_SPECIES);
if (!gSprites[sMonSummaryScreen->spriteIds[SPRITE_ARR_ID_STATUS]].invisible)
@@ -2579,7 +2578,7 @@ static void DrawPokerusCuredSymbol(struct Pokemon *mon) // This checks if the mo
ScheduleBgCopyTilemapToVram(3);
}
-static void SetDexNumberColor(bool8 isMonShiny)
+static void SetMonPicBackgroundPalette(bool8 isMonShiny)
{
if (!isMonShiny)
SetBgTilemapPalette(3, 1, 4, 8, 8, 0);
@@ -2716,12 +2715,12 @@ static void PrintNotEggInfo(void)
if (!IsMonShiny(mon))
{
PrintTextOnWindow(PSS_LABEL_WINDOW_PORTRAIT_DEX_NUMBER, gStringVar1, 0, 1, 0, 1);
- SetDexNumberColor(FALSE);
+ SetMonPicBackgroundPalette(FALSE);
}
else
{
PrintTextOnWindow(PSS_LABEL_WINDOW_PORTRAIT_DEX_NUMBER, gStringVar1, 0, 1, 0, 7);
- SetDexNumberColor(TRUE);
+ SetMonPicBackgroundPalette(TRUE);
}
PutWindowTilemap(PSS_LABEL_WINDOW_PORTRAIT_DEX_NUMBER);
}
@@ -2729,9 +2728,9 @@ static void PrintNotEggInfo(void)
{
ClearWindowTilemap(PSS_LABEL_WINDOW_PORTRAIT_DEX_NUMBER);
if (!IsMonShiny(mon))
- SetDexNumberColor(FALSE);
+ SetMonPicBackgroundPalette(FALSE);
else
- SetDexNumberColor(TRUE);
+ SetMonPicBackgroundPalette(TRUE);
}
StringCopy(gStringVar1, gText_LevelSymbol);
ConvertIntToDecimalStringN(gStringVar2, summary->level, STR_CONV_MODE_LEFT_ALIGN, 3);
@@ -3859,18 +3858,18 @@ static u8 LoadMonGfxAndSprite(struct Pokemon *mon, s16 *state)
if (gMain.inBattle)
{
if (sub_80688F8(3, sMonSummaryScreen->curMonIndex))
- HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[summary->species2], gMonSpritesGfxPtr->sprites[1], summary->species2, summary->pid);
+ HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[summary->species2], gMonSpritesGfxPtr->sprites.ptr[1], summary->species2, summary->pid);
else
- HandleLoadSpecialPokePic_2(&gMonFrontPicTable[summary->species2], gMonSpritesGfxPtr->sprites[1], summary->species2, summary->pid);
+ HandleLoadSpecialPokePic_2(&gMonFrontPicTable[summary->species2], gMonSpritesGfxPtr->sprites.ptr[1], summary->species2, summary->pid);
}
else
{
if (gMonSpritesGfxPtr != NULL)
{
if (sMonSummaryScreen->monList.mons == gPlayerParty || sMonSummaryScreen->mode == PSS_MODE_BOX || sMonSummaryScreen->unk40EF == TRUE)
- HandleLoadSpecialPokePic_2(&gMonFrontPicTable[summary->species2], gMonSpritesGfxPtr->sprites[1], summary->species2, summary->pid);
+ HandleLoadSpecialPokePic_2(&gMonFrontPicTable[summary->species2], gMonSpritesGfxPtr->sprites.ptr[1], summary->species2, summary->pid);
else
- HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[summary->species2], gMonSpritesGfxPtr->sprites[1], summary->species2, summary->pid);
+ HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[summary->species2], gMonSpritesGfxPtr->sprites.ptr[1], summary->species2, summary->pid);
}
else
{
@@ -3977,7 +3976,7 @@ static void StopPokemonAnimations(void) // A subtle effect, this function stops
static void CreateMonMarkingsSprite(struct Pokemon *mon)
{
- struct Sprite *sprite = sub_811FF94(TAG_MON_MARKINGS, TAG_MON_MARKINGS, sSummaryMarkingsPalette);
+ struct Sprite *sprite = CreateMonMarkingsSpriteWithPal(TAG_MON_MARKINGS, TAG_MON_MARKINGS, sSummaryMarkingsPalette);
sMonSummaryScreen->markingsSprite = sprite;
if (sprite != NULL)