mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-18 09:24:19 +01:00
Merge pull request #1403 from GriffinRichards/doc-pokeblock
Document Pokéblock menu and feeding scene
This commit is contained in:
commit
c4ef45c161
@ -4076,7 +4076,7 @@ extern const u8 gNamingScreenCursor_Gfx[];
|
|||||||
extern const u8 gNamingScreenInputArrow_Gfx[];
|
extern const u8 gNamingScreenInputArrow_Gfx[];
|
||||||
extern const u8 gNamingScreenUnderscore_Gfx[];
|
extern const u8 gNamingScreenUnderscore_Gfx[];
|
||||||
|
|
||||||
extern const u32 gUnknown_08D9BA44[];
|
extern const u32 gPokeblockFeedBg_Tilemap[];
|
||||||
|
|
||||||
extern const u32 gConfetti_Gfx[];
|
extern const u32 gConfetti_Gfx[];
|
||||||
extern const u32 gConfetti_Pal[];
|
extern const u32 gConfetti_Pal[];
|
||||||
|
@ -14,9 +14,9 @@ void ShakeBagSprite(void);
|
|||||||
void AddSwitchPocketRotatingBallSprite(s16 rotationDirection);
|
void AddSwitchPocketRotatingBallSprite(s16 rotationDirection);
|
||||||
void AddBagItemIconSprite(u16 itemId, u8 id);
|
void AddBagItemIconSprite(u16 itemId, u8 id);
|
||||||
void RemoveBagItemIconSprite(u8 id);
|
void RemoveBagItemIconSprite(u8 id);
|
||||||
void sub_80D4FAC(void);
|
void CreateItemMenuSwapLine(void);
|
||||||
void sub_80D4FC8(u8 arg0);
|
void SetItemMenuSwapLineInvisibility(bool8 invisible);
|
||||||
void sub_80D4FEC(u8 arg0);
|
void UpdateItemMenuSwapLinePos(u8 y);
|
||||||
u8 CreateBerryTagSprite(u8 id, s16 x, s16 y);
|
u8 CreateBerryTagSprite(u8 id, s16 x, s16 y);
|
||||||
void FreeBerryTagSpritePalette(void);
|
void FreeBerryTagSpritePalette(void);
|
||||||
u8 CreateSpinningBerrySprite(u8 berryId, u8 x, u8 y, bool8 startAffine);
|
u8 CreateSpinningBerrySprite(u8 berryId, u8 x, u8 y, bool8 startAffine);
|
||||||
|
@ -35,10 +35,10 @@ bool8 MenuHelpers_CallLinkSomething(void);
|
|||||||
void sub_812220C(struct ItemSlot *slots, u8 count, u8 *arg2, u8 *usedSlotsCount, u8 maxUsedSlotsCount);
|
void sub_812220C(struct ItemSlot *slots, u8 count, u8 *arg2, u8 *usedSlotsCount, u8 maxUsedSlotsCount);
|
||||||
void sub_812225C(u16 *scrollOffset, u16 *cursorPos, u8 maxShownItems, u8 numItems);
|
void sub_812225C(u16 *scrollOffset, u16 *cursorPos, u8 maxShownItems, u8 numItems);
|
||||||
void sub_8122298(u16 *arg0, u16 *arg1, u8 arg2, u8 arg3, u8 arg4);
|
void sub_8122298(u16 *arg0, u16 *arg1, u8 arg2, u8 arg3, u8 arg4);
|
||||||
void LoadListMenuArrowsGfx(void);
|
void LoadListMenuSwapLineGfx(void);
|
||||||
void sub_8122344(u8 *spriteIds, u8 count);
|
void CreateSwapLineSprites(u8 *spriteIds, u8 count);
|
||||||
void sub_81223B0(u8 *spriteIds, u8 count);
|
void DestroySwapLineSprites(u8 *spriteIds, u8 count);
|
||||||
void sub_81223FC(u8 *spriteIds, u8 count, bool8 invisible);
|
void SetSwapLineSpritesInvisibility(u8 *spriteIds, u8 count, bool8 invisible);
|
||||||
void sub_8122448(u8 *spriteIds, u8 count, s16 x, u16 y);
|
void UpdateSwapLineSpritesPos(u8 *spriteIds, u8 count, s16 x, u16 y);
|
||||||
|
|
||||||
#endif //GUARD_MENU_HELPERS_H
|
#endif //GUARD_MENU_HELPERS_H
|
||||||
|
@ -4,8 +4,7 @@
|
|||||||
#include "constants/berry.h"
|
#include "constants/berry.h"
|
||||||
#include "constants/pokemon.h"
|
#include "constants/pokemon.h"
|
||||||
|
|
||||||
#define GFX_TAG_POKEBLOCK 14818
|
#define TAG_POKEBLOCK 14818
|
||||||
#define GFX_TAG_POKEBLOCK_CASE 14800
|
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
@ -52,7 +51,7 @@ extern s16 gPokeblockGain;
|
|||||||
void ChooseMonToGivePokeblock(struct Pokeblock *pokeblock, void (*callback)(void));
|
void ChooseMonToGivePokeblock(struct Pokeblock *pokeblock, void (*callback)(void));
|
||||||
|
|
||||||
// pokeblock feed
|
// pokeblock feed
|
||||||
void CB2_PreparePokeblockFeedScene(void);
|
void PreparePokeblockFeedScene(void);
|
||||||
|
|
||||||
// pokeblock
|
// pokeblock
|
||||||
extern const s8 gPokeblockFlavorCompatibilityTable[NUM_NATURES * FLAVOR_COUNT];
|
extern const s8 gPokeblockFlavorCompatibilityTable[NUM_NATURES * FLAVOR_COUNT];
|
||||||
|
@ -63,7 +63,7 @@ static void sub_81C56F8(void);
|
|||||||
static void sub_81C5A20(void);
|
static void sub_81C5A20(void);
|
||||||
static void sub_81C6BD8(void);
|
static void sub_81C6BD8(void);
|
||||||
static void sub_81C6EF4(void);
|
static void sub_81C6EF4(void);
|
||||||
static void sub_81C700C(void);
|
static void CreateSwapLine(void);
|
||||||
static void sub_81C6E98(void);
|
static void sub_81C6E98(void);
|
||||||
static void sub_81C6F20(void);
|
static void sub_81C6F20(void);
|
||||||
static void sub_81C6404(void);
|
static void sub_81C6404(void);
|
||||||
@ -84,8 +84,8 @@ static void sub_81C5F08(u8 windowId, u8 horizontalCount, u8 verticalCount);
|
|||||||
static bool8 IsValidMenuAction(s8 arg0);
|
static bool8 IsValidMenuAction(s8 arg0);
|
||||||
static void sub_81C6DAC(u8 taskId, const struct YesNoFuncTable *yesNoTable);
|
static void sub_81C6DAC(u8 taskId, const struct YesNoFuncTable *yesNoTable);
|
||||||
static void sub_81C6CEC(u8 windowId);
|
static void sub_81C6CEC(u8 windowId);
|
||||||
static void sub_81C704C(u8 y);
|
static void UpdateSwapLinePos(u8 y);
|
||||||
static void sub_81C7028(bool8 invisible);
|
static void SetSwapLineInvisibility(bool8 invisible);
|
||||||
static void sub_81C6F68(struct Sprite *sprite);
|
static void sub_81C6F68(struct Sprite *sprite);
|
||||||
static void BagAction_UseOnField(u8 taskId);
|
static void BagAction_UseOnField(u8 taskId);
|
||||||
static void BagAction_Toss(u8 taskId);
|
static void BagAction_Toss(u8 taskId);
|
||||||
@ -489,7 +489,7 @@ static bool8 sub_81C5078(void)
|
|||||||
gMain.state++;
|
gMain.state++;
|
||||||
break;
|
break;
|
||||||
case 14:
|
case 14:
|
||||||
sub_81C700C();
|
CreateSwapLine();
|
||||||
gMain.state++;
|
gMain.state++;
|
||||||
break;
|
break;
|
||||||
case 15:
|
case 15:
|
||||||
@ -555,7 +555,7 @@ static bool8 sub_81C5238(void)
|
|||||||
gPyramidBagResources->state++;
|
gPyramidBagResources->state++;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LoadListMenuArrowsGfx();
|
LoadListMenuSwapLineGfx();
|
||||||
gPyramidBagResources->state = 0;
|
gPyramidBagResources->state = 0;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -1268,7 +1268,7 @@ static void Task_BeginItemSwap(u8 taskId)
|
|||||||
FillWindowPixelBuffer(1, PIXEL_FILL(0));
|
FillWindowPixelBuffer(1, PIXEL_FILL(0));
|
||||||
PrintOnWindow_Font1(1, gStringVar4, 3, 0, 0, 1, 0, 0);
|
PrintOnWindow_Font1(1, gStringVar4, 3, 0, 0, 1, 0, 0);
|
||||||
sub_81C5A98(data[0], 1);
|
sub_81C5A98(data[0], 1);
|
||||||
sub_81C704C(data[1]);
|
UpdateSwapLinePos(data[1]);
|
||||||
gTasks[taskId].func = Task_ItemSwapHandleInput;
|
gTasks[taskId].func = Task_ItemSwapHandleInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1287,8 +1287,8 @@ static void Task_ItemSwapHandleInput(u8 taskId)
|
|||||||
{
|
{
|
||||||
s32 id = ListMenu_ProcessInput(data[0]);
|
s32 id = ListMenu_ProcessInput(data[0]);
|
||||||
ListMenuGetScrollAndRow(data[0], &gPyramidBagCursorData.scrollPosition, &gPyramidBagCursorData.cursorPosition);
|
ListMenuGetScrollAndRow(data[0], &gPyramidBagCursorData.scrollPosition, &gPyramidBagCursorData.cursorPosition);
|
||||||
sub_81C7028(FALSE);
|
SetSwapLineInvisibility(FALSE);
|
||||||
sub_81C704C(gPyramidBagCursorData.cursorPosition);
|
UpdateSwapLinePos(gPyramidBagCursorData.cursorPosition);
|
||||||
switch (id)
|
switch (id)
|
||||||
{
|
{
|
||||||
case LIST_NOTHING_CHOSEN:
|
case LIST_NOTHING_CHOSEN:
|
||||||
@ -1324,7 +1324,7 @@ static void PerformItemSwap(u8 taskId)
|
|||||||
{
|
{
|
||||||
MovePyramidBagItemSlotInList(data[1], var);
|
MovePyramidBagItemSlotInList(data[1], var);
|
||||||
gPyramidBagResources->unk814 = 0xFF;
|
gPyramidBagResources->unk814 = 0xFF;
|
||||||
sub_81C7028(TRUE);
|
SetSwapLineInvisibility(TRUE);
|
||||||
DestroyListMenuTask(data[0], scrollOffset, selectedRow);
|
DestroyListMenuTask(data[0], scrollOffset, selectedRow);
|
||||||
if (data[1] < var)
|
if (data[1] < var)
|
||||||
gPyramidBagCursorData.cursorPosition--;
|
gPyramidBagCursorData.cursorPosition--;
|
||||||
@ -1341,7 +1341,7 @@ static void sub_81C6A14(u8 taskId)
|
|||||||
u16 *selectedRow = &gPyramidBagCursorData.cursorPosition;
|
u16 *selectedRow = &gPyramidBagCursorData.cursorPosition;
|
||||||
|
|
||||||
gPyramidBagResources->unk814 = 0xFF;
|
gPyramidBagResources->unk814 = 0xFF;
|
||||||
sub_81C7028(TRUE);
|
SetSwapLineInvisibility(TRUE);
|
||||||
DestroyListMenuTask(data[0], scrollOffset, selectedRow);
|
DestroyListMenuTask(data[0], scrollOffset, selectedRow);
|
||||||
if (data[1] < *scrollOffset + *selectedRow)
|
if (data[1] < *scrollOffset + *selectedRow)
|
||||||
gPyramidBagCursorData.cursorPosition--;
|
gPyramidBagCursorData.cursorPosition--;
|
||||||
@ -1545,17 +1545,17 @@ static void sub_81C6FF8(u8 itemSpriteArrayId)
|
|||||||
sub_81C6E38(itemSpriteArrayId + 1);
|
sub_81C6E38(itemSpriteArrayId + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sub_81C700C(void)
|
static void CreateSwapLine(void)
|
||||||
{
|
{
|
||||||
sub_8122344(&gPyramidBagResources->itemsSpriteIds[3], 8);
|
CreateSwapLineSprites(&gPyramidBagResources->itemsSpriteIds[3], 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sub_81C7028(bool8 invisible)
|
static void SetSwapLineInvisibility(bool8 invisible)
|
||||||
{
|
{
|
||||||
sub_81223FC(&gPyramidBagResources->itemsSpriteIds[3], 8, invisible);
|
SetSwapLineSpritesInvisibility(&gPyramidBagResources->itemsSpriteIds[3], 8, invisible);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sub_81C704C(u8 y)
|
static void UpdateSwapLinePos(u8 y)
|
||||||
{
|
{
|
||||||
sub_8122448(&gPyramidBagResources->itemsSpriteIds[3], 8 | 0x80, 120, (y + 1) * 16);
|
UpdateSwapLineSpritesPos(&gPyramidBagResources->itemsSpriteIds[3], 8 | 0x80, 120, (y + 1) * 16);
|
||||||
}
|
}
|
||||||
|
@ -1201,7 +1201,7 @@ const u32 gPokeblockBlack_Pal[] = INCBIN_U32("graphics/pokeblock/black.gbapal.lz
|
|||||||
const u32 gPokeblockWhite_Pal[] = INCBIN_U32("graphics/pokeblock/white.gbapal.lz");
|
const u32 gPokeblockWhite_Pal[] = INCBIN_U32("graphics/pokeblock/white.gbapal.lz");
|
||||||
const u32 gPokeblockGold_Pal[] = INCBIN_U32("graphics/pokeblock/gold.gbapal.lz");
|
const u32 gPokeblockGold_Pal[] = INCBIN_U32("graphics/pokeblock/gold.gbapal.lz");
|
||||||
|
|
||||||
const u32 gUnknown_08D9BA44[] = INCBIN_U32("graphics/interface/pokeblock_feeding_bg_map.bin.lz");
|
const u32 gPokeblockFeedBg_Tilemap[] = INCBIN_U32("graphics/interface/pokeblock_feeding_bg_map.bin.lz");
|
||||||
|
|
||||||
#include "data/graphics/berries.h"
|
#include "data/graphics/berries.h"
|
||||||
#include "data/graphics/rayquaza_scene.h"
|
#include "data/graphics/rayquaza_scene.h"
|
||||||
|
@ -707,7 +707,7 @@ bool8 SetupBagMenu(void)
|
|||||||
gMain.state++;
|
gMain.state++;
|
||||||
break;
|
break;
|
||||||
case 16:
|
case 16:
|
||||||
sub_80D4FAC();
|
CreateItemMenuSwapLine();
|
||||||
gMain.state++;
|
gMain.state++;
|
||||||
break;
|
break;
|
||||||
case 17:
|
case 17:
|
||||||
@ -787,7 +787,7 @@ bool8 LoadBagMenu_Graphics(void)
|
|||||||
gBagMenu->graphicsLoadState++;
|
gBagMenu->graphicsLoadState++;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LoadListMenuArrowsGfx();
|
LoadListMenuSwapLineGfx();
|
||||||
gBagMenu->graphicsLoadState = 0;
|
gBagMenu->graphicsLoadState = 0;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -1373,7 +1373,7 @@ void BagMenu_SwapItems(u8 taskId)
|
|||||||
StringExpandPlaceholders(gStringVar4, gText_MoveVar1Where);
|
StringExpandPlaceholders(gStringVar4, gText_MoveVar1Where);
|
||||||
FillWindowPixelBuffer(1, PIXEL_FILL(0));
|
FillWindowPixelBuffer(1, PIXEL_FILL(0));
|
||||||
BagMenu_Print(1, 1, gStringVar4, 3, 1, 0, 0, 0, 0);
|
BagMenu_Print(1, 1, gStringVar4, 3, 1, 0, 0, 0, 0);
|
||||||
sub_80D4FEC(data[1]);
|
UpdateItemMenuSwapLinePos(data[1]);
|
||||||
BagDestroyPocketSwitchArrowPair();
|
BagDestroyPocketSwitchArrowPair();
|
||||||
BagMenu_PrintCursor_(data[0], 2);
|
BagMenu_PrintCursor_(data[0], 2);
|
||||||
gTasks[taskId].func = Task_HandleSwappingItemsInput;
|
gTasks[taskId].func = Task_HandleSwappingItemsInput;
|
||||||
@ -1396,8 +1396,8 @@ static void Task_HandleSwappingItemsInput(u8 taskId)
|
|||||||
{
|
{
|
||||||
input = ListMenu_ProcessInput(data[0]);
|
input = ListMenu_ProcessInput(data[0]);
|
||||||
ListMenuGetScrollAndRow(data[0], &gBagPositionStruct.scrollPosition[gBagPositionStruct.pocket], &gBagPositionStruct.cursorPosition[gBagPositionStruct.pocket]);
|
ListMenuGetScrollAndRow(data[0], &gBagPositionStruct.scrollPosition[gBagPositionStruct.pocket], &gBagPositionStruct.cursorPosition[gBagPositionStruct.pocket]);
|
||||||
sub_80D4FC8(0);
|
SetItemMenuSwapLineInvisibility(FALSE);
|
||||||
sub_80D4FEC(gBagPositionStruct.cursorPosition[gBagPositionStruct.pocket]);
|
UpdateItemMenuSwapLinePos(gBagPositionStruct.cursorPosition[gBagPositionStruct.pocket]);
|
||||||
switch (input)
|
switch (input)
|
||||||
{
|
{
|
||||||
case LIST_NOTHING_CHOSEN:
|
case LIST_NOTHING_CHOSEN:
|
||||||
@ -1435,7 +1435,7 @@ void sub_81AC498(u8 taskId)
|
|||||||
gBagPositionStruct.cursorPosition[gBagPositionStruct.pocket]--;
|
gBagPositionStruct.cursorPosition[gBagPositionStruct.pocket]--;
|
||||||
LoadBagItemListBuffers(gBagPositionStruct.pocket);
|
LoadBagItemListBuffers(gBagPositionStruct.pocket);
|
||||||
data[0] = ListMenuInit(&gMultiuseListMenuTemplate, *scrollPos, *cursorPos);
|
data[0] = ListMenuInit(&gMultiuseListMenuTemplate, *scrollPos, *cursorPos);
|
||||||
sub_80D4FC8(1);
|
SetItemMenuSwapLineInvisibility(TRUE);
|
||||||
CreatePocketSwitchArrowPair();
|
CreatePocketSwitchArrowPair();
|
||||||
gTasks[taskId].func = Task_BagMenu_HandleInput;
|
gTasks[taskId].func = Task_BagMenu_HandleInput;
|
||||||
}
|
}
|
||||||
@ -1453,7 +1453,7 @@ void sub_81AC590(u8 taskId)
|
|||||||
gBagPositionStruct.cursorPosition[gBagPositionStruct.pocket]--;
|
gBagPositionStruct.cursorPosition[gBagPositionStruct.pocket]--;
|
||||||
LoadBagItemListBuffers(gBagPositionStruct.pocket);
|
LoadBagItemListBuffers(gBagPositionStruct.pocket);
|
||||||
data[0] = ListMenuInit(&gMultiuseListMenuTemplate, *scrollPos, *cursorPos);
|
data[0] = ListMenuInit(&gMultiuseListMenuTemplate, *scrollPos, *cursorPos);
|
||||||
sub_80D4FC8(1);
|
SetItemMenuSwapLineInvisibility(TRUE);
|
||||||
CreatePocketSwitchArrowPair();
|
CreatePocketSwitchArrowPair();
|
||||||
gTasks[taskId].func = Task_BagMenu_HandleInput;
|
gTasks[taskId].func = Task_BagMenu_HandleInput;
|
||||||
}
|
}
|
||||||
|
@ -537,19 +537,19 @@ void RemoveBagItemIconSprite(u8 id)
|
|||||||
RemoveBagSprite(id + 2);
|
RemoveBagSprite(id + 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_80D4FAC(void)
|
void CreateItemMenuSwapLine(void)
|
||||||
{
|
{
|
||||||
sub_8122344(&gBagMenu->spriteId[4], 8);
|
CreateSwapLineSprites(&gBagMenu->spriteId[4], 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_80D4FC8(u8 arg0)
|
void SetItemMenuSwapLineInvisibility(bool8 invisible)
|
||||||
{
|
{
|
||||||
sub_81223FC(&gBagMenu->spriteId[4], 8, arg0);
|
SetSwapLineSpritesInvisibility(&gBagMenu->spriteId[4], 8, invisible);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_80D4FEC(u8 arg0)
|
void UpdateItemMenuSwapLinePos(u8 y)
|
||||||
{
|
{
|
||||||
sub_8122448(&gBagMenu->spriteId[4], 136, 120, (arg0 + 1) * 16);
|
UpdateSwapLineSpritesPos(&gBagMenu->spriteId[4], 136, 120, (y + 1) * 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sub_80D5018(void *mem0, void *mem1)
|
static void sub_80D5018(void *mem0, void *mem1)
|
||||||
|
@ -805,7 +805,7 @@ void Script_BufferContestLadyCategoryAndMonName(void)
|
|||||||
|
|
||||||
void OpenPokeblockCaseForContestLady(void)
|
void OpenPokeblockCaseForContestLady(void)
|
||||||
{
|
{
|
||||||
OpenPokeblockCase(3, CB2_ReturnToField);
|
OpenPokeblockCase(PBLOCK_CASE_GIVE, CB2_ReturnToField);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetContestLadyGivenPokeblock(void)
|
void SetContestLadyGivenPokeblock(void)
|
||||||
|
@ -18,19 +18,17 @@
|
|||||||
#include "constants/items.h"
|
#include "constants/items.h"
|
||||||
#include "constants/maps.h"
|
#include "constants/maps.h"
|
||||||
|
|
||||||
// this file's functions
|
#define TAG_SWAP_LINE 109
|
||||||
|
|
||||||
static void Task_ContinueTaskAfterMessagePrints(u8 taskId);
|
static void Task_ContinueTaskAfterMessagePrints(u8 taskId);
|
||||||
static void Task_CallYesOrNoCallback(u8 taskId);
|
static void Task_CallYesOrNoCallback(u8 taskId);
|
||||||
|
|
||||||
// EWRAM vars
|
|
||||||
EWRAM_DATA static struct YesNoFuncTable gUnknown_0203A138 = {0};
|
EWRAM_DATA static struct YesNoFuncTable gUnknown_0203A138 = {0};
|
||||||
EWRAM_DATA static u8 gUnknown_0203A140 = 0;
|
EWRAM_DATA static u8 gUnknown_0203A140 = 0;
|
||||||
|
|
||||||
// IWRAM bss vars
|
|
||||||
static TaskFunc gUnknown_0300117C;
|
static TaskFunc gUnknown_0300117C;
|
||||||
|
|
||||||
// const rom data
|
static const struct OamData sOamData_SwapLine =
|
||||||
static const struct OamData sOamData_859F4E8 =
|
|
||||||
{
|
{
|
||||||
.y = 0,
|
.y = 0,
|
||||||
.affineMode = ST_OAM_AFFINE_OFF,
|
.affineMode = ST_OAM_AFFINE_OFF,
|
||||||
@ -47,47 +45,47 @@ static const struct OamData sOamData_859F4E8 =
|
|||||||
.affineParam = 0
|
.affineParam = 0
|
||||||
};
|
};
|
||||||
|
|
||||||
static const union AnimCmd sSpriteAnim_859F4F0[] =
|
static const union AnimCmd sAnim_SwapLine_RightArrow[] =
|
||||||
{
|
{
|
||||||
ANIMCMD_FRAME(0, 0),
|
ANIMCMD_FRAME(0, 0),
|
||||||
ANIMCMD_END
|
ANIMCMD_END
|
||||||
};
|
};
|
||||||
|
|
||||||
static const union AnimCmd sSpriteAnim_859F4F8[] =
|
static const union AnimCmd sAnim_SwapLine_Line[] =
|
||||||
{
|
{
|
||||||
ANIMCMD_FRAME(4, 0),
|
ANIMCMD_FRAME(4, 0),
|
||||||
ANIMCMD_END
|
ANIMCMD_END
|
||||||
};
|
};
|
||||||
|
|
||||||
static const union AnimCmd sSpriteAnim_859F500[] =
|
static const union AnimCmd sAnim_SwapLine_LeftArrow[] =
|
||||||
{
|
{
|
||||||
ANIMCMD_FRAME(0, 0, 1, 0),
|
ANIMCMD_FRAME(0, 0, .hFlip = TRUE),
|
||||||
ANIMCMD_END
|
ANIMCMD_END
|
||||||
};
|
};
|
||||||
|
|
||||||
static const union AnimCmd *const sSpriteAnimTable_859F508[] =
|
static const union AnimCmd *const sAnims_SwapLine[] =
|
||||||
{
|
{
|
||||||
sSpriteAnim_859F4F0,
|
sAnim_SwapLine_RightArrow,
|
||||||
sSpriteAnim_859F4F8,
|
sAnim_SwapLine_Line,
|
||||||
sSpriteAnim_859F500
|
sAnim_SwapLine_LeftArrow
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct CompressedSpriteSheet gUnknown_0859F514 =
|
static const struct CompressedSpriteSheet sSpriteSheet_SwapLine =
|
||||||
{
|
{
|
||||||
gBagSwapLineGfx, 0x100, 109
|
gBagSwapLineGfx, 0x100, TAG_SWAP_LINE
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct CompressedSpritePalette gUnknown_0859F51C =
|
static const struct CompressedSpritePalette sSpritePalette_SwapLine =
|
||||||
{
|
{
|
||||||
gBagSwapLinePal, 109
|
gBagSwapLinePal, TAG_SWAP_LINE
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct SpriteTemplate gUnknown_0859F524 =
|
static const struct SpriteTemplate sSpriteTemplate_SwapLine =
|
||||||
{
|
{
|
||||||
.tileTag = 109,
|
.tileTag = TAG_SWAP_LINE,
|
||||||
.paletteTag = 109,
|
.paletteTag = TAG_SWAP_LINE,
|
||||||
.oam = &sOamData_859F4E8,
|
.oam = &sOamData_SwapLine,
|
||||||
.anims = sSpriteAnimTable_859F508,
|
.anims = sAnims_SwapLine,
|
||||||
.images = NULL,
|
.images = NULL,
|
||||||
.affineAnims = gDummySpriteAffineAnimTable,
|
.affineAnims = gDummySpriteAffineAnimTable,
|
||||||
.callback = SpriteCallbackDummy,
|
.callback = SpriteCallbackDummy,
|
||||||
@ -390,19 +388,19 @@ void sub_8122298(u16 *arg0, u16 *arg1, u8 arg2, u8 arg3, u8 arg4)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoadListMenuArrowsGfx(void)
|
void LoadListMenuSwapLineGfx(void)
|
||||||
{
|
{
|
||||||
LoadCompressedSpriteSheet(&gUnknown_0859F514);
|
LoadCompressedSpriteSheet(&sSpriteSheet_SwapLine);
|
||||||
LoadCompressedSpritePalette(&gUnknown_0859F51C);
|
LoadCompressedSpritePalette(&sSpritePalette_SwapLine);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_8122344(u8 *spriteIds, u8 count)
|
void CreateSwapLineSprites(u8 *spriteIds, u8 count)
|
||||||
{
|
{
|
||||||
u8 i;
|
u8 i;
|
||||||
|
|
||||||
for (i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
spriteIds[i] = CreateSprite(&gUnknown_0859F524, i * 16, 0, 0);
|
spriteIds[i] = CreateSprite(&sSpriteTemplate_SwapLine, i * 16, 0, 0);
|
||||||
if (i != 0)
|
if (i != 0)
|
||||||
StartSpriteAnim(&gSprites[spriteIds[i]], 1);
|
StartSpriteAnim(&gSprites[spriteIds[i]], 1);
|
||||||
|
|
||||||
@ -410,7 +408,7 @@ void sub_8122344(u8 *spriteIds, u8 count)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_81223B0(u8 *spriteIds, u8 count)
|
void DestroySwapLineSprites(u8 *spriteIds, u8 count)
|
||||||
{
|
{
|
||||||
u8 i;
|
u8 i;
|
||||||
|
|
||||||
@ -423,17 +421,15 @@ void sub_81223B0(u8 *spriteIds, u8 count)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_81223FC(u8 *spriteIds, u8 count, bool8 invisible)
|
void SetSwapLineSpritesInvisibility(u8 *spriteIds, u8 count, bool8 invisible)
|
||||||
{
|
{
|
||||||
u8 i;
|
u8 i;
|
||||||
|
|
||||||
for (i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
{
|
|
||||||
gSprites[spriteIds[i]].invisible = invisible;
|
gSprites[spriteIds[i]].invisible = invisible;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_8122448(u8 *spriteIds, u8 count, s16 x, u16 y)
|
void UpdateSwapLineSpritesPos(u8 *spriteIds, u8 count, s16 x, u16 y)
|
||||||
{
|
{
|
||||||
u8 i;
|
u8 i;
|
||||||
bool8 unknownBit = count & 0x80;
|
bool8 unknownBit = count & 0x80;
|
||||||
|
@ -112,7 +112,7 @@ static void CopyItemName_PlayerPC(u8 *string, u16 itemId);
|
|||||||
static void sub_816BC14(void);
|
static void sub_816BC14(void);
|
||||||
static void sub_816BFE0(u8 y, u8, u8 speed);
|
static void sub_816BFE0(u8 y, u8, u8 speed);
|
||||||
static void sub_816BCC4(u8);
|
static void sub_816BCC4(u8);
|
||||||
static void sub_816C690(u8);
|
static void UpdateSwapLinePos(u8);
|
||||||
static void sub_816C4FC(u8 taskId);
|
static void sub_816C4FC(u8 taskId);
|
||||||
static void sub_816C0C8(void);
|
static void sub_816C0C8(void);
|
||||||
static void sub_816C060(u16 itemId);
|
static void sub_816C060(u16 itemId);
|
||||||
@ -558,8 +558,8 @@ static void ItemStorage_WithdrawToss_Helper(u8 taskId, bool8 toss)
|
|||||||
ItemStorage_SetItemAndMailCount(taskId);
|
ItemStorage_SetItemAndMailCount(taskId);
|
||||||
sub_816BC14();
|
sub_816BC14();
|
||||||
FreeAndReserveObjectSpritePalettes();
|
FreeAndReserveObjectSpritePalettes();
|
||||||
LoadListMenuArrowsGfx();
|
LoadListMenuSwapLineGfx();
|
||||||
sub_8122344(gUnknown_0203BCC4->spriteIds, 7);
|
CreateSwapLineSprites(gUnknown_0203BCC4->spriteIds, 7);
|
||||||
ClearDialogWindowAndFrame(0,0);
|
ClearDialogWindowAndFrame(0,0);
|
||||||
gTasks[taskId].func = ItemStorage_ProcessWithdrawTossInput;
|
gTasks[taskId].func = ItemStorage_ProcessWithdrawTossInput;
|
||||||
}
|
}
|
||||||
@ -1186,7 +1186,7 @@ static void ItemStorage_GoBackToPlayerPCMenu(u8 taskId)
|
|||||||
sub_816C0C8();
|
sub_816C0C8();
|
||||||
ItemStorage_RemoveScrollIndicator();
|
ItemStorage_RemoveScrollIndicator();
|
||||||
DestroyListMenuTask(data[5], NULL, NULL);
|
DestroyListMenuTask(data[5], NULL, NULL);
|
||||||
sub_81223B0(gUnknown_0203BCC4->spriteIds, 7);
|
DestroySwapLineSprites(gUnknown_0203BCC4->spriteIds, 7);
|
||||||
sub_816BC58();
|
sub_816BC58();
|
||||||
gTasks[taskId].func = ItemStorage_GoBackToPlayerPCMenu_InitStorage;
|
gTasks[taskId].func = ItemStorage_GoBackToPlayerPCMenu_InitStorage;
|
||||||
}
|
}
|
||||||
@ -1199,7 +1199,7 @@ static void ItemStorage_ItemSwapChoosePrompt(u8 taskId)
|
|||||||
ListMenuSetUnkIndicatorsStructField(data[5], 16, 1);
|
ListMenuSetUnkIndicatorsStructField(data[5], 16, 1);
|
||||||
gUnknown_0203BCC4->unk666 = (playerPCItemPageInfo.itemsAbove + playerPCItemPageInfo.cursorPos);
|
gUnknown_0203BCC4->unk666 = (playerPCItemPageInfo.itemsAbove + playerPCItemPageInfo.cursorPos);
|
||||||
sub_816BFB8(data[5], 0, 0);
|
sub_816BFB8(data[5], 0, 0);
|
||||||
sub_816C690(gUnknown_0203BCC4->unk666);
|
UpdateSwapLinePos(gUnknown_0203BCC4->unk666);
|
||||||
CopyItemName(gSaveBlock1Ptr->pcItems[gUnknown_0203BCC4->unk666].itemId, gStringVar1);
|
CopyItemName(gSaveBlock1Ptr->pcItems[gUnknown_0203BCC4->unk666].itemId, gStringVar1);
|
||||||
ItemStorage_PrintItemPcResponse(ItemStorage_GetItemPcResponse(ITEMPC_SWITCH_WHICH_ITEM));
|
ItemStorage_PrintItemPcResponse(ItemStorage_GetItemPcResponse(ITEMPC_SWITCH_WHICH_ITEM));
|
||||||
gTasks[taskId].func = sub_816C4FC;
|
gTasks[taskId].func = sub_816C4FC;
|
||||||
@ -1219,8 +1219,8 @@ static void sub_816C4FC(u8 taskId)
|
|||||||
}
|
}
|
||||||
id = ListMenu_ProcessInput(data[5]);
|
id = ListMenu_ProcessInput(data[5]);
|
||||||
ListMenuGetScrollAndRow(data[5], &(playerPCItemPageInfo.itemsAbove), &(playerPCItemPageInfo.cursorPos));
|
ListMenuGetScrollAndRow(data[5], &(playerPCItemPageInfo.itemsAbove), &(playerPCItemPageInfo.cursorPos));
|
||||||
sub_81223FC(gUnknown_0203BCC4->spriteIds, 7, 0);
|
SetSwapLineSpritesInvisibility(gUnknown_0203BCC4->spriteIds, 7, FALSE);
|
||||||
sub_816C690(playerPCItemPageInfo.cursorPos);
|
UpdateSwapLinePos(playerPCItemPageInfo.cursorPos);
|
||||||
switch(id)
|
switch(id)
|
||||||
{
|
{
|
||||||
case LIST_NOTHING_CHOSEN:
|
case LIST_NOTHING_CHOSEN:
|
||||||
@ -1268,16 +1268,16 @@ static void ItemStorage_DoItemSwap(u8 taskId, bool8 a)
|
|||||||
if (gUnknown_0203BCC4->unk666 < b)
|
if (gUnknown_0203BCC4->unk666 < b)
|
||||||
playerPCItemPageInfo.cursorPos--;
|
playerPCItemPageInfo.cursorPos--;
|
||||||
LABEL_SKIP_CURSOR_DECREMENT:
|
LABEL_SKIP_CURSOR_DECREMENT:
|
||||||
sub_81223FC(gUnknown_0203BCC4->spriteIds, 7, 1);
|
SetSwapLineSpritesInvisibility(gUnknown_0203BCC4->spriteIds, 7, TRUE);
|
||||||
gUnknown_0203BCC4->unk666 = 0xFF;
|
gUnknown_0203BCC4->unk666 = 0xFF;
|
||||||
data[5] = ListMenuInit(&gMultiuseListMenuTemplate, playerPCItemPageInfo.itemsAbove, playerPCItemPageInfo.cursorPos);
|
data[5] = ListMenuInit(&gMultiuseListMenuTemplate, playerPCItemPageInfo.itemsAbove, playerPCItemPageInfo.cursorPos);
|
||||||
ScheduleBgCopyTilemapToVram(0);
|
ScheduleBgCopyTilemapToVram(0);
|
||||||
gTasks[taskId].func = ItemStorage_ProcessInput;
|
gTasks[taskId].func = ItemStorage_ProcessInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sub_816C690(u8 a)
|
static void UpdateSwapLinePos(u8 y)
|
||||||
{
|
{
|
||||||
sub_8122448(gUnknown_0203BCC4->spriteIds, 7, 128, ((a+1) * 16));
|
UpdateSwapLineSpritesPos(gUnknown_0203BCC4->spriteIds, 7, 128, ((y+1) * 16));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sub_816C6BC(u8 windowId, u16 value, u32 mode, u8 x, u8 y, u8 n)
|
static void sub_816C6BC(u8 windowId, u16 value, u32 mode, u8 x, u8 y, u8 n)
|
||||||
|
508
src/pokeblock.c
508
src/pokeblock.c
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -708,7 +708,7 @@ static void FeedPokeblockToMon(void)
|
|||||||
FREE_AND_SET_NULL(sMenu);
|
FREE_AND_SET_NULL(sMenu);
|
||||||
FreeAllWindowBuffers();
|
FreeAllWindowBuffers();
|
||||||
gMain.savedCallback = CB2_ReturnAndChooseMonToGivePokeblock;
|
gMain.savedCallback = CB2_ReturnAndChooseMonToGivePokeblock;
|
||||||
CB2_PreparePokeblockFeedScene();
|
PreparePokeblockFeedScene();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user