Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added graphics/party_menu/new/r_button_boxes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions src/data/party_menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -1141,6 +1141,43 @@ static const struct SpriteTemplate sSpriteTemplate_Cursor =
.callback = SpriteCB_Cursor,
};

static const u32 sRButtonBoxes_Gfx[] = INCBIN_U32("graphics/party_menu/new/r_button_boxes.4bpp.smol");

static const struct OamData sOamData_RButtonBoxes =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = FALSE,
.bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(64x32),
.x = 0,
.matrixNum = 0,
.size = SPRITE_SIZE(64x32),
.tileNum = 0,
.priority = 1,
.paletteNum = 0,
.affineParam = 0,
};

static const struct CompressedSpriteSheet sSpriteSheet_RButtonBoxes =
{
.data = sRButtonBoxes_Gfx,
.size = (64 * 32) / 2,
.tag = TAG_R_BUTTON_BOXES
};

static const struct SpriteTemplate sSpriteTemplate_RButtonBoxes =
{
.tileTag = TAG_R_BUTTON_BOXES,
.paletteTag = TAG_CURSOR,
.oam = &sOamData_RButtonBoxes,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy
};

static const struct OamData sOamData_MenuPokeball =
{
.y = 0,
Expand Down
72 changes: 57 additions & 15 deletions src/party_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ enum {
TAG_POKEBALL_SMALL,
TAG_STATUS_ICONS,
TAG_HELD_ITEM = 55120,
TAG_CURSOR
TAG_CURSOR,
TAG_R_BUTTON_BOXES = 55130,
};

enum {
Expand Down Expand Up @@ -209,6 +210,7 @@ struct PartyMenuInternal
// bin2c, the utility used to encode the compressed palette data.
u16 palBuffer[BG_PLTT_SIZE / sizeof(u16)];
s16 data[16];
u8 rButtonToBoxesSpriteId;
};

struct PartyMenuBox
Expand Down Expand Up @@ -264,6 +266,8 @@ static void LoadPartyMenuWindows(void);
static void InitPartyMenuBoxes(u8);
static void LoadPartyMenuBoxes(u8);
static void LoadPartyMenuPokeballGfx(void);
static void LoadRButtonToBoxesSpriteGfx(void);
static void CreateRButtonToBoxesSprite(void);
static bool8 CreatePartyMonSpritesLoop(void);
static bool8 RenderPartyMenuBoxes(void);
static void CreateCancelConfirmPokeballSprites(void);
Expand Down Expand Up @@ -540,6 +544,7 @@ static void InitPartyMenu(u8 menuType, u8 layout, u8 partyAction, bool8 keepCurs
sPartyMenuInternal->exitCallback = NULL;
sPartyMenuInternal->lastSelectedSlot = 0;
sPartyMenuInternal->cursorSpriteId = 0x3fff;
sPartyMenuInternal->rButtonToBoxesSpriteId = SPRITE_NONE;

if (menuType == PARTY_MENU_TYPE_CHOOSE_HALF)
sPartyMenuInternal->chooseHalf = TRUE;
Expand Down Expand Up @@ -687,10 +692,14 @@ static bool8 ShowPartyMenu(void)
gMain.state++;
break;
case 14:
LoadMonIconPalettes();
LoadRButtonToBoxesSpriteGfx();
gMain.state++;
break;
case 15:
LoadMonIconPalettes();
gMain.state++;
break;
case 16:
if (CreatePartyMonSpritesLoop())
{
if (CalculatePlayerPartyCount() != 0
Expand All @@ -705,35 +714,39 @@ static bool8 ShowPartyMenu(void)
gMain.state++;
}
break;
case 16:
case 17:
if (RenderPartyMenuBoxes())
{
sPartyMenuInternal->data[0] = 0;
gMain.state++;
}
break;
case 17:
case 18:
CreateCancelConfirmPokeballSprites();
gMain.state++;
break;
case 18:
case 19:
CreateRButtonToBoxesSprite();
gMain.state++;
break;
case 20:
CreateCancelConfirmWindows(sPartyMenuInternal->chooseHalf);
gMain.state++;
break;
case 19:
case 21:
gMain.state++;
break;
case 20:
case 22:
CreateTask(sPartyMenuInternal->task, 0);
DisplayPartyMenuStdMessage(sPartyMenuInternal->messageId);
gMain.state++;
break;
case 21:
case 23:
BlendPalettes(PALETTES_ALL, 16, 0);
gPaletteFade.bufferTransferDisabled = FALSE;
gMain.state++;
break;
case 22:
case 24:
BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK);
gMain.state++;
break;
Expand Down Expand Up @@ -801,37 +814,45 @@ static bool8 ReloadPartyMenu(void)
gMain.state++;
break;
case 12:
LoadMonIconPalettes();
LoadRButtonToBoxesSpriteGfx();
gMain.state++;
break;
case 13:
LoadMonIconPalettes();
gMain.state++;
break;
case 14:
if (CreatePartyMonSpritesLoop())
{
sPartyMenuInternal->data[0] = 0;
gMain.state++;
}
break;
case 14:
case 15:
if (RenderPartyMenuBoxes())
{
sPartyMenuInternal->data[0] = 0;
gMain.state++;
}
break;
case 15:
case 16:
CreateCancelConfirmPokeballSprites();
gMain.state++;
break;
case 16:
case 17:
CreateRButtonToBoxesSprite();
gMain.state++;
break;
case 18:
CreateCancelConfirmWindows(sPartyMenuInternal->chooseHalf);
gMain.state++;
break;
case 17:
case 19:
BlendPalettes(PALETTES_ALL, 16, RGB_WHITEALPHA);
gPaletteFade.bufferTransferDisabled = FALSE;
gMain.state++;
break;
case 18:
case 20:
BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_WHITEALPHA);
gMain.state++;
break;
Expand Down Expand Up @@ -4683,6 +4704,27 @@ static void LoadPartyMenuPokeballGfx(void)
LoadSpritePalette(&sSpritePalette_MenuPokeball);
}

static void LoadRButtonToBoxesSpriteGfx(void)
{
LoadCompressedSpriteSheet(&sSpriteSheet_RButtonBoxes);
}

static void CreateRButtonToBoxesSprite(void)
{
if (PARTY_MENU_PC_ACCESS
&& gPartyMenu.action == PARTY_ACTION_CHOOSE_MON
&& gPartyMenu.layout == PARTY_LAYOUT_SINGLE
&& (gPartyMenu.menuType == PARTY_MENU_TYPE_FIELD
|| gPartyMenu.menuType == PARTY_MENU_TYPE_DAYCARE))
{
sPartyMenuInternal->rButtonToBoxesSpriteId = CreateSprite(&sSpriteTemplate_RButtonBoxes, 165, 164, 0);
}
else
{
sPartyMenuInternal->rButtonToBoxesSpriteId = SPRITE_NONE;
}
}

static void CreatePartyMonStatusSprite(struct Pokemon *mon, struct PartyMenuBox *menuBox)
{
if (GetMonData(mon, MON_DATA_SPECIES) != SPECIES_NONE)
Expand Down
Loading