Battle debug menu: highlight chosen action and change separator (#7709)
This commit is contained in:
parent
8486e0e045
commit
ce8f532c20
@ -720,17 +720,27 @@ void CB2_BattleDebugMenu(void)
|
||||
}
|
||||
}
|
||||
|
||||
enum {
|
||||
COLORID_RED,
|
||||
};
|
||||
|
||||
static const u8 sTextColorTable[][3] =
|
||||
{
|
||||
[COLORID_RED] = {TEXT_COLOR_WHITE, TEXT_COLOR_RED, TEXT_COLOR_LIGHT_RED},
|
||||
};
|
||||
|
||||
static void PutMovesPointsText(struct BattleDebugMenu *data)
|
||||
{
|
||||
u32 i, j, count, battlerDef;
|
||||
u32 i, j, count, battlerDef, chosenMoveIndex = gAiBattleData->chosenMoveIndex[data->aiBattlerId];
|
||||
u8 *text = Alloc(0x50);
|
||||
|
||||
FillWindowPixelBuffer(data->aiMovesWindowId, 0x11);
|
||||
AddTextPrinterParameterized(data->aiMovesWindowId, FONT_NORMAL, COMPOUND_STRING("Score/Dmg"), 3, 0, 0, NULL);
|
||||
for (i = 0; i < MAX_MON_MOVES; i++)
|
||||
{
|
||||
text[0] = CHAR_SPACE;
|
||||
StringCopy(text + 1, GetMoveName(gBattleMons[data->aiBattlerId].moves[i]));
|
||||
AddTextPrinterParameterized(data->aiMovesWindowId, FONT_NORMAL, text, 0, i * 15, 0, NULL);
|
||||
AddTextPrinterParameterized(data->aiMovesWindowId, FONT_NORMAL, text, 0, (i * 15) + 15, 0, NULL);
|
||||
for (count = 0, j = 0; j < MAX_BATTLERS_COUNT; j++)
|
||||
{
|
||||
if (data->spriteIds.aiIconSpriteIds[j] == 0xFF)
|
||||
@ -739,12 +749,24 @@ static void PutMovesPointsText(struct BattleDebugMenu *data)
|
||||
ConvertIntToDecimalStringN(text,
|
||||
gAiBattleData->finalScore[data->aiBattlerId][battlerDef][i],
|
||||
STR_CONV_MODE_RIGHT_ALIGN, 3);
|
||||
AddTextPrinterParameterized(data->aiMovesWindowId, FONT_NORMAL, text, 83 + count * 54, i * 15, 0, NULL);
|
||||
// If chosen move and chosen target
|
||||
if ((chosenMoveIndex == i) && (gAiBattleData->chosenTarget[data->aiBattlerId] == j) && !(gAiLogicData->shouldSwitch & (1u << data->aiBattlerId)))
|
||||
AddTextPrinterParameterized3(data->aiMovesWindowId, FONT_NORMAL, 84 + count * 54, (i * 15) + 15, sTextColorTable[COLORID_RED], 0, text);
|
||||
else
|
||||
AddTextPrinterParameterized(data->aiMovesWindowId, FONT_NORMAL, text, 84 + count * 54, (i * 15) + 15, 0, NULL);
|
||||
|
||||
if ((chosenMoveIndex == i) && (gAiBattleData->chosenTarget[data->aiBattlerId] == j) && !(gAiLogicData->shouldSwitch & (1u << data->aiBattlerId)))
|
||||
AddTextPrinterParameterized3(data->aiMovesWindowId, FONT_NORMAL, 103 + count * 54, (i * 15) + 15, sTextColorTable[COLORID_RED], 0, COMPOUND_STRING("/"));
|
||||
else
|
||||
AddTextPrinterParameterized(data->aiMovesWindowId, FONT_NORMAL, COMPOUND_STRING("/"), 103 + count * 54, (i * 15) + 15, 0, NULL);
|
||||
|
||||
ConvertIntToDecimalStringN(text,
|
||||
AI_GetDamage(data->aiBattlerId, battlerDef, i, AI_ATTACKING, gAiLogicData),
|
||||
STR_CONV_MODE_RIGHT_ALIGN, 3);
|
||||
AddTextPrinterParameterized(data->aiMovesWindowId, FONT_NORMAL, text, 110 + count * 54, i * 15, 0, NULL);
|
||||
STR_CONV_MODE_LEADING_ZEROS, 3);
|
||||
if ((chosenMoveIndex == i) && (gAiBattleData->chosenTarget[data->aiBattlerId] == j) && !(gAiLogicData->shouldSwitch & (1u << data->aiBattlerId)))
|
||||
AddTextPrinterParameterized3(data->aiMovesWindowId, FONT_NORMAL, 110 + count * 54, (i * 15) + 15, sTextColorTable[COLORID_RED], 0, text);
|
||||
else
|
||||
AddTextPrinterParameterized(data->aiMovesWindowId, FONT_NORMAL, text, 110 + count * 54, (i * 15) + 15, 0, NULL);
|
||||
|
||||
count++;
|
||||
}
|
||||
@ -754,14 +776,8 @@ static void PutMovesPointsText(struct BattleDebugMenu *data)
|
||||
{
|
||||
struct Pokemon *party = GetBattlerParty(data->aiBattlerId);
|
||||
u32 switchMon = GetMonData(&party[gAiLogicData->mostSuitableMonId[data->aiBattlerId]], MON_DATA_SPECIES);
|
||||
AddTextPrinterParameterized(data->aiMovesWindowId, FONT_NORMAL, COMPOUND_STRING("Switching to "), 74, 64, 0, NULL);
|
||||
AddTextPrinterParameterized(data->aiMovesWindowId, FONT_NORMAL, gSpeciesInfo[switchMon].speciesName, 74 + 68, 64, 0, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
u32 chosenMoveIndex = gAiBattleData->chosenMoveIndex[data->aiBattlerId];
|
||||
AddTextPrinterParameterized(data->aiMovesWindowId, FONT_NORMAL, COMPOUND_STRING("Chosen move: "), 74, 64, 0, NULL);
|
||||
AddTextPrinterParameterized(data->aiMovesWindowId, FONT_NORMAL, GetMoveName(gBattleMons[data->aiBattlerId].moves[chosenMoveIndex]), 74 + 68, 64, 0, NULL);
|
||||
AddTextPrinterParameterized3(data->aiMovesWindowId, FONT_NORMAL, 74, 79, sTextColorTable[COLORID_RED], 0, COMPOUND_STRING("Switching to "));
|
||||
AddTextPrinterParameterized3(data->aiMovesWindowId, FONT_NORMAL, 74 + 68, 79, sTextColorTable[COLORID_RED], 0, gSpeciesInfo[switchMon].speciesName);
|
||||
}
|
||||
|
||||
CopyWindowToVram(data->aiMovesWindowId, COPYWIN_FULL);
|
||||
@ -813,7 +829,7 @@ static void Task_ShowAiPoints(u8 taskId)
|
||||
{
|
||||
data->spriteIds.aiIconSpriteIds[i] = CreateMonIcon(gBattleMons[i].species,
|
||||
SpriteCallbackDummy,
|
||||
95 + (count * 60), 17, 0, 0);
|
||||
106 + (count * 54), 17, 0, 0);
|
||||
gSprites[data->spriteIds.aiIconSpriteIds[i]].data[0] = i; // battler id
|
||||
count++;
|
||||
}
|
||||
@ -828,7 +844,7 @@ static void Task_ShowAiPoints(u8 taskId)
|
||||
GetMonData(mon, MON_DATA_IS_SHINY),
|
||||
gBattleMons[data->aiBattlerId].personality,
|
||||
TRUE,
|
||||
39, 130, 15, TAG_NONE);
|
||||
39, 135, 15, TAG_NONE);
|
||||
data->aiViewState++;
|
||||
break;
|
||||
// Put text
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user