From 5233d0dc9769dbd47f63163567dabf7f12fc94da Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Thu, 18 Jan 2024 12:00:11 -0300 Subject: [PATCH] Showing followers in debug menu (no animation yet) --- include/constants/pokemon_debug.h | 6 ++++-- include/pokemon_debug.h | 1 + .../object_event_graphics_info_followers.h | 2 +- src/pokemon_debug.c | 11 +++++++++++ 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/include/constants/pokemon_debug.h b/include/constants/pokemon_debug.h index c75392bf22..f92cd4941e 100644 --- a/include/constants/pokemon_debug.h +++ b/include/constants/pokemon_debug.h @@ -4,10 +4,12 @@ //Defines #define DEBUG_MON_BACK_X 62 #define DEBUG_MON_BACK_Y 80 -#define DEBUG_ICON_X 220 -#define DEBUG_ICON_Y 140 +#define DEBUG_ICON_X 224 +#define DEBUG_ICON_Y 144 #define DEBUG_MON_SHINY 0 #define DEBUG_MON_NORMAL 9 +#define DEBUG_FOLLOWER_X 192 +#define DEBUG_FOLLOWER_Y 144 #define MODIFY_DIGITS_MAX 4 #define MODIFY_DIGITS_ARROW_X 129 diff --git a/include/pokemon_debug.h b/include/pokemon_debug.h index e69b4a7c6b..e2fc349edb 100644 --- a/include/pokemon_debug.h +++ b/include/pokemon_debug.h @@ -51,6 +51,7 @@ struct PokemonDebugMenu u8 frontspriteId; u8 backspriteId; u8 iconspriteId; + u8 followerspriteId; u8 frontShadowSpriteId; bool8 isShiny; bool8 isFemale; diff --git a/src/data/object_events/object_event_graphics_info_followers.h b/src/data/object_events/object_event_graphics_info_followers.h index 75d531cef0..054b1aa981 100644 --- a/src/data/object_events/object_event_graphics_info_followers.h +++ b/src/data/object_events/object_event_graphics_info_followers.h @@ -2,7 +2,7 @@ #define COMP OW_GFX_COMPRESS // Species-indexed pokemon object event table -const struct ObjectEventGraphicsInfo gPokemonObjectGraphics[] = +const struct ObjectEventGraphicsInfo gPokemonObjectGraphics[NUM_SPECIES] = { [SPECIES_BULBASAUR] = {0xFFFF, OBJ_EVENT_PAL_TAG_DYNAMIC, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 2, SHADOW_SIZE_M, FALSE, COMP, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Following, sPicTable_Bulbasaur, gDummySpriteAffineAnimTable}, [SPECIES_IVYSAUR] = {0xFFFF, OBJ_EVENT_PAL_TAG_DYNAMIC, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 2, SHADOW_SIZE_M, FALSE, COMP, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Following, sPicTable_Ivysaur, gDummySpriteAffineAnimTable}, diff --git a/src/pokemon_debug.c b/src/pokemon_debug.c index 2b26e47e41..806c1f6373 100644 --- a/src/pokemon_debug.c +++ b/src/pokemon_debug.c @@ -8,6 +8,7 @@ #include "constants/songs.h" #include "data.h" #include "decompress.h" +#include "event_object_movement.h" #include "field_weather.h" #include "gpu_regs.h" #include "graphics.h" @@ -38,6 +39,7 @@ #include "trainer_pokemon_sprites.h" #include "constants/items.h" +#include "constants/event_objects.h" #if DEBUG_POKEMON_MENU == TRUE extern const struct BattleBackground sBattleTerrainTable[]; @@ -1119,6 +1121,10 @@ void CB2_Debug_Pokemon(void) data->iconspriteId = CreateMonIcon(species, SpriteCB_MonIcon, DEBUG_ICON_X, DEBUG_ICON_Y, 4, (data->isFemale ? FEMALE_PERSONALITY : MALE_PERSONALITY)); gSprites[data->iconspriteId].oam.priority = 0; + //Follower Sprite + data->followerspriteId = CreateObjectGraphicsSprite(OBJ_EVENT_GFX_MON_BASE + species, SpriteCallbackDummy, DEBUG_FOLLOWER_X, DEBUG_FOLLOWER_Y, 0); + gSprites[data->followerspriteId].oam.priority = 0; + //Modify Arrows SetUpModifyArrows(data); PrintDigitChars(data); @@ -1625,6 +1631,7 @@ static void ReloadPokemonSprites(struct PokemonDebugMenu *data) DestroySprite(&gSprites[data->frontspriteId]); DestroySprite(&gSprites[data->backspriteId]); DestroySprite(&gSprites[data->iconspriteId]); + DestroySprite(&gSprites[data->followerspriteId]); FreeMonSpritesGfx(); ResetSpriteData(); @@ -1669,6 +1676,10 @@ static void ReloadPokemonSprites(struct PokemonDebugMenu *data) data->iconspriteId = CreateMonIcon(species, SpriteCB_MonIcon, DEBUG_ICON_X, DEBUG_ICON_Y, 4, (data->isFemale ? FEMALE_PERSONALITY : MALE_PERSONALITY)); gSprites[data->iconspriteId].oam.priority = 0; + //Follower Sprite + data->followerspriteId = CreateObjectGraphicsSprite(OBJ_EVENT_GFX_MON_BASE + species, SpriteCallbackDummy, DEBUG_FOLLOWER_X, DEBUG_FOLLOWER_Y, 0); + gSprites[data->followerspriteId].oam.priority = 0; + //Modify Arrows LoadSpritePalette(&gSpritePalette_Arrow); data->modifyArrows.arrowSpriteId[0] = CreateSprite(&gSpriteTemplate_Arrow, MODIFY_DIGITS_ARROW_X + (data->modifyArrows.currentDigit * 6), MODIFY_DIGITS_ARROW1_Y, 0);