mirror of https://github.com/pret/pokeemerald.git
Use specific name limits for string limit functions
This commit is contained in:
parent
b9fa18bdd4
commit
1b35f9adad
|
@ -25,10 +25,10 @@ static const s32 sPowersOfTen[] =
|
|||
1000000000,
|
||||
};
|
||||
|
||||
u8 *StringCopy10(u8 *dest, const u8 *src)
|
||||
u8 *StringCopy_Nickname(u8 *dest, const u8 *src)
|
||||
{
|
||||
u8 i;
|
||||
u32 limit = 10;
|
||||
u32 limit = POKEMON_NAME_LENGTH;
|
||||
|
||||
for (i = 0; i < limit; i++)
|
||||
{
|
||||
|
@ -42,10 +42,10 @@ u8 *StringCopy10(u8 *dest, const u8 *src)
|
|||
return &dest[i];
|
||||
}
|
||||
|
||||
u8 *StringGetEnd10(u8 *str)
|
||||
u8 *StringGet_Nickname(u8 *str)
|
||||
{
|
||||
u8 i;
|
||||
u32 limit = 10;
|
||||
u32 limit = POKEMON_NAME_LENGTH;
|
||||
|
||||
for (i = 0; i < limit; i++)
|
||||
if (str[i] == EOS)
|
||||
|
@ -55,10 +55,10 @@ u8 *StringGetEnd10(u8 *str)
|
|||
return &str[i];
|
||||
}
|
||||
|
||||
u8 *StringCopy7(u8 *dest, const u8 *src)
|
||||
u8 *StringCopy_PlayerName(u8 *dest, const u8 *src)
|
||||
{
|
||||
s32 i;
|
||||
s32 limit = 7;
|
||||
s32 limit = PLAYER_NAME_LENGTH;
|
||||
|
||||
for (i = 0; i < limit; i++)
|
||||
{
|
||||
|
|
|
@ -13,9 +13,9 @@ enum StringConvertMode
|
|||
STR_CONV_MODE_LEADING_ZEROS
|
||||
};
|
||||
|
||||
u8 *StringCopy10(u8 *dest, const u8 *src);
|
||||
u8 *StringGetEnd10(u8 *str);
|
||||
u8 *StringCopy7(u8 *dest, const u8 *src);
|
||||
u8 *StringCopy_Nickname(u8 *dest, const u8 *src);
|
||||
u8 *StringGet_Nickname(u8 *str);
|
||||
u8 *StringCopy_PlayerName(u8 *dest, const u8 *src);
|
||||
u8 *StringCopy(u8 *dest, const u8 *src);
|
||||
u8 *StringAppend(u8 *dest, const u8 *src);
|
||||
u8 *StringCopyN(u8 *dest, const u8 *src, u8 n);
|
||||
|
|
|
@ -127,7 +127,7 @@ void BufferApprenticeChallengeText(u8 saveApprenticeId)
|
|||
for (i = 0; num != 0 && i < APPRENTICE_COUNT; num /= 10, i++)
|
||||
;
|
||||
|
||||
StringCopy7(gStringVar1, gSaveBlock2Ptr->apprentices[saveApprenticeId].playerName);
|
||||
StringCopy_PlayerName(gStringVar1, gSaveBlock2Ptr->apprentices[saveApprenticeId].playerName);
|
||||
ConvertInternationalString(gStringVar1, gSaveBlock2Ptr->apprentices[saveApprenticeId].language);
|
||||
ConvertIntToDecimalStringN(gStringVar2, gSaveBlock2Ptr->apprentices[saveApprenticeId].number, STR_CONV_MODE_RIGHT_ALIGN, i);
|
||||
challengeText = sApprenticeChallengeTexts[gSaveBlock2Ptr->apprentices[saveApprenticeId].id];
|
||||
|
|
|
@ -602,7 +602,7 @@ static u32 CopyLinkOpponentMonData(u8 monId, u8 *dst)
|
|||
battleMon.abilityNum = GetMonData(&gEnemyParty[monId], MON_DATA_ABILITY_NUM);
|
||||
battleMon.otId = GetMonData(&gEnemyParty[monId], MON_DATA_OT_ID);
|
||||
GetMonData(&gEnemyParty[monId], MON_DATA_NICKNAME, nickname);
|
||||
StringCopy10(battleMon.nickname, nickname);
|
||||
StringCopy_Nickname(battleMon.nickname, nickname);
|
||||
GetMonData(&gEnemyParty[monId], MON_DATA_OT_NAME, battleMon.otName);
|
||||
src = (u8 *)&battleMon;
|
||||
for (size = 0; size < sizeof(battleMon); size++)
|
||||
|
|
|
@ -489,7 +489,7 @@ static u32 CopyLinkPartnerMonData(u8 monId, u8 *dst)
|
|||
battleMon.abilityNum = GetMonData(&gPlayerParty[monId], MON_DATA_ABILITY_NUM);
|
||||
battleMon.otId = GetMonData(&gPlayerParty[monId], MON_DATA_OT_ID);
|
||||
GetMonData(&gPlayerParty[monId], MON_DATA_NICKNAME, nickname);
|
||||
StringCopy10(battleMon.nickname, nickname);
|
||||
StringCopy_Nickname(battleMon.nickname, nickname);
|
||||
GetMonData(&gPlayerParty[monId], MON_DATA_OT_NAME, battleMon.otName);
|
||||
src = (u8 *)&battleMon;
|
||||
for (size = 0; size < sizeof(battleMon); size++)
|
||||
|
|
|
@ -602,7 +602,7 @@ static u32 GetOpponentMonData(u8 monId, u8 *dst)
|
|||
battleMon.abilityNum = GetMonData(&gEnemyParty[monId], MON_DATA_ABILITY_NUM);
|
||||
battleMon.otId = GetMonData(&gEnemyParty[monId], MON_DATA_OT_ID);
|
||||
GetMonData(&gEnemyParty[monId], MON_DATA_NICKNAME, nickname);
|
||||
StringCopy10(battleMon.nickname, nickname);
|
||||
StringCopy_Nickname(battleMon.nickname, nickname);
|
||||
GetMonData(&gEnemyParty[monId], MON_DATA_OT_NAME, battleMon.otName);
|
||||
src = (u8 *)&battleMon;
|
||||
for (size = 0; size < sizeof(battleMon); size++)
|
||||
|
|
|
@ -1647,7 +1647,7 @@ static u32 CopyPlayerMonData(u8 monId, u8 *dst)
|
|||
battleMon.abilityNum = GetMonData(&gPlayerParty[monId], MON_DATA_ABILITY_NUM);
|
||||
battleMon.otId = GetMonData(&gPlayerParty[monId], MON_DATA_OT_ID);
|
||||
GetMonData(&gPlayerParty[monId], MON_DATA_NICKNAME, nickname);
|
||||
StringCopy10(battleMon.nickname, nickname);
|
||||
StringCopy_Nickname(battleMon.nickname, nickname);
|
||||
GetMonData(&gPlayerParty[monId], MON_DATA_OT_NAME, battleMon.otName);
|
||||
src = (u8 *)&battleMon;
|
||||
for (size = 0; size < sizeof(battleMon); size++)
|
||||
|
|
|
@ -673,7 +673,7 @@ static u32 CopyPlayerPartnerMonData(u8 monId, u8 *dst)
|
|||
battleMon.abilityNum = GetMonData(&gPlayerParty[monId], MON_DATA_ABILITY_NUM);
|
||||
battleMon.otId = GetMonData(&gPlayerParty[monId], MON_DATA_OT_ID);
|
||||
GetMonData(&gPlayerParty[monId], MON_DATA_NICKNAME, nickname);
|
||||
StringCopy10(battleMon.nickname, nickname);
|
||||
StringCopy_Nickname(battleMon.nickname, nickname);
|
||||
GetMonData(&gPlayerParty[monId], MON_DATA_OT_NAME, battleMon.otName);
|
||||
src = (u8 *)&battleMon;
|
||||
for (size = 0; size < sizeof(battleMon); size++)
|
||||
|
|
|
@ -585,7 +585,7 @@ static u32 CopyRecordedOpponentMonData(u8 monId, u8 *dst)
|
|||
battleMon.abilityNum = GetMonData(&gEnemyParty[monId], MON_DATA_ABILITY_NUM);
|
||||
battleMon.otId = GetMonData(&gEnemyParty[monId], MON_DATA_OT_ID);
|
||||
GetMonData(&gEnemyParty[monId], MON_DATA_NICKNAME, nickname);
|
||||
StringCopy10(battleMon.nickname, nickname);
|
||||
StringCopy_Nickname(battleMon.nickname, nickname);
|
||||
GetMonData(&gEnemyParty[monId], MON_DATA_OT_NAME, battleMon.otName);
|
||||
src = (u8 *)&battleMon;
|
||||
for (size = 0; size < sizeof(battleMon); size++)
|
||||
|
|
|
@ -564,7 +564,7 @@ static u32 CopyRecordedPlayerMonData(u8 monId, u8 *dst)
|
|||
battleMon.abilityNum = GetMonData(&gPlayerParty[monId], MON_DATA_ABILITY_NUM);
|
||||
battleMon.otId = GetMonData(&gPlayerParty[monId], MON_DATA_OT_ID);
|
||||
GetMonData(&gPlayerParty[monId], MON_DATA_NICKNAME, nickname);
|
||||
StringCopy10(battleMon.nickname, nickname);
|
||||
StringCopy_Nickname(battleMon.nickname, nickname);
|
||||
GetMonData(&gPlayerParty[monId], MON_DATA_OT_NAME, battleMon.otName);
|
||||
src = (u8 *)&battleMon;
|
||||
for (size = 0; size < sizeof(battleMon); size++)
|
||||
|
|
|
@ -491,7 +491,7 @@ static u32 CopyWallyMonData(u8 monId, u8 *dst)
|
|||
battleMon.abilityNum = GetMonData(&gPlayerParty[monId], MON_DATA_ABILITY_NUM);
|
||||
battleMon.otId = GetMonData(&gPlayerParty[monId], MON_DATA_OT_ID);
|
||||
GetMonData(&gPlayerParty[monId], MON_DATA_NICKNAME, nickname);
|
||||
StringCopy10(battleMon.nickname, nickname);
|
||||
StringCopy_Nickname(battleMon.nickname, nickname);
|
||||
GetMonData(&gPlayerParty[monId], MON_DATA_OT_NAME, battleMon.otName);
|
||||
src = (u8 *)&battleMon;
|
||||
for (size = 0; size < sizeof(battleMon); size++)
|
||||
|
|
|
@ -1893,7 +1893,7 @@ static void UpdateNickInHealthbox(u8 healthboxSpriteId, struct Pokemon *mon)
|
|||
|
||||
StringCopy(gDisplayedStringBattle, gText_HealthboxNickname);
|
||||
GetMonData(mon, MON_DATA_NICKNAME, nickname);
|
||||
StringGetEnd10(nickname);
|
||||
StringGet_Nickname(nickname);
|
||||
ptr = StringAppend(gDisplayedStringBattle, nickname);
|
||||
|
||||
gender = GetMonGender(mon);
|
||||
|
|
|
@ -2400,7 +2400,7 @@ static const u8* TryGetStatusString(u8 *src)
|
|||
{ \
|
||||
GetMonData(&gPlayerParty[monIndex], MON_DATA_NICKNAME, text); \
|
||||
} \
|
||||
StringGetEnd10(text); \
|
||||
StringGet_Nickname(text); \
|
||||
toCpy = text;
|
||||
|
||||
u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst)
|
||||
|
@ -2466,49 +2466,49 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst)
|
|||
case B_TXT_PLAYER_MON1_NAME: // first player poke name
|
||||
GetMonData(&gPlayerParty[gBattlerPartyIndexes[GetBattlerAtPosition(B_POSITION_PLAYER_LEFT)]],
|
||||
MON_DATA_NICKNAME, text);
|
||||
StringGetEnd10(text);
|
||||
StringGet_Nickname(text);
|
||||
toCpy = text;
|
||||
break;
|
||||
case B_TXT_OPPONENT_MON1_NAME: // first enemy poke name
|
||||
GetMonData(&gEnemyParty[gBattlerPartyIndexes[GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT)]],
|
||||
MON_DATA_NICKNAME, text);
|
||||
StringGetEnd10(text);
|
||||
StringGet_Nickname(text);
|
||||
toCpy = text;
|
||||
break;
|
||||
case B_TXT_PLAYER_MON2_NAME: // second player poke name
|
||||
GetMonData(&gPlayerParty[gBattlerPartyIndexes[GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT)]],
|
||||
MON_DATA_NICKNAME, text);
|
||||
StringGetEnd10(text);
|
||||
StringGet_Nickname(text);
|
||||
toCpy = text;
|
||||
break;
|
||||
case B_TXT_OPPONENT_MON2_NAME: // second enemy poke name
|
||||
GetMonData(&gEnemyParty[gBattlerPartyIndexes[GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT)]],
|
||||
MON_DATA_NICKNAME, text);
|
||||
StringGetEnd10(text);
|
||||
StringGet_Nickname(text);
|
||||
toCpy = text;
|
||||
break;
|
||||
case B_TXT_LINK_PLAYER_MON1_NAME: // link first player poke name
|
||||
GetMonData(&gPlayerParty[gBattlerPartyIndexes[gLinkPlayers[multiplayerId].id]],
|
||||
MON_DATA_NICKNAME, text);
|
||||
StringGetEnd10(text);
|
||||
StringGet_Nickname(text);
|
||||
toCpy = text;
|
||||
break;
|
||||
case B_TXT_LINK_OPPONENT_MON1_NAME: // link first opponent poke name
|
||||
GetMonData(&gEnemyParty[gBattlerPartyIndexes[gLinkPlayers[multiplayerId].id ^ 1]],
|
||||
MON_DATA_NICKNAME, text);
|
||||
StringGetEnd10(text);
|
||||
StringGet_Nickname(text);
|
||||
toCpy = text;
|
||||
break;
|
||||
case B_TXT_LINK_PLAYER_MON2_NAME: // link second player poke name
|
||||
GetMonData(&gPlayerParty[gBattlerPartyIndexes[gLinkPlayers[multiplayerId].id ^ 2]],
|
||||
MON_DATA_NICKNAME, text);
|
||||
StringGetEnd10(text);
|
||||
StringGet_Nickname(text);
|
||||
toCpy = text;
|
||||
break;
|
||||
case B_TXT_LINK_OPPONENT_MON2_NAME: // link second opponent poke name
|
||||
GetMonData(&gEnemyParty[gBattlerPartyIndexes[gLinkPlayers[multiplayerId].id ^ 3]],
|
||||
MON_DATA_NICKNAME, text);
|
||||
StringGetEnd10(text);
|
||||
StringGet_Nickname(text);
|
||||
toCpy = text;
|
||||
break;
|
||||
case B_TXT_ATK_NAME_WITH_PREFIX_MON1: // attacker name with prefix, only battlerId 0/1
|
||||
|
@ -2521,7 +2521,7 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst)
|
|||
else
|
||||
GetMonData(&gEnemyParty[gBattlerPartyIndexes[GetBattlerAtPosition(GET_BATTLER_SIDE(gBattlerAttacker)) + 2]], MON_DATA_NICKNAME, text);
|
||||
|
||||
StringGetEnd10(text);
|
||||
StringGet_Nickname(text);
|
||||
toCpy = text;
|
||||
break;
|
||||
case B_TXT_ATK_NAME_WITH_PREFIX: // attacker name with prefix
|
||||
|
@ -2903,7 +2903,7 @@ static void ExpandBattleTextBuffPlaceholders(const u8 *src, u8 *dst)
|
|||
|
||||
GetMonData(&gEnemyParty[src[srcID + 2]], MON_DATA_NICKNAME, text);
|
||||
}
|
||||
StringGetEnd10(text);
|
||||
StringGet_Nickname(text);
|
||||
StringAppend(dst, text);
|
||||
srcID += 3;
|
||||
break;
|
||||
|
@ -2920,7 +2920,7 @@ static void ExpandBattleTextBuffPlaceholders(const u8 *src, u8 *dst)
|
|||
GetMonData(&gPlayerParty[src[srcID + 2]], MON_DATA_NICKNAME, dst);
|
||||
else
|
||||
GetMonData(&gEnemyParty[src[srcID + 2]], MON_DATA_NICKNAME, dst);
|
||||
StringGetEnd10(dst);
|
||||
StringGet_Nickname(dst);
|
||||
srcID += 3;
|
||||
break;
|
||||
case B_BUFF_NEGATIVE_FLAVOR: // flavor table
|
||||
|
|
|
@ -2160,7 +2160,7 @@ static void SaveBattleTowerRecord(void)
|
|||
playerRecord->lvlMode = lvlMode;
|
||||
playerRecord->facilityClass = class;
|
||||
CopyTrainerId(playerRecord->trainerId, gSaveBlock2Ptr->playerTrainerId);
|
||||
StringCopy7(playerRecord->name, gSaveBlock2Ptr->playerName);
|
||||
StringCopy_PlayerName(playerRecord->name, gSaveBlock2Ptr->playerName);
|
||||
playerRecord->winStreak = GetCurrentBattleTowerWinStreak(lvlMode, battleMode);
|
||||
|
||||
for (i = 0; i < EASY_CHAT_BATTLE_WORDS_COUNT; i++)
|
||||
|
@ -2831,7 +2831,7 @@ static void FillEReaderTrainerWithPlayerData(void)
|
|||
}
|
||||
|
||||
CopyTrainerId(ereaderTrainer->trainerId, gSaveBlock2Ptr->playerTrainerId);
|
||||
StringCopy7(ereaderTrainer->name, gSaveBlock2Ptr->playerName);
|
||||
StringCopy_PlayerName(ereaderTrainer->name, gSaveBlock2Ptr->playerName);
|
||||
|
||||
ereaderTrainer->winStreak = 1;
|
||||
|
||||
|
|
|
@ -2794,7 +2794,7 @@ void CreateContestMonFromParty(u8 partyIndex)
|
|||
gContestMons[gContestPlayerMonIndex].highestRank = 0;
|
||||
gContestMons[gContestPlayerMonIndex].species = GetMonData(&gPlayerParty[partyIndex], MON_DATA_SPECIES);
|
||||
GetMonData(&gPlayerParty[partyIndex], MON_DATA_NICKNAME, name);
|
||||
StringGetEnd10(name);
|
||||
StringGet_Nickname(name);
|
||||
if (gLinkContestFlags & LINK_CONTEST_FLAG_IS_LINK)
|
||||
{
|
||||
StripMonNameForLinkContest(name, GetMonData(&gPlayerParty[partyIndex], MON_DATA_LANGUAGE));
|
||||
|
|
|
@ -2253,7 +2253,7 @@ void Task_LinkContest_FinalizeConnection(u8 taskId)
|
|||
{
|
||||
// Succesfully connected
|
||||
for (i = 0; i < CONTESTANT_COUNT; i++)
|
||||
StringGetEnd10(gContestMons[i].nickname);
|
||||
StringGet_Nickname(gContestMons[i].nickname);
|
||||
|
||||
DestroyTask(taskId);
|
||||
SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, WARP_ID_NONE);
|
||||
|
|
|
@ -96,7 +96,7 @@ u8 *GetMonNickname2(struct Pokemon *mon, u8 *dest)
|
|||
u8 nickname[POKEMON_NAME_LENGTH * 2];
|
||||
|
||||
GetMonData(mon, MON_DATA_NICKNAME, nickname);
|
||||
return StringCopy10(dest, nickname);
|
||||
return StringCopy_Nickname(dest, nickname);
|
||||
}
|
||||
|
||||
u8 *GetBoxMonNickname(struct BoxPokemon *mon, u8 *dest)
|
||||
|
@ -104,7 +104,7 @@ u8 *GetBoxMonNickname(struct BoxPokemon *mon, u8 *dest)
|
|||
u8 nickname[POKEMON_NAME_LENGTH * 2];
|
||||
|
||||
GetBoxMonData(mon, MON_DATA_NICKNAME, nickname);
|
||||
return StringCopy10(dest, nickname);
|
||||
return StringCopy_Nickname(dest, nickname);
|
||||
}
|
||||
|
||||
u8 CountPokemonInDaycare(struct DayCare *daycare)
|
||||
|
|
|
@ -252,7 +252,7 @@ void EvolutionScene(struct Pokemon* mon, u16 postEvoSpecies, bool8 canStopEvo, u
|
|||
AllocateMonSpritesGfx();
|
||||
|
||||
GetMonData(mon, MON_DATA_NICKNAME, name);
|
||||
StringCopy10(gStringVar1, name);
|
||||
StringCopy_Nickname(gStringVar1, name);
|
||||
StringCopy(gStringVar2, gSpeciesNames[postEvoSpecies]);
|
||||
|
||||
// preEvo sprite
|
||||
|
@ -474,7 +474,7 @@ void TradeEvolutionScene(struct Pokemon* mon, u16 postEvoSpecies, u8 preEvoSprit
|
|||
u8 ID;
|
||||
|
||||
GetMonData(mon, MON_DATA_NICKNAME, name);
|
||||
StringCopy10(gStringVar1, name);
|
||||
StringCopy_Nickname(gStringVar1, name);
|
||||
StringCopy(gStringVar2, gSpeciesNames[postEvoSpecies]);
|
||||
|
||||
gAffineAnimsDisabled = TRUE;
|
||||
|
@ -787,7 +787,7 @@ static void Task_EvolutionScene(u8 taskId)
|
|||
gTasks[taskId].tLearnsFirstMove = FALSE;
|
||||
gTasks[taskId].tLearnMoveState = MVSTATE_INTRO_MSG_1;
|
||||
GetMonData(mon, MON_DATA_NICKNAME, text);
|
||||
StringCopy10(gBattleTextBuff1, text);
|
||||
StringCopy_Nickname(gBattleTextBuff1, text);
|
||||
|
||||
if (var == MON_HAS_MAX_MOVES)
|
||||
gTasks[taskId].tState = EVOSTATE_REPLACE_MOVE;
|
||||
|
@ -1202,7 +1202,7 @@ static void Task_TradeEvolutionScene(u8 taskId)
|
|||
gTasks[taskId].tLearnsFirstMove = FALSE;
|
||||
gTasks[taskId].tLearnMoveState = 0;
|
||||
GetMonData(mon, MON_DATA_NICKNAME, text);
|
||||
StringCopy10(gBattleTextBuff1, text);
|
||||
StringCopy_Nickname(gBattleTextBuff1, text);
|
||||
|
||||
if (var == MON_HAS_MAX_MOVES)
|
||||
gTasks[taskId].tState = T_EVOSTATE_REPLACE_MOVE;
|
||||
|
|
|
@ -50,7 +50,7 @@ static void FaintFromFieldPoison(u8 partyIdx)
|
|||
AdjustFriendship(pokemon, FRIENDSHIP_EVENT_FAINT_FIELD_PSN);
|
||||
SetMonData(pokemon, MON_DATA_STATUS, &status);
|
||||
GetMonData(pokemon, MON_DATA_NICKNAME, gStringVar1);
|
||||
StringGetEnd10(gStringVar1);
|
||||
StringGet_Nickname(gStringVar1);
|
||||
}
|
||||
|
||||
static bool32 MonFaintedFromPoison(u8 partyIdx)
|
||||
|
|
|
@ -183,7 +183,7 @@ bool8 HasAnotherPlayerGivenFavorLadyItem(void)
|
|||
sFavorLadyPtr = &gSaveBlock1Ptr->lilycoveLady.favor;
|
||||
if (sFavorLadyPtr->playerName[0] != EOS)
|
||||
{
|
||||
StringCopy7(gStringVar3, sFavorLadyPtr->playerName);
|
||||
StringCopy_PlayerName(gStringVar3, sFavorLadyPtr->playerName);
|
||||
ConvertInternationalString(gStringVar3, sFavorLadyPtr->language);
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -204,7 +204,7 @@ void BufferFavorLadyItemName(void)
|
|||
static void SetFavorLadyPlayerName(const u8 *src, u8 *dest)
|
||||
{
|
||||
memset(dest, EOS, PLAYER_NAME_LENGTH + 1);
|
||||
StringCopy7(dest, src);
|
||||
StringCopy_PlayerName(dest, src);
|
||||
}
|
||||
|
||||
void BufferFavorLadyPlayerName(void)
|
||||
|
@ -396,12 +396,12 @@ static u8 BufferQuizAuthorName(void)
|
|||
sQuizLadyPtr = &gSaveBlock1Ptr->lilycoveLady.quiz;
|
||||
if (sQuizLadyPtr->playerName[0] == EOS)
|
||||
{
|
||||
StringCopy7(gStringVar1, gText_QuizLady_Lady);
|
||||
StringCopy_PlayerName(gStringVar1, gText_QuizLady_Lady);
|
||||
authorNameId = QUIZ_AUTHOR_NAME_LADY;
|
||||
}
|
||||
else
|
||||
{
|
||||
StringCopy7(gStringVar1, sQuizLadyPtr->playerName);
|
||||
StringCopy_PlayerName(gStringVar1, sQuizLadyPtr->playerName);
|
||||
ConvertInternationalString(gStringVar1, sQuizLadyPtr->language);
|
||||
nameLen = GetPlayerNameLength(sQuizLadyPtr->playerName);
|
||||
if (nameLen == GetPlayerNameLength(gSaveBlock2Ptr->playerName))
|
||||
|
@ -552,7 +552,7 @@ void QuizLadyRecordCustomQuizData(void)
|
|||
sQuizLadyPtr->prize = gSpecialVar_ItemId;
|
||||
for (i = 0; i < TRAINER_ID_LENGTH; i++)
|
||||
sQuizLadyPtr->playerTrainerId[i] = gSaveBlock2Ptr->playerTrainerId[i];
|
||||
StringCopy7(sQuizLadyPtr->playerName, gSaveBlock2Ptr->playerName);
|
||||
StringCopy_PlayerName(sQuizLadyPtr->playerName, gSaveBlock2Ptr->playerName);
|
||||
sQuizLadyPtr->language = gGameLanguage;
|
||||
}
|
||||
|
||||
|
@ -696,7 +696,7 @@ static void BufferContestLadyCategoryAndMonName(u8 *category, u8 *nickname)
|
|||
{
|
||||
sContestLadyPtr = &gSaveBlock1Ptr->lilycoveLady.contest;
|
||||
StringCopy(category, sContestLadyCategoryNames[sContestLadyPtr->category]);
|
||||
StringCopy10(nickname, sContestLadyMonNames[sContestLadyPtr->category]);
|
||||
StringCopy_Nickname(nickname, sContestLadyMonNames[sContestLadyPtr->category]);
|
||||
}
|
||||
|
||||
void BufferContestLadyMonName(u8 *category, u8 *nickname)
|
||||
|
|
|
@ -113,7 +113,7 @@ void PickLotteryCornerTicket(void)
|
|||
gSpecialVar_0x8006 = 1;
|
||||
GetBoxMonData(&gPokemonStoragePtr->boxes[box][slot], MON_DATA_NICKNAME, gStringVar1);
|
||||
}
|
||||
StringGetEnd10(gStringVar1);
|
||||
StringGet_Nickname(gStringVar1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -919,7 +919,7 @@ static u8 *GetConditionMenuMonString(u8 *dst, u16 boxId, u16 monId)
|
|||
if (GetBoxOrPartyMonData(box, mon, MON_DATA_IS_EGG, NULL))
|
||||
return StringCopyPadded(dst, gText_EggNickname, 0, 12);
|
||||
GetBoxOrPartyMonData(box, mon, MON_DATA_NICKNAME, dst);
|
||||
StringGetEnd10(dst);
|
||||
StringGet_Nickname(dst);
|
||||
species = GetBoxOrPartyMonData(box, mon, MON_DATA_SPECIES, NULL);
|
||||
if (box == TOTAL_BOXES_COUNT) // Party mon.
|
||||
{
|
||||
|
|
|
@ -912,7 +912,7 @@ static void CreateLearnableMovesList(void)
|
|||
}
|
||||
|
||||
GetMonData(&gPlayerParty[sMoveRelearnerStruct->partyMon], MON_DATA_NICKNAME, nickname);
|
||||
StringCopy10(gStringVar1, nickname);
|
||||
StringCopy_Nickname(gStringVar1, nickname);
|
||||
sMoveRelearnerStruct->menuItems[sMoveRelearnerStruct->numMenuChoices].name = gText_Cancel;
|
||||
sMoveRelearnerStruct->menuItems[sMoveRelearnerStruct->numMenuChoices].id = LIST_CANCEL;
|
||||
sMoveRelearnerStruct->numMenuChoices++;
|
||||
|
|
|
@ -953,7 +953,7 @@ static void DisplayPartyPokemonDataForMultiBattle(u8 slot)
|
|||
{
|
||||
menuBox->infoRects->blitFunc(menuBox->windowId, 0, 0, 0, 0, FALSE);
|
||||
StringCopy(gStringVar1, gMultiPartnerParty[actualSlot].nickname);
|
||||
StringGetEnd10(gStringVar1);
|
||||
StringGet_Nickname(gStringVar1);
|
||||
ConvertInternationalPlayerName(gStringVar1);
|
||||
DisplayPartyPokemonBarDetail(menuBox->windowId, gStringVar1, 0, menuBox->infoRects->dimensions);
|
||||
DisplayPartyPokemonLevel(gMultiPartnerParty[actualSlot].level, menuBox);
|
||||
|
@ -1621,7 +1621,7 @@ static s8 GetNewSlotDoubleLayout(s8 slotId, s8 movementDir)
|
|||
u8* GetMonNickname(struct Pokemon *mon, u8 *dest)
|
||||
{
|
||||
GetMonData(mon, MON_DATA_NICKNAME, dest);
|
||||
return StringGetEnd10(dest);
|
||||
return StringGet_Nickname(dest);
|
||||
}
|
||||
|
||||
#define tKeepOpen data[0]
|
||||
|
|
|
@ -4647,7 +4647,7 @@ void CopyPlayerPartyMonToBattleData(u8 battlerId, u8 partyIndex)
|
|||
gBattleMons[battlerId].type2 = gBaseStats[gBattleMons[battlerId].species].type2;
|
||||
gBattleMons[battlerId].ability = GetAbilityBySpecies(gBattleMons[battlerId].species, gBattleMons[battlerId].abilityNum);
|
||||
GetMonData(&gPlayerParty[partyIndex], MON_DATA_NICKNAME, nickname);
|
||||
StringCopy10(gBattleMons[battlerId].nickname, nickname);
|
||||
StringCopy_Nickname(gBattleMons[battlerId].nickname, nickname);
|
||||
GetMonData(&gPlayerParty[partyIndex], MON_DATA_OT_NAME, gBattleMons[battlerId].otName);
|
||||
|
||||
hpSwitchout = &gBattleStruct->hpOnSwitchout[GetBattlerSide(battlerId)];
|
||||
|
|
|
@ -6888,7 +6888,7 @@ static void SetDisplayMonData(void *pokemon, u8 mode)
|
|||
sStorage->displayMonIsEgg = GetMonData(mon, MON_DATA_IS_EGG);
|
||||
|
||||
GetMonData(mon, MON_DATA_NICKNAME, sStorage->displayMonName);
|
||||
StringGetEnd10(sStorage->displayMonName);
|
||||
StringGet_Nickname(sStorage->displayMonName);
|
||||
sStorage->displayMonLevel = GetMonData(mon, MON_DATA_LEVEL);
|
||||
sStorage->displayMonMarkings = GetMonData(mon, MON_DATA_MARKINGS);
|
||||
sStorage->displayMonPersonality = GetMonData(mon, MON_DATA_PERSONALITY);
|
||||
|
@ -6913,7 +6913,7 @@ static void SetDisplayMonData(void *pokemon, u8 mode)
|
|||
|
||||
|
||||
GetBoxMonData(boxMon, MON_DATA_NICKNAME, sStorage->displayMonName);
|
||||
StringGetEnd10(sStorage->displayMonName);
|
||||
StringGet_Nickname(sStorage->displayMonName);
|
||||
sStorage->displayMonLevel = GetLevelFromBoxMonExp(boxMon);
|
||||
sStorage->displayMonMarkings = GetBoxMonData(boxMon, MON_DATA_MARKINGS);
|
||||
sStorage->displayMonPersonality = GetBoxMonData(boxMon, MON_DATA_PERSONALITY);
|
||||
|
|
|
@ -351,7 +351,7 @@ static u8 *CopyConditionMonNameGender(u8 *str, u16 listId, bool8 arg3)
|
|||
return StringCopyPadded(str, gText_EggNickname, CHAR_SPACE, 12);
|
||||
|
||||
GetBoxOrPartyMonData(boxId, monId, MON_DATA_NICKNAME, str);
|
||||
StringGetEnd10(str);
|
||||
StringGet_Nickname(str);
|
||||
species = GetBoxOrPartyMonData(boxId, monId, MON_DATA_SPECIES, NULL);
|
||||
if (boxId == TOTAL_BOXES_COUNT)
|
||||
{
|
||||
|
|
|
@ -711,7 +711,7 @@ static void BufferSearchMonListItem(struct PokenavMonListItem * item, u8 * dest)
|
|||
GetBoxMonData(mon, MON_DATA_NICKNAME, gStringVar3);
|
||||
}
|
||||
|
||||
StringGetEnd10(gStringVar3);
|
||||
StringGet_Nickname(gStringVar3);
|
||||
dest = GetStringClearToWidth(dest, FONT_NORMAL, gStringVar3, 60);
|
||||
switch (gender)
|
||||
{
|
||||
|
|
|
@ -721,7 +721,7 @@ static void BufferRibbonMonInfoText(struct PokenavListItem * listItem, u8 * dest
|
|||
GetBoxMonData(mon, MON_DATA_NICKNAME, gStringVar3);
|
||||
}
|
||||
|
||||
StringGetEnd10(gStringVar3);
|
||||
StringGet_Nickname(gStringVar3);
|
||||
dest = GetStringClearToWidth(dest, FONT_NORMAL, gStringVar3, 60);
|
||||
switch (gender)
|
||||
{
|
||||
|
|
|
@ -397,7 +397,7 @@ static void GetMonNicknameLevelGender(u8 *nick, u8 *level, u8 *gender)
|
|||
*level = GetLevelFromBoxMonExp(boxMon);
|
||||
GetBoxMonData(boxMon, MON_DATA_NICKNAME, nick);
|
||||
}
|
||||
StringGetEnd10(nick);
|
||||
StringGet_Nickname(nick);
|
||||
}
|
||||
|
||||
static void GetMonSpeciesPersonalityOtId(u16 *species, u32 *personality, u32 *otId)
|
||||
|
|
|
@ -1575,7 +1575,7 @@ bool8 ScrCmd_bufferpartymonnick(struct ScriptContext *ctx)
|
|||
u16 partyIndex = VarGet(ScriptReadHalfword(ctx));
|
||||
|
||||
GetMonData(&gPlayerParty[partyIndex], MON_DATA_NICKNAME, sScriptStringVars[stringVarIndex]);
|
||||
StringGetEnd10(sScriptStringVars[stringVarIndex]);
|
||||
StringGet_Nickname(sScriptStringVars[stringVarIndex]);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
14
src/trade.c
14
src/trade.c
|
@ -1880,7 +1880,7 @@ static u8 GetMonNicknameWidth(u8 *str, u8 whichParty, u8 monIdx)
|
|||
else
|
||||
GetMonData(&gEnemyParty[monIdx], MON_DATA_NICKNAME, nickname);
|
||||
|
||||
StringCopy10(str, nickname);
|
||||
StringCopy_Nickname(str, nickname);
|
||||
return GetStringWidth(FONT_SMALL, str, GetFontAttribute(FONT_SMALL, FONTATTR_LETTER_SPACING));
|
||||
}
|
||||
|
||||
|
@ -1942,7 +1942,7 @@ static void PrintPartyNicknamesForTradeMenu(u8 whichParty)
|
|||
for (i = 0; i < sTradeMenuData->partyCounts[whichParty]; i++)
|
||||
{
|
||||
GetMonData(&party[i], MON_DATA_NICKNAME, nickname);
|
||||
StringCopy10(str, nickname);
|
||||
StringCopy_Nickname(str, nickname);
|
||||
PrintMonNicknameForTradeMenu(whichParty, i, str);
|
||||
}
|
||||
}
|
||||
|
@ -3266,17 +3266,17 @@ static void BufferTradeSceneStrings(void)
|
|||
mpId = GetMultiplayerId();
|
||||
StringCopy(gStringVar1, gLinkPlayers[mpId ^ 1].name);
|
||||
GetMonData(&gEnemyParty[gSelectedTradeMonPositions[TRADE_PARTNER] % PARTY_SIZE], MON_DATA_NICKNAME, name);
|
||||
StringCopy10(gStringVar3, name);
|
||||
StringCopy_Nickname(gStringVar3, name);
|
||||
GetMonData(&gPlayerParty[gSelectedTradeMonPositions[TRADE_PLAYER]], MON_DATA_NICKNAME, name);
|
||||
StringCopy10(gStringVar2, name);
|
||||
StringCopy_Nickname(gStringVar2, name);
|
||||
}
|
||||
else
|
||||
{
|
||||
ingameTrade = &sIngameTrades[gSpecialVar_0x8004];
|
||||
StringCopy(gStringVar1, ingameTrade->otName);
|
||||
StringCopy10(gStringVar3, ingameTrade->nickname);
|
||||
StringCopy_Nickname(gStringVar3, ingameTrade->nickname);
|
||||
GetMonData(&gPlayerParty[gSpecialVar_0x8005], MON_DATA_NICKNAME, name);
|
||||
StringCopy10(gStringVar2, name);
|
||||
StringCopy_Nickname(gStringVar2, name);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4479,7 +4479,7 @@ static void BufferInGameTradeMonName(void)
|
|||
u8 nickname[32];
|
||||
const struct InGameTrade *inGameTrade = &sIngameTrades[gSpecialVar_0x8004];
|
||||
GetMonData(&gPlayerParty[gSpecialVar_0x8005], MON_DATA_NICKNAME, nickname);
|
||||
StringCopy10(gStringVar1, nickname);
|
||||
StringCopy_Nickname(gStringVar1, nickname);
|
||||
StringCopy(gStringVar2, gSpeciesNames[inGameTrade->species]);
|
||||
}
|
||||
|
||||
|
|
4
src/tv.c
4
src/tv.c
|
@ -2959,7 +2959,7 @@ static void InterviewBefore_PkmnFanClubOpinions(void)
|
|||
{
|
||||
StringCopy(gStringVar1, gSpeciesNames[GetMonData(&gPlayerParty[GetLeadMonIndex()], MON_DATA_SPECIES, NULL)]);
|
||||
GetMonData(&gPlayerParty[GetLeadMonIndex()], MON_DATA_NICKNAME, gStringVar2);
|
||||
StringGetEnd10(gStringVar2);
|
||||
StringGet_Nickname(gStringVar2);
|
||||
InitializeEasyChatWordArray(gSaveBlock1Ptr->tvShows[sCurTVShowSlot].fanclubOpinions.words,
|
||||
ARRAY_COUNT(gSaveBlock1Ptr->tvShows[sCurTVShowSlot].fanclubOpinions.words));
|
||||
}
|
||||
|
@ -3325,7 +3325,7 @@ static void ChangeBoxPokemonNickname_CB(void)
|
|||
void BufferMonNickname(void)
|
||||
{
|
||||
GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_NICKNAME, gStringVar1);
|
||||
StringGetEnd10(gStringVar1);
|
||||
StringGet_Nickname(gStringVar1);
|
||||
}
|
||||
|
||||
void IsMonOTIDNotPlayers(void)
|
||||
|
|
|
@ -4502,6 +4502,6 @@ static void ViewURoomPartnerTrainerCard(u8 *unused, struct WirelessLink_URoom *d
|
|||
|
||||
static void CopyAndTranslatePlayerName(u8 *dest, struct RfuPlayer *player)
|
||||
{
|
||||
StringCopy7(dest, player->rfu.name);
|
||||
StringCopy_PlayerName(dest, player->rfu.name);
|
||||
ConvertInternationalString(dest, player->rfu.data.compatibility.language);
|
||||
}
|
||||
|
|
|
@ -868,7 +868,7 @@ static void AskUsePokeblock(void)
|
|||
u8 stringBuffer[0x40];
|
||||
|
||||
GetMonData(&gPlayerParty[GetPartyIdFromSelectionId(sMenu->info.curSelection)], MON_DATA_NICKNAME, stringBuffer);
|
||||
StringGetEnd10(stringBuffer);
|
||||
StringGet_Nickname(stringBuffer);
|
||||
StringAppend(stringBuffer, gText_GetsAPokeBlockQuestion);
|
||||
StringCopy(gStringVar4, stringBuffer);
|
||||
FillWindowPixelBuffer(WIN_TEXT, 17);
|
||||
|
|
Loading…
Reference in New Issue