resolve change requests
This commit is contained in:
@@ -206,26 +206,6 @@ struct LinkBattleRecords
|
|||||||
#include "global.berry.h"
|
#include "global.berry.h"
|
||||||
#include "pokemon.h"
|
#include "pokemon.h"
|
||||||
|
|
||||||
struct UnknownSaveBlock2Struct
|
|
||||||
{
|
|
||||||
u8 field_0;
|
|
||||||
u8 field_1;
|
|
||||||
u8 field_2[2];
|
|
||||||
u8 field_4[8];
|
|
||||||
u8 field_C[16];
|
|
||||||
u16 field_1C[6];
|
|
||||||
u16 field_28[6];
|
|
||||||
u8 field_34[176];
|
|
||||||
u8 field_E4;
|
|
||||||
u8 field_E5;
|
|
||||||
u8 field_E6;
|
|
||||||
u8 field_E7;
|
|
||||||
u8 field_E8;
|
|
||||||
u8 field_E9;
|
|
||||||
u8 field_EA;
|
|
||||||
u8 field_EB;
|
|
||||||
}; // sizeof = 0xEC
|
|
||||||
|
|
||||||
struct BattleTowerRecord // record mixing
|
struct BattleTowerRecord // record mixing
|
||||||
{
|
{
|
||||||
/*0x00*/ u8 battleTowerLevelType; // 0 = level 50, 1 = level 100
|
/*0x00*/ u8 battleTowerLevelType; // 0 = level 50, 1 = level 100
|
||||||
|
|||||||
+6
-6
@@ -53,8 +53,8 @@ struct ListMenuTemplate
|
|||||||
struct ListMenu
|
struct ListMenu
|
||||||
{
|
{
|
||||||
struct ListMenuTemplate template;
|
struct ListMenuTemplate template;
|
||||||
u16 scrollOffset;
|
u16 cursorPos;
|
||||||
u16 selectedRow;
|
u16 itemsAbove;
|
||||||
u8 unk_1C;
|
u8 unk_1C;
|
||||||
u8 unk_1D;
|
u8 unk_1D;
|
||||||
u8 taskId;
|
u8 taskId;
|
||||||
@@ -73,12 +73,12 @@ struct ListMenuWindowRect
|
|||||||
extern struct ListMenuTemplate gMultiuseListMenuTemplate;
|
extern struct ListMenuTemplate gMultiuseListMenuTemplate;
|
||||||
|
|
||||||
s32 DoMysteryGiftListMenu(const struct WindowTemplate *windowTemplate, const struct ListMenuTemplate *listMenuTemplate, u8 arg2, u16 tileNum, u16 palNum);
|
s32 DoMysteryGiftListMenu(const struct WindowTemplate *windowTemplate, const struct ListMenuTemplate *listMenuTemplate, u8 arg2, u16 tileNum, u16 palNum);
|
||||||
u8 ListMenuInit(struct ListMenuTemplate *listMenuTemplate, u16 scrollOffset, u16 selectedRow);
|
u8 ListMenuInit(struct ListMenuTemplate *listMenuTemplate, u16 cursorPos, u16 itemsAbove);
|
||||||
u8 ListMenuInitInRect(struct ListMenuTemplate *listMenuTemplate, struct ListMenuWindowRect *rect, u16 scrollOffset, u16 selectedRow);
|
u8 ListMenuInitInRect(struct ListMenuTemplate *listMenuTemplate, struct ListMenuWindowRect *rect, u16 cursorPos, u16 itemsAbove);
|
||||||
s32 ListMenu_ProcessInput(u8 listTaskId);
|
s32 ListMenu_ProcessInput(u8 listTaskId);
|
||||||
void DestroyListMenuTask(u8 listTaskId, u16 *scrollOffset, u16 *selectedRow);
|
void DestroyListMenuTask(u8 listTaskId, u16 *cursorPos, u16 *itemsAbove);
|
||||||
void RedrawListMenu(u8 listTaskId);
|
void RedrawListMenu(u8 listTaskId);
|
||||||
void ListMenuGetScrollAndRow(u8 listTaskId, u16 *scrollOffset, u16 *selectedRow);
|
void ListMenuGetScrollAndRow(u8 listTaskId, u16 *cursorPos, u16 *itemsAbove);
|
||||||
u16 ListMenuGetYCoordForPrintingArrowCursor(u8 listTaskId);
|
u16 ListMenuGetYCoordForPrintingArrowCursor(u8 listTaskId);
|
||||||
void ListMenuOverrideSetColors(u8 cursorPal, u8 fillValue, u8 cursorShadowPal);
|
void ListMenuOverrideSetColors(u8 cursorPal, u8 fillValue, u8 cursorShadowPal);
|
||||||
void ListMenuDefaultCursorMoveFunc(s32 itemIndex, bool8 onInit, struct ListMenu *list);
|
void ListMenuDefaultCursorMoveFunc(s32 itemIndex, bool8 onInit, struct ListMenu *list);
|
||||||
|
|||||||
+2016
-2016
File diff suppressed because it is too large
Load Diff
+63
-63
@@ -70,7 +70,7 @@ static EWRAM_DATA struct MysteryGiftLinkMenuStruct sMysteryGiftLinkMenu = {0};
|
|||||||
struct ListMenuOverride gListMenuOverride;
|
struct ListMenuOverride gListMenuOverride;
|
||||||
struct ListMenuTemplate gMultiuseListMenuTemplate;
|
struct ListMenuTemplate gMultiuseListMenuTemplate;
|
||||||
|
|
||||||
static u8 ListMenuInitInternal(struct ListMenuTemplate *listMenuTemplate, u16 scrollOffset, u16 selectedRow);
|
static u8 ListMenuInitInternal(struct ListMenuTemplate *listMenuTemplate, u16 cursorPos, u16 itemsAbove);
|
||||||
static bool8 ListMenuChangeSelection(struct ListMenu *list, bool8 updateCursorAndCallCallback, u8 count, bool8 movingDown);
|
static bool8 ListMenuChangeSelection(struct ListMenu *list, bool8 updateCursorAndCallCallback, u8 count, bool8 movingDown);
|
||||||
static void ListMenuPrintEntries(struct ListMenu *list, u16 startIndex, u16 yOffset, u16 count);
|
static void ListMenuPrintEntries(struct ListMenu *list, u16 startIndex, u16 yOffset, u16 count);
|
||||||
static void ListMenuDrawCursor(struct ListMenu *list);
|
static void ListMenuDrawCursor(struct ListMenu *list);
|
||||||
@@ -172,18 +172,18 @@ s32 DoMysteryGiftListMenu(const struct WindowTemplate *windowTemplate, const str
|
|||||||
return LIST_NOTHING_CHOSEN;
|
return LIST_NOTHING_CHOSEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 ListMenuInit(struct ListMenuTemplate *listMenuTemplate, u16 scrollOffset, u16 selectedRow)
|
u8 ListMenuInit(struct ListMenuTemplate *listMenuTemplate, u16 cursorPos, u16 itemsAbove)
|
||||||
{
|
{
|
||||||
u8 taskId = ListMenuInitInternal(listMenuTemplate, scrollOffset, selectedRow);
|
u8 taskId = ListMenuInitInternal(listMenuTemplate, cursorPos, itemsAbove);
|
||||||
PutWindowTilemap(listMenuTemplate->windowId);
|
PutWindowTilemap(listMenuTemplate->windowId);
|
||||||
CopyWindowToVram(listMenuTemplate->windowId, 2);
|
CopyWindowToVram(listMenuTemplate->windowId, 2);
|
||||||
return taskId;
|
return taskId;
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 ListMenuInitInRect(struct ListMenuTemplate *listMenuTemplate, struct ListMenuWindowRect *rect, u16 scrollOffset, u16 selectedRow)
|
u8 ListMenuInitInRect(struct ListMenuTemplate *listMenuTemplate, struct ListMenuWindowRect *rect, u16 cursorPos, u16 itemsAbove)
|
||||||
{
|
{
|
||||||
s32 i;
|
s32 i;
|
||||||
u8 taskId = ListMenuInitInternal(listMenuTemplate, scrollOffset, selectedRow);
|
u8 taskId = ListMenuInitInternal(listMenuTemplate, cursorPos, itemsAbove);
|
||||||
|
|
||||||
for (i = 0; rect[i].palNum != 0xFF; i++)
|
for (i = 0; rect[i].palNum != 0xFF; i++)
|
||||||
PutWindowRectTilemapOverridePalette(listMenuTemplate->windowId, rect[i].x, rect[i].y, rect[i].width, rect[i].height, rect[i].palNum);
|
PutWindowRectTilemapOverridePalette(listMenuTemplate->windowId, rect[i].x, rect[i].y, rect[i].width, rect[i].height, rect[i].palNum);
|
||||||
@@ -197,7 +197,7 @@ s32 ListMenu_ProcessInput(u8 listTaskId)
|
|||||||
|
|
||||||
if (JOY_NEW(A_BUTTON))
|
if (JOY_NEW(A_BUTTON))
|
||||||
{
|
{
|
||||||
return list->template.items[list->scrollOffset + list->selectedRow].index;
|
return list->template.items[list->cursorPos + list->itemsAbove].index;
|
||||||
}
|
}
|
||||||
else if (JOY_NEW(B_BUTTON))
|
else if (JOY_NEW(B_BUTTON))
|
||||||
{
|
{
|
||||||
@@ -249,14 +249,14 @@ s32 ListMenu_ProcessInput(u8 listTaskId)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DestroyListMenuTask(u8 listTaskId, u16 *scrollOffset, u16 *selectedRow)
|
void DestroyListMenuTask(u8 listTaskId, u16 *cursorPos, u16 *itemsAbove)
|
||||||
{
|
{
|
||||||
struct ListMenu *list = (struct ListMenu *)gTasks[listTaskId].data;
|
struct ListMenu *list = (struct ListMenu *)gTasks[listTaskId].data;
|
||||||
|
|
||||||
if (scrollOffset != NULL)
|
if (cursorPos != NULL)
|
||||||
*scrollOffset = list->scrollOffset;
|
*cursorPos = list->cursorPos;
|
||||||
if (selectedRow != NULL)
|
if (itemsAbove != NULL)
|
||||||
*selectedRow = list->selectedRow;
|
*itemsAbove = list->itemsAbove;
|
||||||
|
|
||||||
if (list->taskId != TASK_NONE)
|
if (list->taskId != TASK_NONE)
|
||||||
ListMenuRemoveCursorObject(list->taskId, list->template.cursorKind - 2);
|
ListMenuRemoveCursorObject(list->taskId, list->template.cursorKind - 2);
|
||||||
@@ -269,7 +269,7 @@ void RedrawListMenu(u8 listTaskId)
|
|||||||
struct ListMenu *list = (struct ListMenu *)gTasks[listTaskId].data;
|
struct ListMenu *list = (struct ListMenu *)gTasks[listTaskId].data;
|
||||||
|
|
||||||
FillWindowPixelBuffer(list->template.windowId, PIXEL_FILL(list->template.fillValue));
|
FillWindowPixelBuffer(list->template.windowId, PIXEL_FILL(list->template.fillValue));
|
||||||
ListMenuPrintEntries(list, list->scrollOffset, 0, list->template.maxShowed);
|
ListMenuPrintEntries(list, list->cursorPos, 0, list->template.maxShowed);
|
||||||
ListMenuDrawCursor(list);
|
ListMenuDrawCursor(list);
|
||||||
CopyWindowToVram(list->template.windowId, 2);
|
CopyWindowToVram(list->template.windowId, 2);
|
||||||
}
|
}
|
||||||
@@ -291,13 +291,13 @@ static void ChangeListMenuCoords(u8 listTaskId, u8 x, u8 y)
|
|||||||
SetWindowAttribute(list->template.windowId, WINDOW_TILEMAP_TOP, y);
|
SetWindowAttribute(list->template.windowId, WINDOW_TILEMAP_TOP, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
static s32 ListMenuTestInput(struct ListMenuTemplate *template, u32 scrollOffset, u32 selectedRow, u16 keys, u16 *newScrollOffset, u16 *newSelectedRow)
|
static s32 ListMenuTestInput(struct ListMenuTemplate *template, u32 cursorPos, u32 itemsAbove, u16 keys, u16 *newCursorPos, u16 *newItemsAbove)
|
||||||
{
|
{
|
||||||
struct ListMenu list;
|
struct ListMenu list;
|
||||||
|
|
||||||
list.template = *template;
|
list.template = *template;
|
||||||
list.scrollOffset = scrollOffset;
|
list.cursorPos = cursorPos;
|
||||||
list.selectedRow = selectedRow;
|
list.itemsAbove = itemsAbove;
|
||||||
list.unk_1C = 0;
|
list.unk_1C = 0;
|
||||||
list.unk_1D = 0;
|
list.unk_1D = 0;
|
||||||
if (keys == DPAD_UP)
|
if (keys == DPAD_UP)
|
||||||
@@ -305,10 +305,10 @@ static s32 ListMenuTestInput(struct ListMenuTemplate *template, u32 scrollOffset
|
|||||||
if (keys == DPAD_DOWN)
|
if (keys == DPAD_DOWN)
|
||||||
ListMenuChangeSelection(&list, FALSE, 1, TRUE);
|
ListMenuChangeSelection(&list, FALSE, 1, TRUE);
|
||||||
|
|
||||||
if (newScrollOffset != NULL)
|
if (newCursorPos != NULL)
|
||||||
*newScrollOffset = list.scrollOffset;
|
*newCursorPos = list.cursorPos;
|
||||||
if (newSelectedRow != NULL)
|
if (newItemsAbove != NULL)
|
||||||
*newSelectedRow = list.selectedRow;
|
*newItemsAbove = list.itemsAbove;
|
||||||
return LIST_NOTHING_CHOSEN;
|
return LIST_NOTHING_CHOSEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -317,17 +317,17 @@ static void ListMenuGetCurrentItemArrayId(u8 listTaskId, u16 *arrayId)
|
|||||||
struct ListMenu *list = (struct ListMenu *)gTasks[listTaskId].data;
|
struct ListMenu *list = (struct ListMenu *)gTasks[listTaskId].data;
|
||||||
|
|
||||||
if (arrayId != NULL)
|
if (arrayId != NULL)
|
||||||
*arrayId = list->scrollOffset + list->selectedRow;
|
*arrayId = list->cursorPos + list->itemsAbove;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ListMenuGetScrollAndRow(u8 listTaskId, u16 *scrollOffset, u16 *selectedRow)
|
void ListMenuGetScrollAndRow(u8 listTaskId, u16 *cursorPos, u16 *itemsAbove)
|
||||||
{
|
{
|
||||||
struct ListMenu *list = (struct ListMenu *)gTasks[listTaskId].data;
|
struct ListMenu *list = (struct ListMenu *)gTasks[listTaskId].data;
|
||||||
|
|
||||||
if (scrollOffset != NULL)
|
if (cursorPos != NULL)
|
||||||
*scrollOffset = list->scrollOffset;
|
*cursorPos = list->cursorPos;
|
||||||
if (selectedRow != NULL)
|
if (itemsAbove != NULL)
|
||||||
*selectedRow = list->selectedRow;
|
*itemsAbove = list->itemsAbove;
|
||||||
}
|
}
|
||||||
|
|
||||||
u16 ListMenuGetYCoordForPrintingArrowCursor(u8 listTaskId)
|
u16 ListMenuGetYCoordForPrintingArrowCursor(u8 listTaskId)
|
||||||
@@ -335,17 +335,17 @@ u16 ListMenuGetYCoordForPrintingArrowCursor(u8 listTaskId)
|
|||||||
struct ListMenu *list = (struct ListMenu *)gTasks[listTaskId].data;
|
struct ListMenu *list = (struct ListMenu *)gTasks[listTaskId].data;
|
||||||
u8 yMultiplier = GetFontAttribute(list->template.fontId, FONTATTR_MAX_LETTER_HEIGHT) + list->template.itemVerticalPadding;
|
u8 yMultiplier = GetFontAttribute(list->template.fontId, FONTATTR_MAX_LETTER_HEIGHT) + list->template.itemVerticalPadding;
|
||||||
|
|
||||||
return list->selectedRow * yMultiplier + list->template.upText_Y;
|
return list->itemsAbove * yMultiplier + list->template.upText_Y;
|
||||||
}
|
}
|
||||||
|
|
||||||
static u8 ListMenuInitInternal(struct ListMenuTemplate *listMenuTemplate, u16 scrollOffset, u16 selectedRow)
|
static u8 ListMenuInitInternal(struct ListMenuTemplate *listMenuTemplate, u16 cursorPos, u16 itemsAbove)
|
||||||
{
|
{
|
||||||
u8 listTaskId = CreateTask(ListMenuDummyTask, 0);
|
u8 listTaskId = CreateTask(ListMenuDummyTask, 0);
|
||||||
struct ListMenu *list = (struct ListMenu *)gTasks[listTaskId].data;
|
struct ListMenu *list = (struct ListMenu *)gTasks[listTaskId].data;
|
||||||
|
|
||||||
list->template = *listMenuTemplate;
|
list->template = *listMenuTemplate;
|
||||||
list->scrollOffset = scrollOffset;
|
list->cursorPos = cursorPos;
|
||||||
list->selectedRow = selectedRow;
|
list->itemsAbove = itemsAbove;
|
||||||
list->unk_1C = 0;
|
list->unk_1C = 0;
|
||||||
list->unk_1D = 0;
|
list->unk_1D = 0;
|
||||||
list->taskId = TASK_NONE;
|
list->taskId = TASK_NONE;
|
||||||
@@ -359,7 +359,7 @@ static u8 ListMenuInitInternal(struct ListMenuTemplate *listMenuTemplate, u16 sc
|
|||||||
if (list->template.totalItems < list->template.maxShowed)
|
if (list->template.totalItems < list->template.maxShowed)
|
||||||
list->template.maxShowed = list->template.totalItems;
|
list->template.maxShowed = list->template.totalItems;
|
||||||
FillWindowPixelBuffer(list->template.windowId, PIXEL_FILL(list->template.fillValue));
|
FillWindowPixelBuffer(list->template.windowId, PIXEL_FILL(list->template.fillValue));
|
||||||
ListMenuPrintEntries(list, list->scrollOffset, 0, list->template.maxShowed);
|
ListMenuPrintEntries(list, list->cursorPos, 0, list->template.maxShowed);
|
||||||
ListMenuDrawCursor(list);
|
ListMenuDrawCursor(list);
|
||||||
ListMenuCallSelectionChangedCallback(list, TRUE);
|
ListMenuCallSelectionChangedCallback(list, TRUE);
|
||||||
|
|
||||||
@@ -410,7 +410,7 @@ static void ListMenuDrawCursor(struct ListMenu *list)
|
|||||||
{
|
{
|
||||||
u8 yMultiplier = GetFontAttribute(list->template.fontId, FONTATTR_MAX_LETTER_HEIGHT) + list->template.itemVerticalPadding;
|
u8 yMultiplier = GetFontAttribute(list->template.fontId, FONTATTR_MAX_LETTER_HEIGHT) + list->template.itemVerticalPadding;
|
||||||
u8 x = list->template.cursor_X;
|
u8 x = list->template.cursor_X;
|
||||||
u8 y = list->selectedRow * yMultiplier + list->template.upText_Y;
|
u8 y = list->itemsAbove * yMultiplier + list->template.upText_Y;
|
||||||
|
|
||||||
switch (list->template.cursorKind)
|
switch (list->template.cursorKind)
|
||||||
{
|
{
|
||||||
@@ -446,7 +446,7 @@ static u8 ListMenuAddCursorObject(struct ListMenu *list, u32 cursorKind)
|
|||||||
return ListMenuAddCursorObjectInternal(&cursor, cursorKind);
|
return ListMenuAddCursorObjectInternal(&cursor, cursorKind);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ListMenuErasePrintedCursor(struct ListMenu *list, u16 selectedRow)
|
static void ListMenuErasePrintedCursor(struct ListMenu *list, u16 itemsAbove)
|
||||||
{
|
{
|
||||||
u8 cursorKind = list->template.cursorKind;
|
u8 cursorKind = list->template.cursorKind;
|
||||||
if (cursorKind == 0)
|
if (cursorKind == 0)
|
||||||
@@ -457,7 +457,7 @@ static void ListMenuErasePrintedCursor(struct ListMenu *list, u16 selectedRow)
|
|||||||
FillWindowPixelRect(list->template.windowId,
|
FillWindowPixelRect(list->template.windowId,
|
||||||
PIXEL_FILL(list->template.fillValue),
|
PIXEL_FILL(list->template.fillValue),
|
||||||
list->template.cursor_X,
|
list->template.cursor_X,
|
||||||
selectedRow * yMultiplier + list->template.upText_Y,
|
itemsAbove * yMultiplier + list->template.upText_Y,
|
||||||
width,
|
width,
|
||||||
height);
|
height);
|
||||||
}
|
}
|
||||||
@@ -465,8 +465,8 @@ static void ListMenuErasePrintedCursor(struct ListMenu *list, u16 selectedRow)
|
|||||||
|
|
||||||
static u8 ListMenuUpdateSelectedRowIndexAndScrollOffset(struct ListMenu *list, bool8 movingDown)
|
static u8 ListMenuUpdateSelectedRowIndexAndScrollOffset(struct ListMenu *list, bool8 movingDown)
|
||||||
{
|
{
|
||||||
u16 selectedRow = list->selectedRow;
|
u16 itemsAbove = list->itemsAbove;
|
||||||
u16 scrollOffset = list->scrollOffset;
|
u16 cursorPos = list->cursorPos;
|
||||||
u16 newRow;
|
u16 newRow;
|
||||||
u32 newScroll;
|
u32 newScroll;
|
||||||
|
|
||||||
@@ -477,14 +477,14 @@ static u8 ListMenuUpdateSelectedRowIndexAndScrollOffset(struct ListMenu *list, b
|
|||||||
else
|
else
|
||||||
newRow = list->template.maxShowed - ((list->template.maxShowed / 2) + (list->template.maxShowed % 2)) - 1;
|
newRow = list->template.maxShowed - ((list->template.maxShowed / 2) + (list->template.maxShowed % 2)) - 1;
|
||||||
|
|
||||||
if (scrollOffset == 0)
|
if (cursorPos == 0)
|
||||||
{
|
{
|
||||||
while (selectedRow != 0)
|
while (itemsAbove != 0)
|
||||||
{
|
{
|
||||||
selectedRow--;
|
itemsAbove--;
|
||||||
if (list->template.items[scrollOffset + selectedRow].index != LIST_HEADER)
|
if (list->template.items[cursorPos + itemsAbove].index != LIST_HEADER)
|
||||||
{
|
{
|
||||||
list->selectedRow = selectedRow;
|
list->itemsAbove = itemsAbove;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -492,16 +492,16 @@ static u8 ListMenuUpdateSelectedRowIndexAndScrollOffset(struct ListMenu *list, b
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
while (selectedRow > newRow)
|
while (itemsAbove > newRow)
|
||||||
{
|
{
|
||||||
selectedRow--;
|
itemsAbove--;
|
||||||
if (list->template.items[scrollOffset + selectedRow].index != LIST_HEADER)
|
if (list->template.items[cursorPos + itemsAbove].index != LIST_HEADER)
|
||||||
{
|
{
|
||||||
list->selectedRow = selectedRow;
|
list->itemsAbove = itemsAbove;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
newScroll = scrollOffset - 1;
|
newScroll = cursorPos - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -511,14 +511,14 @@ static u8 ListMenuUpdateSelectedRowIndexAndScrollOffset(struct ListMenu *list, b
|
|||||||
else
|
else
|
||||||
newRow = ((list->template.maxShowed / 2) + (list->template.maxShowed % 2));
|
newRow = ((list->template.maxShowed / 2) + (list->template.maxShowed % 2));
|
||||||
|
|
||||||
if (scrollOffset == list->template.totalItems - list->template.maxShowed)
|
if (cursorPos == list->template.totalItems - list->template.maxShowed)
|
||||||
{
|
{
|
||||||
while (selectedRow < list->template.maxShowed - 1)
|
while (itemsAbove < list->template.maxShowed - 1)
|
||||||
{
|
{
|
||||||
selectedRow++;
|
itemsAbove++;
|
||||||
if (list->template.items[scrollOffset + selectedRow].index != LIST_HEADER)
|
if (list->template.items[cursorPos + itemsAbove].index != LIST_HEADER)
|
||||||
{
|
{
|
||||||
list->selectedRow = selectedRow;
|
list->itemsAbove = itemsAbove;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -526,20 +526,20 @@ static u8 ListMenuUpdateSelectedRowIndexAndScrollOffset(struct ListMenu *list, b
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
while (selectedRow < newRow)
|
while (itemsAbove < newRow)
|
||||||
{
|
{
|
||||||
selectedRow++;
|
itemsAbove++;
|
||||||
if (list->template.items[scrollOffset + selectedRow].index != LIST_HEADER)
|
if (list->template.items[cursorPos + itemsAbove].index != LIST_HEADER)
|
||||||
{
|
{
|
||||||
list->selectedRow = selectedRow;
|
list->itemsAbove = itemsAbove;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
newScroll = scrollOffset + 1;
|
newScroll = cursorPos + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
list->selectedRow = newRow;
|
list->itemsAbove = newRow;
|
||||||
list->scrollOffset = newScroll;
|
list->cursorPos = newScroll;
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -548,7 +548,7 @@ static void ListMenuScroll(struct ListMenu *list, u8 count, bool8 movingDown)
|
|||||||
if (count >= list->template.maxShowed)
|
if (count >= list->template.maxShowed)
|
||||||
{
|
{
|
||||||
FillWindowPixelBuffer(list->template.windowId, PIXEL_FILL(list->template.fillValue));
|
FillWindowPixelBuffer(list->template.windowId, PIXEL_FILL(list->template.fillValue));
|
||||||
ListMenuPrintEntries(list, list->scrollOffset, 0, list->template.maxShowed);
|
ListMenuPrintEntries(list, list->cursorPos, 0, list->template.maxShowed);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -559,7 +559,7 @@ static void ListMenuScroll(struct ListMenu *list, u8 count, bool8 movingDown)
|
|||||||
u16 y, width, height;
|
u16 y, width, height;
|
||||||
|
|
||||||
ScrollWindow(list->template.windowId, 1, count * yMultiplier, PIXEL_FILL(list->template.fillValue));
|
ScrollWindow(list->template.windowId, 1, count * yMultiplier, PIXEL_FILL(list->template.fillValue));
|
||||||
ListMenuPrintEntries(list, list->scrollOffset, 0, count);
|
ListMenuPrintEntries(list, list->cursorPos, 0, count);
|
||||||
|
|
||||||
y = (list->template.maxShowed * yMultiplier) + list->template.upText_Y;
|
y = (list->template.maxShowed * yMultiplier) + list->template.upText_Y;
|
||||||
width = GetWindowAttribute(list->template.windowId, WINDOW_WIDTH) * 8;
|
width = GetWindowAttribute(list->template.windowId, WINDOW_WIDTH) * 8;
|
||||||
@@ -573,7 +573,7 @@ static void ListMenuScroll(struct ListMenu *list, u8 count, bool8 movingDown)
|
|||||||
u16 width;
|
u16 width;
|
||||||
|
|
||||||
ScrollWindow(list->template.windowId, 0, count * yMultiplier, PIXEL_FILL(list->template.fillValue));
|
ScrollWindow(list->template.windowId, 0, count * yMultiplier, PIXEL_FILL(list->template.fillValue));
|
||||||
ListMenuPrintEntries(list, list->scrollOffset + (list->template.maxShowed - count), list->template.maxShowed - count, count);
|
ListMenuPrintEntries(list, list->cursorPos + (list->template.maxShowed - count), list->template.maxShowed - count, count);
|
||||||
|
|
||||||
width = GetWindowAttribute(list->template.windowId, WINDOW_WIDTH) * 8;
|
width = GetWindowAttribute(list->template.windowId, WINDOW_WIDTH) * 8;
|
||||||
FillWindowPixelRect(list->template.windowId,
|
FillWindowPixelRect(list->template.windowId,
|
||||||
@@ -588,7 +588,7 @@ static bool8 ListMenuChangeSelection(struct ListMenu *list, bool8 updateCursorAn
|
|||||||
u16 oldSelectedRow;
|
u16 oldSelectedRow;
|
||||||
u8 selectionChange, i, cursorCount;
|
u8 selectionChange, i, cursorCount;
|
||||||
|
|
||||||
oldSelectedRow = list->selectedRow;
|
oldSelectedRow = list->itemsAbove;
|
||||||
cursorCount = 0;
|
cursorCount = 0;
|
||||||
selectionChange = 0;
|
selectionChange = 0;
|
||||||
for (i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
@@ -602,7 +602,7 @@ static bool8 ListMenuChangeSelection(struct ListMenu *list, bool8 updateCursorAn
|
|||||||
break;
|
break;
|
||||||
cursorCount++;
|
cursorCount++;
|
||||||
}
|
}
|
||||||
while (list->template.items[list->scrollOffset + list->selectedRow].index == LIST_HEADER);
|
while (list->template.items[list->cursorPos + list->itemsAbove].index == LIST_HEADER);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (updateCursorAndCallCallback)
|
if (updateCursorAndCallCallback)
|
||||||
@@ -634,7 +634,7 @@ static bool8 ListMenuChangeSelection(struct ListMenu *list, bool8 updateCursorAn
|
|||||||
static void ListMenuCallSelectionChangedCallback(struct ListMenu *list, u8 onInit)
|
static void ListMenuCallSelectionChangedCallback(struct ListMenu *list, u8 onInit)
|
||||||
{
|
{
|
||||||
if (list->template.moveCursorFunc != NULL)
|
if (list->template.moveCursorFunc != NULL)
|
||||||
list->template.moveCursorFunc(list->template.items[list->scrollOffset + list->selectedRow].index, onInit, list);
|
list->template.moveCursorFunc(list->template.items[list->cursorPos + list->itemsAbove].index, onInit, list);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ListMenuOverrideSetColors(u8 cursorPal, u8 fillValue, u8 cursorShadowPal)
|
void ListMenuOverrideSetColors(u8 cursorPal, u8 fillValue, u8 cursorShadowPal)
|
||||||
|
|||||||
+12
-12
@@ -1159,13 +1159,13 @@ static void HandleChooseMonSelection(u8 taskId, s8 *slotPtr)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
switch (gPartyMenu.action - 3)
|
switch (gPartyMenu.action)
|
||||||
{
|
{
|
||||||
case PARTY_ACTION_SOFTBOILED - 3:
|
case PARTY_ACTION_SOFTBOILED:
|
||||||
if (IsSelectedMonNotEgg((u8 *)slotPtr))
|
if (IsSelectedMonNotEgg((u8 *)slotPtr))
|
||||||
Task_TryUseSoftboiledOnPartyMon(taskId);
|
Task_TryUseSoftboiledOnPartyMon(taskId);
|
||||||
break;
|
break;
|
||||||
case PARTY_ACTION_USE_ITEM - 3:
|
case PARTY_ACTION_USE_ITEM:
|
||||||
if (IsSelectedMonNotEgg((u8 *)slotPtr))
|
if (IsSelectedMonNotEgg((u8 *)slotPtr))
|
||||||
{
|
{
|
||||||
if (gPartyMenu.menuType == PARTY_MENU_TYPE_IN_BATTLE)
|
if (gPartyMenu.menuType == PARTY_MENU_TYPE_IN_BATTLE)
|
||||||
@@ -1173,46 +1173,46 @@ static void HandleChooseMonSelection(u8 taskId, s8 *slotPtr)
|
|||||||
gItemUseCB(taskId, Task_ClosePartyMenuAfterText);
|
gItemUseCB(taskId, Task_ClosePartyMenuAfterText);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PARTY_ACTION_MOVE_TUTOR - 3:
|
case PARTY_ACTION_MOVE_TUTOR:
|
||||||
if (IsSelectedMonNotEgg((u8 *)slotPtr))
|
if (IsSelectedMonNotEgg((u8 *)slotPtr))
|
||||||
{
|
{
|
||||||
PlaySE(SE_SELECT);
|
PlaySE(SE_SELECT);
|
||||||
TryTutorSelectedMon(taskId);
|
TryTutorSelectedMon(taskId);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PARTY_ACTION_GIVE_MAILBOX_MAIL - 3:
|
case PARTY_ACTION_GIVE_MAILBOX_MAIL:
|
||||||
if (IsSelectedMonNotEgg((u8 *)slotPtr))
|
if (IsSelectedMonNotEgg((u8 *)slotPtr))
|
||||||
{
|
{
|
||||||
PlaySE(SE_SELECT);
|
PlaySE(SE_SELECT);
|
||||||
TryGiveMailToSelectedMon(taskId);
|
TryGiveMailToSelectedMon(taskId);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PARTY_ACTION_GIVE_ITEM - 3:
|
case PARTY_ACTION_GIVE_ITEM:
|
||||||
case PARTY_ACTION_GIVE_PC_ITEM - 3:
|
case PARTY_ACTION_GIVE_PC_ITEM:
|
||||||
if (IsSelectedMonNotEgg((u8 *)slotPtr))
|
if (IsSelectedMonNotEgg((u8 *)slotPtr))
|
||||||
{
|
{
|
||||||
PlaySE(SE_SELECT);
|
PlaySE(SE_SELECT);
|
||||||
TryGiveItemOrMailToSelectedMon(taskId);
|
TryGiveItemOrMailToSelectedMon(taskId);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PARTY_ACTION_SWITCH - 3:
|
case PARTY_ACTION_SWITCH:
|
||||||
PlaySE(SE_SELECT);
|
PlaySE(SE_SELECT);
|
||||||
SwitchSelectedMons(taskId);
|
SwitchSelectedMons(taskId);
|
||||||
break;
|
break;
|
||||||
case PARTY_ACTION_CHOOSE_AND_CLOSE - 3:
|
case PARTY_ACTION_CHOOSE_AND_CLOSE:
|
||||||
PlaySE(SE_SELECT);
|
PlaySE(SE_SELECT);
|
||||||
gSpecialVar_0x8004 = *slotPtr;
|
gSpecialVar_0x8004 = *slotPtr;
|
||||||
if (gPartyMenu.menuType == PARTY_MENU_TYPE_MOVE_RELEARNER)
|
if (gPartyMenu.menuType == PARTY_MENU_TYPE_MOVE_RELEARNER)
|
||||||
gSpecialVar_0x8005 = GetNumberOfRelearnableMoves(&gPlayerParty[*slotPtr]);
|
gSpecialVar_0x8005 = GetNumberOfRelearnableMoves(&gPlayerParty[*slotPtr]);
|
||||||
Task_ClosePartyMenu(taskId);
|
Task_ClosePartyMenu(taskId);
|
||||||
break;
|
break;
|
||||||
case PARTY_ACTION_MINIGAME - 3:
|
case PARTY_ACTION_MINIGAME:
|
||||||
if (IsSelectedMonNotEgg((u8 *)slotPtr))
|
if (IsSelectedMonNotEgg((u8 *)slotPtr))
|
||||||
TryEnterMonForMinigame(taskId, (u8)*slotPtr);
|
TryEnterMonForMinigame(taskId, (u8)*slotPtr);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
case PARTY_ACTION_ABILITY_PREVENTS - 3:
|
case PARTY_ACTION_ABILITY_PREVENTS:
|
||||||
case PARTY_ACTION_SWITCHING - 3:
|
case PARTY_ACTION_SWITCHING:
|
||||||
PlaySE(SE_SELECT);
|
PlaySE(SE_SELECT);
|
||||||
Task_TryCreateSelectionWindow(taskId);
|
Task_TryCreateSelectionWindow(taskId);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -180,7 +180,9 @@ gUnknown_3005E90: @ 3005E90
|
|||||||
gUnknown_3005E94: @ 3005E94
|
gUnknown_3005E94: @ 3005E94
|
||||||
.space 0x4
|
.space 0x4
|
||||||
|
|
||||||
|
.align 2
|
||||||
.include "party_menu.o"
|
.include "party_menu.o"
|
||||||
|
.align 2
|
||||||
.include "help_system_812B1E0.o"
|
.include "help_system_812B1E0.o"
|
||||||
.align 4
|
.align 4
|
||||||
.include "fame_checker.o"
|
.include "fame_checker.o"
|
||||||
|
|||||||
Reference in New Issue
Block a user