menu_specialized.c: Fix fakematches.

This commit is contained in:
Kaz 2020-09-19 17:38:54 -04:00
parent 847878eae9
commit 94711208a2

View file

@ -881,34 +881,31 @@ s32 GetBoxOrPartyMonData(u16 boxId, u16 monId, s32 request, u8 *dst)
// Gets the name/gender/level string for the condition menu
static u8 *GetConditionMenuMonString(u8 *dst, u16 boxId, u16 monId)
{
u16 species, level, gender;
u16 box, mon, species, level, gender;
struct BoxPokemon *boxMon;
u8 *str;
box = boxId;
mon = monId;
*(dst++) = EXT_CTRL_CODE_BEGIN;
*(dst++) = EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW;
*(dst++) = TEXT_COLOR_BLUE;
*(dst++) = TEXT_COLOR_TRANSPARENT;
*(dst++) = TEXT_COLOR_LIGHT_BLUE;
if (GetBoxOrPartyMonData(boxId, monId, MON_DATA_IS_EGG, NULL))
{
if (GetBoxOrPartyMonData(box, mon, MON_DATA_IS_EGG, NULL))
return StringCopyPadded(dst, gText_EggNickname, 0, 12);
}
GetBoxOrPartyMonData(boxId, monId, MON_DATA_NICKNAME, dst);
GetBoxOrPartyMonData(box, mon, MON_DATA_NICKNAME, dst);
StringGetEnd10(dst);
species = GetBoxOrPartyMonData(boxId, monId, MON_DATA_SPECIES, NULL);
if (boxId == TOTAL_BOXES_COUNT) // Party mon.
species = GetBoxOrPartyMonData(box, mon, MON_DATA_SPECIES, NULL);
if (box == TOTAL_BOXES_COUNT) // Party mon.
{
level = GetMonData(&gPlayerParty[monId], MON_DATA_LEVEL);
gender = GetMonGender(&gPlayerParty[monId]);
level = GetMonData(&gPlayerParty[mon], MON_DATA_LEVEL);
gender = GetMonGender(&gPlayerParty[mon]);
}
else
{
// Needed to match, feel free to remove.
boxId++, boxId--;
monId++, monId--;
boxMon = GetBoxedMonPtr(box, mon);
boxMon = GetBoxedMonPtr(boxId, monId);
gender = GetBoxMonGender(boxMon);
level = GetLevelFromBoxMonExp(boxMon);
}
@ -981,6 +978,8 @@ static u8 *BufferConditionMenuSpacedStringN(u8 *dst, const u8 *src, s16 n)
void GetConditionMenuMonNameAndLocString(u8 *locationDst, u8 *nameDst, u16 boxId, u16 monId, u16 partyId, u16 numMons, bool8 excludesCancel)
{
u16 i;
u16 box = boxId;
u16 mon = monId;
// In this and the below 2 functions, numMons is passed as the number of menu selections (which includes Cancel)
// To indicate that the Cancel needs to be subtracted they pass an additional bool
@ -990,21 +989,16 @@ void GetConditionMenuMonNameAndLocString(u8 *locationDst, u8 *nameDst, u16 boxId
if (partyId != numMons)
{
GetConditionMenuMonString(nameDst, boxId, monId);
GetConditionMenuMonString(nameDst, box, mon);
locationDst[0] = EXT_CTRL_CODE_BEGIN;
locationDst[1] = EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW;
locationDst[2] = TEXT_COLOR_BLUE;
locationDst[3] = TEXT_COLOR_TRANSPARENT;
locationDst[4] = TEXT_COLOR_LIGHT_BLUE;
if (boxId == TOTAL_BOXES_COUNT) // Party mon.
{
if (box == TOTAL_BOXES_COUNT) // Party mon.
BufferConditionMenuSpacedStringN(&locationDst[5], gText_InParty, 8);
}
else
{
boxId++;boxId--; // Again...Someone fix this maybe?
BufferConditionMenuSpacedStringN(&locationDst[5], GetBoxNamePtr(boxId), 8);
}
BufferConditionMenuSpacedStringN(&locationDst[5], GetBoxNamePtr(box), 8);
}
else
{