Skip to content

Commit

Permalink
Debug menu cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
AsparagusEduardo committed Oct 8, 2023
1 parent 410dc1d commit a34e0f6
Show file tree
Hide file tree
Showing 6 changed files with 978 additions and 840 deletions.
16 changes: 8 additions & 8 deletions data/scripts/debug.inc
Original file line number Diff line number Diff line change
Expand Up @@ -69,28 +69,28 @@ Debug_BoxFilledMessage::
Debug_BoxFilledMessage_Text:
.string "Storage boxes filled!$"

Debug_Script_1::
Debug_EventScript_Script_1::
end

Debug_Script_2::
Debug_EventScript_Script_2::
end

Debug_Script_3::
Debug_EventScript_Script_3::
end

Debug_Script_4::
Debug_EventScript_Script_4::
end

Debug_Script_5::
Debug_EventScript_Script_5::
end

Debug_Script_6::
Debug_EventScript_Script_6::
end

Debug_Script_7::
Debug_EventScript_Script_7::
end

Debug_Script_8::
Debug_EventScript_Script_8::
end

Debug_CheckSaveBlock::
Expand Down
32 changes: 16 additions & 16 deletions src/battle_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ void CB2_BattleDebugMenu(void)
data->currentMainListItemId = 0;
data->activeWindow = ACTIVE_WIN_MAIN;
data->secondaryListTaskId = 0xFF;
CopyWindowToVram(data->mainListWindowId, 3);
CopyWindowToVram(data->mainListWindowId, COPYWIN_FULL);
gMain.state++;
break;
case 5:
Expand All @@ -737,7 +737,7 @@ static void PutMovesPointsText(struct BattleDebugMenu *data)
{
text[0] = CHAR_SPACE;
StringCopy(text + 1, gMoveNames[gBattleMons[data->aiBattlerId].moves[i]]);
AddTextPrinterParameterized(data->aiMovesWindowId, 1, text, 0, i * 15, 0, NULL);
AddTextPrinterParameterized(data->aiMovesWindowId, FONT_NORMAL, text, 0, i * 15, 0, NULL);
for (count = 0, j = 0; j < MAX_BATTLERS_COUNT; j++)
{
if (data->spriteIds.aiIconSpriteIds[j] == 0xFF)
Expand All @@ -746,18 +746,18 @@ static void PutMovesPointsText(struct BattleDebugMenu *data)
ConvertIntToDecimalStringN(text,
gBattleStruct->aiFinalScore[data->aiBattlerId][battlerDef][i],
STR_CONV_MODE_RIGHT_ALIGN, 3);
AddTextPrinterParameterized(data->aiMovesWindowId, 1, text, 83 + count * 54, i * 15, 0, NULL);
AddTextPrinterParameterized(data->aiMovesWindowId, FONT_NORMAL, text, 83 + count * 54, i * 15, 0, NULL);

ConvertIntToDecimalStringN(text,
AI_DATA->simulatedDmg[data->aiBattlerId][battlerDef][i],
STR_CONV_MODE_RIGHT_ALIGN, 3);
AddTextPrinterParameterized(data->aiMovesWindowId, 1, text, 110 + count * 54, i * 15, 0, NULL);
AddTextPrinterParameterized(data->aiMovesWindowId, FONT_NORMAL, text, 110 + count * 54, i * 15, 0, NULL);

count++;
}
}

CopyWindowToVram(data->aiMovesWindowId, 3);
CopyWindowToVram(data->aiMovesWindowId, COPYWIN_FULL);
Free(text);
}

Expand Down Expand Up @@ -849,7 +849,7 @@ static void PutAiInfoText(struct BattleDebugMenu *data)
// item names
for (i = 0; i < ARRAY_COUNT(sAiInfoItemNames); i++)
{
AddTextPrinterParameterized(data->aiMovesWindowId, 1, sAiInfoItemNames[i], 3, i * 15, 0, NULL);
AddTextPrinterParameterized(data->aiMovesWindowId, FONT_NORMAL, sAiInfoItemNames[i], 3, i * 15, 0, NULL);
}

// items info
Expand All @@ -861,13 +861,13 @@ static void PutAiInfoText(struct BattleDebugMenu *data)
u16 holdEffect = AI_DATA->holdEffects[i];
u16 item = AI_DATA->items[i];
u8 x = (i == B_POSITION_PLAYER_LEFT) ? 83 + (i) * 75 : 83 + (i-1) * 75;
AddTextPrinterParameterized(data->aiMovesWindowId, 0, gAbilityNames[ability], x, 0, 0, NULL);
AddTextPrinterParameterized(data->aiMovesWindowId, 0, ItemId_GetName(item), x, 15, 0, NULL);
AddTextPrinterParameterized(data->aiMovesWindowId, 0, GetHoldEffectName(holdEffect), x, 30, 0, NULL);
AddTextPrinterParameterized(data->aiMovesWindowId, FONT_SMALL, gAbilityNames[ability], x, 0, 0, NULL);
AddTextPrinterParameterized(data->aiMovesWindowId, FONT_SMALL, ItemId_GetName(item), x, 15, 0, NULL);
AddTextPrinterParameterized(data->aiMovesWindowId, FONT_SMALL, GetHoldEffectName(holdEffect), x, 30, 0, NULL);
}
}

CopyWindowToVram(data->aiMovesWindowId, 3);
CopyWindowToVram(data->aiMovesWindowId, COPYWIN_FULL);
Free(text);
}

Expand Down Expand Up @@ -914,7 +914,7 @@ static void PutAiPartyText(struct BattleDebugMenu *data)
AddTextPrinterParameterized5(data->aiMovesWindowId, FONT_SMALL_NARROW, text, i * 41, 35 + (j + 1) * 15, 0, NULL, 0, 0);
}

CopyWindowToVram(data->aiMovesWindowId, 3);
CopyWindowToVram(data->aiMovesWindowId, COPYWIN_FULL);
Free(text);
}

Expand Down Expand Up @@ -1177,7 +1177,7 @@ static void Task_DebugMenuProcessInput(u8 taskId)
data->currentSecondaryListItemId = listItemId;
data->modifyWindowId = AddWindow(&sModifyWindowTemplate);
PutWindowTilemap(data->modifyWindowId);
CopyWindowToVram(data->modifyWindowId, 3);
CopyWindowToVram(data->modifyWindowId, COPYWIN_FULL);
SetUpModifyArrows(data);
PrintDigitChars(data);
data->activeWindow = ACTIVE_WIN_MODIFY;
Expand Down Expand Up @@ -1261,8 +1261,8 @@ static void PrintOnBattlerWindow(u8 windowId, u8 battlerId)
StringCopy(&text[4], gBattleMons[battlerId].nickname);

FillWindowPixelBuffer(windowId, 0x11);
AddTextPrinterParameterized(windowId, 1, text, 0, 0, 0, NULL);
CopyWindowToVram(windowId, 3);
AddTextPrinterParameterized(windowId, FONT_NORMAL, text, 0, 0, 0, NULL);
CopyWindowToVram(windowId, COPYWIN_FULL);
}

static void UpdateWindowsOnChangedBattler(struct BattleDebugMenu *data)
Expand Down Expand Up @@ -1368,7 +1368,7 @@ static void CreateSecondaryListMenu(struct BattleDebugMenu *data)
listTemplate.windowId = data->secondaryListWindowId;

data->secondaryListTaskId = ListMenuInit(&listTemplate, 0, 0);
CopyWindowToVram(data->secondaryListWindowId, 3);
CopyWindowToVram(data->secondaryListWindowId, COPYWIN_FULL);
}

static void PadString(const u8 *src, u8 *dst)
Expand Down Expand Up @@ -1497,7 +1497,7 @@ static void PrintDigitChars(struct BattleDebugMenu *data)

text[i] = EOS;

AddTextPrinterParameterized(data->modifyWindowId, 1, text, 3, 0, 0, NULL);
AddTextPrinterParameterized(data->modifyWindowId, FONT_NORMAL, text, 3, 0, 0, NULL);
}

static const u32 GetBitfieldToAndValue(u32 currBit, u32 bitsCount)
Expand Down
Loading

0 comments on commit a34e0f6

Please sign in to comment.