From e95020c59afaf55a62a81b7e3aaa2995bdfe981c Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Mon, 13 Dec 2021 22:01:31 -0300 Subject: [PATCH 1/4] Fixed form wrapping to the left. --- src/pokemon_debug.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/pokemon_debug.c b/src/pokemon_debug.c index 5090a5db5..01d9c1253 100644 --- a/src/pokemon_debug.c +++ b/src/pokemon_debug.c @@ -1325,7 +1325,15 @@ static void UpdateSubmenuOneOptionValue(u8 taskId, bool8 increment) else { if (gFormSpeciesIdTables[data->currentmonId][formId] == gFormSpeciesIdTables[data->currentmonId][0]) - modArrows->currValue = gFormSpeciesIdTables[data->currentmonId][0]; + { + u8 lastForm; + for (lastForm = 0; gFormSpeciesIdTables[data->currentmonId][lastForm] != FORM_SPECIES_END; lastForm++) + { + if (gFormSpeciesIdTables[data->currentmonId][lastForm + 1] == FORM_SPECIES_END) + break; + } + modArrows->currValue = gFormSpeciesIdTables[data->currentmonId][lastForm]; + } else modArrows->currValue = GetFormSpeciesId(data->currentmonId, formId - 1); } From 5d7ac2171fde4b7e0dad398e09a817b8e9145349 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Mon, 13 Dec 2021 22:57:39 -0300 Subject: [PATCH 2/4] Animations reload when switching Forms --- src/pokemon_debug.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pokemon_debug.c b/src/pokemon_debug.c index 01d9c1253..35db799a9 100644 --- a/src/pokemon_debug.c +++ b/src/pokemon_debug.c @@ -943,7 +943,7 @@ static void UpdateBattleBg(u8 taskId, bool8 increment) { struct PokemonDebugMenu *data = GetStructPtr(taskId); - if (data->battleBgType == 0) + if (data->battleBgType == MAP_BATTLE_SCENE_NORMAL) { if (increment) { @@ -1337,6 +1337,9 @@ static void UpdateSubmenuOneOptionValue(u8 taskId, bool8 increment) else modArrows->currValue = GetFormSpeciesId(data->currentmonId, formId - 1); } + data->animIdBack = GetSpeciesBackAnimSet(modArrows->currValue) + 1; + data->animIdFront = sMonFrontAnimIdsTable[modArrows->currValue - 1]; + UpdateMonAnimNames(taskId); UpdateBattlerValue(data); ReloadPokemonSprites(data); From 037370fe19f5d84069ee47072ae898806a8f1d52 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Mon, 13 Dec 2021 23:33:25 -0300 Subject: [PATCH 3/4] Showing animation number --- src/pokemon_debug.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/pokemon_debug.c b/src/pokemon_debug.c index 35db799a9..00fbe1297 100644 --- a/src/pokemon_debug.c +++ b/src/pokemon_debug.c @@ -1004,17 +1004,22 @@ static void UpdateMonAnimNames(u8 taskId) u8 fontId = 0; u8 textL[] = _("{L_BUTTON}"); u8 textR[] = _("{R_BUTTON}"); + u8 textNum[4]; FillWindowPixelBuffer(WIN_BOTTOM_RIGHT, PIXEL_FILL(0)); //Back StringCopy(text, gBackAnimNames[backAnim]); AddTextPrinterParameterized(WIN_BOTTOM_RIGHT, fontId, textL, 0, 0, 0, NULL); - AddTextPrinterParameterized(WIN_BOTTOM_RIGHT, fontId, text, 20, 0, 0, NULL); + ConvertIntToDecimalStringN(textNum, backAnim, STR_CONV_MODE_LEADING_ZEROS, 3); + AddTextPrinterParameterized(WIN_BOTTOM_RIGHT, fontId, textNum, 18, 0, 0, NULL); + AddTextPrinterParameterized(WIN_BOTTOM_RIGHT, fontId, text, 36, 0, 0, NULL); //Front StringCopy(text, gFrontAnimNames[frontAnim]); AddTextPrinterParameterized(WIN_BOTTOM_RIGHT, fontId, textR, 0, 12, 0, NULL); - AddTextPrinterParameterized(WIN_BOTTOM_RIGHT, fontId, text, 20, 12, 0, NULL); + ConvertIntToDecimalStringN(textNum, frontAnim, STR_CONV_MODE_LEADING_ZEROS, 3); + AddTextPrinterParameterized(WIN_BOTTOM_RIGHT, fontId, textNum, 18, 12, 0, NULL); + AddTextPrinterParameterized(WIN_BOTTOM_RIGHT, fontId, text, 36, 12, 0, NULL); PrintBattleBgName(taskId); } From 7738d67314035ee724c2c010d858c7ff1f4c4f4e Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Mon, 13 Dec 2021 23:52:16 -0300 Subject: [PATCH 4/4] Slight documentation --- src/pokemon_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pokemon_debug.c b/src/pokemon_debug.c index 00fbe1297..3b843ccda 100644 --- a/src/pokemon_debug.c +++ b/src/pokemon_debug.c @@ -1726,7 +1726,7 @@ static void Exit_Debug_Pokemon(u8 taskId) FreeMonSpritesGfx(); DestroyTask(taskId); SetMainCallback2(CB2_ReturnToFieldWithOpenMenu); - m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100); + m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 0x100); } }