menu_specialized.c: Fix fakematches.
This commit is contained in:
+15
-21
@@ -881,34 +881,31 @@ s32 GetBoxOrPartyMonData(u16 boxId, u16 monId, s32 request, u8 *dst)
|
|||||||
// Gets the name/gender/level string for the condition menu
|
// Gets the name/gender/level string for the condition menu
|
||||||
static u8 *GetConditionMenuMonString(u8 *dst, u16 boxId, u16 monId)
|
static u8 *GetConditionMenuMonString(u8 *dst, u16 boxId, u16 monId)
|
||||||
{
|
{
|
||||||
u16 species, level, gender;
|
u16 box, mon, species, level, gender;
|
||||||
struct BoxPokemon *boxMon;
|
struct BoxPokemon *boxMon;
|
||||||
u8 *str;
|
u8 *str;
|
||||||
|
|
||||||
|
box = boxId;
|
||||||
|
mon = monId;
|
||||||
*(dst++) = EXT_CTRL_CODE_BEGIN;
|
*(dst++) = EXT_CTRL_CODE_BEGIN;
|
||||||
*(dst++) = EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW;
|
*(dst++) = EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW;
|
||||||
*(dst++) = TEXT_COLOR_BLUE;
|
*(dst++) = TEXT_COLOR_BLUE;
|
||||||
*(dst++) = TEXT_COLOR_TRANSPARENT;
|
*(dst++) = TEXT_COLOR_TRANSPARENT;
|
||||||
*(dst++) = TEXT_COLOR_LIGHT_BLUE;
|
*(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);
|
return StringCopyPadded(dst, gText_EggNickname, 0, 12);
|
||||||
}
|
GetBoxOrPartyMonData(box, mon, MON_DATA_NICKNAME, dst);
|
||||||
GetBoxOrPartyMonData(boxId, monId, MON_DATA_NICKNAME, dst);
|
|
||||||
StringGetEnd10(dst);
|
StringGetEnd10(dst);
|
||||||
species = GetBoxOrPartyMonData(boxId, monId, MON_DATA_SPECIES, NULL);
|
species = GetBoxOrPartyMonData(box, mon, MON_DATA_SPECIES, NULL);
|
||||||
if (boxId == TOTAL_BOXES_COUNT) // Party mon.
|
if (box == TOTAL_BOXES_COUNT) // Party mon.
|
||||||
{
|
{
|
||||||
level = GetMonData(&gPlayerParty[monId], MON_DATA_LEVEL);
|
level = GetMonData(&gPlayerParty[mon], MON_DATA_LEVEL);
|
||||||
gender = GetMonGender(&gPlayerParty[monId]);
|
gender = GetMonGender(&gPlayerParty[mon]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Needed to match, feel free to remove.
|
boxMon = GetBoxedMonPtr(box, mon);
|
||||||
boxId++, boxId--;
|
|
||||||
monId++, monId--;
|
|
||||||
|
|
||||||
boxMon = GetBoxedMonPtr(boxId, monId);
|
|
||||||
gender = GetBoxMonGender(boxMon);
|
gender = GetBoxMonGender(boxMon);
|
||||||
level = GetLevelFromBoxMonExp(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)
|
void GetConditionMenuMonNameAndLocString(u8 *locationDst, u8 *nameDst, u16 boxId, u16 monId, u16 partyId, u16 numMons, bool8 excludesCancel)
|
||||||
{
|
{
|
||||||
u16 i;
|
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)
|
// 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
|
// 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)
|
if (partyId != numMons)
|
||||||
{
|
{
|
||||||
GetConditionMenuMonString(nameDst, boxId, monId);
|
GetConditionMenuMonString(nameDst, box, mon);
|
||||||
locationDst[0] = EXT_CTRL_CODE_BEGIN;
|
locationDst[0] = EXT_CTRL_CODE_BEGIN;
|
||||||
locationDst[1] = EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW;
|
locationDst[1] = EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW;
|
||||||
locationDst[2] = TEXT_COLOR_BLUE;
|
locationDst[2] = TEXT_COLOR_BLUE;
|
||||||
locationDst[3] = TEXT_COLOR_TRANSPARENT;
|
locationDst[3] = TEXT_COLOR_TRANSPARENT;
|
||||||
locationDst[4] = TEXT_COLOR_LIGHT_BLUE;
|
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);
|
BufferConditionMenuSpacedStringN(&locationDst[5], gText_InParty, 8);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
BufferConditionMenuSpacedStringN(&locationDst[5], GetBoxNamePtr(box), 8);
|
||||||
boxId++;boxId--; // Again...Someone fix this maybe?
|
|
||||||
BufferConditionMenuSpacedStringN(&locationDst[5], GetBoxNamePtr(boxId), 8);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user