diff --git a/include/constants/party_menu.h b/include/constants/party_menu.h index 1f37f3416c96..e997dd566dc1 100644 --- a/include/constants/party_menu.h +++ b/include/constants/party_menu.h @@ -81,6 +81,7 @@ #define PARTY_MSG_ALREADY_HOLDING_ONE 26 #define PARTY_MSG_WHICH_APPLIANCE 27 #define PARTY_MSG_CHOOSE_SECOND_FUSION 28 +#define PARTY_MSG_NO_POKEMON 29 #define PARTY_MSG_NONE 127 // IDs for DisplayPartyPokemonDescriptionText, to display a message in the party pokemon's box diff --git a/src/data/party_menu.h b/src/data/party_menu.h index e6cb13ee6d83..168387dbf4a5 100644 --- a/src/data/party_menu.h +++ b/src/data/party_menu.h @@ -659,6 +659,7 @@ static const u8 *const sActionStringTable[] = [PARTY_MSG_ALREADY_HOLDING_ONE] = gText_AlreadyHoldingOne, [PARTY_MSG_WHICH_APPLIANCE] = gText_WhichAppliance, [PARTY_MSG_CHOOSE_SECOND_FUSION] = gText_NextFusionMon, + [PARTY_MSG_NO_POKEMON] = COMPOUND_STRING("You have no POKéMON."), }; static const u8 *const sDescriptionStringTable[] = diff --git a/src/party_menu.c b/src/party_menu.c index af447ac9905b..bda62ba3d1fb 100644 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -551,6 +551,9 @@ static void InitPartyMenu(u8 menuType, u8 layout, u8 partyAction, bool8 keepCurs else if (gPartyMenu.slotId > PARTY_SIZE - 1 || GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES) == SPECIES_NONE) gPartyMenu.slotId = 0; + if (gPlayerPartyCount == 0) + gPartyMenu.slotId = PARTY_SIZE + 1; // Cancel + gTextFlags.autoScroll = 0; CalculatePlayerPartyCount(); SetMainCallback2(CB2_InitPartyMenu); @@ -982,7 +985,7 @@ static void RenderPartyMenuBox(u8 slot) PutWindowTilemap(sPartyMenuBoxes[slot].windowId); ScheduleBgCopyTilemapToVram(2); } - else + else if (gPlayerPartyCount != 0) { if (GetMonData(&gPlayerParty[slot], MON_DATA_SPECIES) == SPECIES_NONE) { @@ -1656,7 +1659,7 @@ static u16 PartyMenuButtonHandler(s8 *slotPtr) if (JOY_NEW(START_BUTTON)) return START_BUTTON; - if (movementDir) + if (movementDir && gPlayerPartyCount != 0) { UpdateCurrentPartySelection(slotPtr, movementDir); return 0; @@ -2667,6 +2670,9 @@ void DisplayPartyMenuStdMessage(u32 stringId) stringId = PARTY_MSG_CHOOSE_MON_AND_CONFIRM; else if (!ShouldUseChooseMonText()) stringId = PARTY_MSG_CHOOSE_MON_OR_CANCEL; + + if (gPlayerPartyCount == 0) + stringId = PARTY_MSG_NO_POKEMON; } DrawStdFrameWithCustomTileAndPalette(*windowPtr, FALSE, 0x4F, 13); StringExpandPlaceholders(gStringVar4, sActionStringTable[stringId]);