From a83ece83cd15b313d6224f1e1a2341cc9992f66e Mon Sep 17 00:00:00 2001 From: TheXaman Date: Sat, 19 Jun 2021 11:45:15 +0200 Subject: [PATCH] fixed navigation buttons on evo page not showing when switching from cry screen, thanks to @AsparagusEduardo for pointing it out --- src/pokedex.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/pokedex.c b/src/pokedex.c index 8447a7c85c..6ed94d9382 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -7325,25 +7325,24 @@ static void EvoFormsPage_PrintAToggleUpdownEvos(void) { u8 x = 9; u8 y = 0; - #ifdef POKEMON_EXPANSION - if (sPokedexView->selectedScreen == EVO_SCREEN) - { - if (!HGSS_DECAPPED) - AddTextPrinterParameterized3(WIN_NAVIGATION_BUTTONS, 0, x+9, y, sStatsPageNavigationTextColor, 0, gText_EVO_Buttons_PE); - else - AddTextPrinterParameterized3(WIN_NAVIGATION_BUTTONS, 0, x+9, y, sStatsPageNavigationTextColor, 0, gText_EVO_Buttons_Decapped_PE); - } - else if (sPokedexView->selectedScreen == FORMS_SCREEN) - { - if (!HGSS_DECAPPED) - AddTextPrinterParameterized3(WIN_NAVIGATION_BUTTONS, 0, x, y, sStatsPageNavigationTextColor, 0, gText_FORMS_Buttons_PE); - else - AddTextPrinterParameterized3(WIN_NAVIGATION_BUTTONS, 0, x, y, sStatsPageNavigationTextColor, 0, gText_FORMS_Buttons_Decapped_PE); - } - // DrawKeypadIcon(WIN_NAVIGATION_BUTTONS, 10, 5, 0); //(u8 windowId, u8 keypadIconId, u16 x, u16 y) - PutWindowTilemap(WIN_NAVIGATION_BUTTONS); - CopyWindowToVram(WIN_NAVIGATION_BUTTONS, 3); - #endif + + if (sPokedexView->selectedScreen == EVO_SCREEN) + { + if (!HGSS_DECAPPED) + AddTextPrinterParameterized3(WIN_NAVIGATION_BUTTONS, 0, x+9, y, sStatsPageNavigationTextColor, 0, gText_EVO_Buttons_PE); + else + AddTextPrinterParameterized3(WIN_NAVIGATION_BUTTONS, 0, x+9, y, sStatsPageNavigationTextColor, 0, gText_EVO_Buttons_Decapped_PE); + } + else if (sPokedexView->selectedScreen == FORMS_SCREEN) + { + if (!HGSS_DECAPPED) + AddTextPrinterParameterized3(WIN_NAVIGATION_BUTTONS, 0, x, y, sStatsPageNavigationTextColor, 0, gText_FORMS_Buttons_PE); + else + AddTextPrinterParameterized3(WIN_NAVIGATION_BUTTONS, 0, x, y, sStatsPageNavigationTextColor, 0, gText_FORMS_Buttons_Decapped_PE); + } + // DrawKeypadIcon(WIN_NAVIGATION_BUTTONS, 10, 5, 0); //(u8 windowId, u8 keypadIconId, u16 x, u16 y) + PutWindowTilemap(WIN_NAVIGATION_BUTTONS); + CopyWindowToVram(WIN_NAVIGATION_BUTTONS, 3); } static void Task_LoadEvolutionScreen(u8 taskId) { @@ -7388,6 +7387,7 @@ static void Task_LoadEvolutionScreen(u8 taskId) case 3: if (gTasks[taskId].data[1] == 0) { + sPokedexView->selectedScreen = EVO_SCREEN; //Icon FreeMonIconPalettes(); //Free space for new pallete LoadMonIconPalette(NationalPokedexNumToSpecies(sPokedexListItem->dexNum)); //Loads pallete for current mon @@ -7396,9 +7396,9 @@ static void Task_LoadEvolutionScreen(u8 taskId) #endif #ifdef POKEMON_EXPANSION gTasks[taskId].data[4] = CreateMonIcon(NationalPokedexNumToSpecies(sPokedexListItem->dexNum), SpriteCB_MonIcon, 18, 31, 4, 0); //Create pokemon sprite + EvoFormsPage_PrintAToggleUpdownEvos(); //HGSS_Ui Navigation buttons #endif gSprites[gTasks[taskId].data[4]].oam.priority = 0; - EvoFormsPage_PrintAToggleUpdownEvos(); //HGSS_Ui Navigation buttons } gMain.state++; break;