mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 03:34:15 +01:00
Start remaining menu documentation
This commit is contained in:
parent
9a0618afc3
commit
085f8adec6
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
@ -3855,10 +3855,10 @@ extern const u32 gItemIcon_ReturnToFieldArrow[];
|
|||||||
extern const u32 gItemIconPalette_ReturnToFieldArrow[];
|
extern const u32 gItemIconPalette_ReturnToFieldArrow[];
|
||||||
|
|
||||||
//menu graphics
|
//menu graphics
|
||||||
extern const u16 gFireRedMenuElements1_Pal[16];
|
extern const u16 gMenuInfoElements1_Pal[16];
|
||||||
extern const u16 gFireRedMenuElements2_Pal[16];
|
extern const u16 gMenuInfoElements2_Pal[16];
|
||||||
extern const u16 gFireRedMenuElements3_Pal[16];
|
extern const u16 gMenuInfoElements3_Pal[16];
|
||||||
extern const u8 gFireRedMenuElements_Gfx[];
|
extern const u8 gMenuInfoElements_Gfx[];
|
||||||
|
|
||||||
// item menu graphics
|
// item menu graphics
|
||||||
extern const u32 gBagScreen_Gfx[];
|
extern const u32 gBagScreen_Gfx[];
|
||||||
|
@ -66,7 +66,7 @@ void SetWindowTemplateFields(struct WindowTemplate* template, u8 priority, u8 ti
|
|||||||
void DrawStdFrameWithCustomTileAndPalette(u8 windowId, bool8 copyToVram, u16 tileStart, u8 palette);
|
void DrawStdFrameWithCustomTileAndPalette(u8 windowId, bool8 copyToVram, u16 tileStart, u8 palette);
|
||||||
void ScheduleBgCopyTilemapToVram(u8 bgNum);
|
void ScheduleBgCopyTilemapToVram(u8 bgNum);
|
||||||
void PrintMenuTable(u8 windowId, u8 itemCount, const struct MenuAction *strs);
|
void PrintMenuTable(u8 windowId, u8 itemCount, const struct MenuAction *strs);
|
||||||
u8 InitMenuInUpperLeftCornerPlaySoundWhenAPressed(u8 windowId, u8 numItems, u8 initialCursorPos);
|
u8 InitMenuInUpperLeftCornerNormal(u8 windowId, u8 numItems, u8 initialCursorPos);
|
||||||
u8 Menu_GetCursorPos(void);
|
u8 Menu_GetCursorPos(void);
|
||||||
s8 Menu_ProcessInput(void);
|
s8 Menu_ProcessInput(void);
|
||||||
s8 Menu_ProcessInputNoWrap(void);
|
s8 Menu_ProcessInputNoWrap(void);
|
||||||
@ -85,7 +85,6 @@ void AddTextPrinterParameterized4(u8 windowId, u8 fontId, u8 x, u8 y, u8 letterS
|
|||||||
void DrawDialogFrameWithCustomTileAndPalette(u8 windowId, bool8 copyToVram, u16 a2, u8 a3);
|
void DrawDialogFrameWithCustomTileAndPalette(u8 windowId, bool8 copyToVram, u16 a2, u8 a3);
|
||||||
void sub_81995E4(u8 windowId, u8 optionsNo, const struct MenuAction *actions, const u8 *actionIds);
|
void sub_81995E4(u8 windowId, u8 optionsNo, const struct MenuAction *actions, const u8 *actionIds);
|
||||||
void ClearDialogWindowAndFrameToTransparent(u8 windowId, bool8 copyToVram);
|
void ClearDialogWindowAndFrameToTransparent(u8 windowId, bool8 copyToVram);
|
||||||
u16 sub_8198AA4(u8, u8, u8, u8, u8, u8, u16);
|
|
||||||
void *malloc_and_decompress(const void *src, u32 *sizeOut);
|
void *malloc_and_decompress(const void *src, u32 *sizeOut);
|
||||||
u16 copy_decompressed_tile_data_to_vram(u8 bgId, const void *src, u16 size, u16 offset, u8 mode);
|
u16 copy_decompressed_tile_data_to_vram(u8 bgId, const void *src, u16 size, u16 offset, u8 mode);
|
||||||
void AddTextPrinterForMessage(bool8 allowSkippingDelayWithButtonPress);
|
void AddTextPrinterForMessage(bool8 allowSkippingDelayWithButtonPress);
|
||||||
@ -98,8 +97,8 @@ void ListMenuLoadStdPalAt(u8, u8);
|
|||||||
u8 Menu_MoveCursor(s8 cursorDelta);
|
u8 Menu_MoveCursor(s8 cursorDelta);
|
||||||
u8 Menu_MoveCursorNoWrapAround(s8 cursorDelta);
|
u8 Menu_MoveCursorNoWrapAround(s8 cursorDelta);
|
||||||
void DrawStdWindowFrame(u8 windowId, bool8 CopyToVram);
|
void DrawStdWindowFrame(u8 windowId, bool8 CopyToVram);
|
||||||
u8 sub_81979C4(u8 a1);
|
u8 AddStartMenuWindow(u8 numActions);
|
||||||
u8 sub_81983AC(u8 windowId, u8 fontId, u8 left, u8 top, u8 cursorHeight, u8 numChoices, u8 initialCursorPos);
|
u8 InitMenuNormal(u8 windowId, u8 fontId, u8 left, u8 top, u8 cursorHeight, u8 numChoices, u8 initialCursorPos);
|
||||||
void sub_819786C(u8 windowId, bool8 copyToVram);
|
void sub_819786C(u8 windowId, bool8 copyToVram);
|
||||||
void AddTextPrinterForMessage_2(bool8 allowSkippingDelayWithButtonPress);
|
void AddTextPrinterForMessage_2(bool8 allowSkippingDelayWithButtonPress);
|
||||||
void RemoveStartMenuWindow(void);
|
void RemoveStartMenuWindow(void);
|
||||||
@ -111,20 +110,20 @@ u8 AddMapNamePopUpWindow(void);
|
|||||||
void AddTextPrinterParameterized5(u8 windowId, u8 fontId, const u8 *str, u8 left, u8 top, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16), u8 letterSpacing, u8 lineSpacing);
|
void AddTextPrinterParameterized5(u8 windowId, u8 fontId, const u8 *str, u8 left, u8 top, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16), u8 letterSpacing, u8 lineSpacing);
|
||||||
void SetBgTilemapPalette(u8 bgId, u8 left, u8 top, u8 width, u8 height, u8 palette);
|
void SetBgTilemapPalette(u8 bgId, u8 left, u8 top, u8 width, u8 height, u8 palette);
|
||||||
void sub_8199D3C(void *ptr, int delta, int width, int height, bool32 is8BPP);
|
void sub_8199D3C(void *ptr, int delta, int width, int height, bool32 is8BPP);
|
||||||
void sub_8198204(const u8 *string, const u8 *string2, u8 a3, u8 a4, bool8 copyToVram);
|
void EraseFieldMessageBox(bool8 copyToVram);
|
||||||
void sub_8197AE8(bool8 copyToVram);
|
|
||||||
void PrintMenuGridTable(u8 windowId, u8 optionWidth, u8 columns, u8 rows, const struct MenuAction *strs);
|
void PrintMenuGridTable(u8 windowId, u8 optionWidth, u8 columns, u8 rows, const struct MenuAction *strs);
|
||||||
s8 Menu_ProcessInputGridLayout(void);
|
s8 Menu_ProcessInputGridLayout(void);
|
||||||
u8 InitMenuInUpperLeftCorner(u8 windowId, u8 itemCount, u8 initialCursorPos, bool8 APressMuted);
|
u8 InitMenuInUpperLeftCorner(u8 windowId, u8 itemCount, u8 initialCursorPos, bool8 APressMuted);
|
||||||
s8 Menu_ProcessInputNoWrapAround_other(void);
|
s8 Menu_ProcessInputNoWrapAround_other(void);
|
||||||
void CopyToBufferFromBgTilemap(u8 bgId, u16 *dest, u8 left, u8 top, u8 width, u8 height);
|
void CopyToBufferFromBgTilemap(u8 bgId, u16 *dest, u8 left, u8 top, u8 width, u8 height);
|
||||||
u8 sub_81980F0(u8 bg, u8 xPos, u8 yPos, u8 palette, u16 baseTile);
|
u8 HofPCTopBar_AddWindow(u8 bg, u8 xPos, u8 yPos, u8 palette, u16 baseTile);
|
||||||
void sub_8198314(void);
|
void HofPCTopBar_RemoveWindow(void);
|
||||||
void sub_8198180(const u8 *string, u8 a2, bool8 copyToVram);
|
void HofPCTopBar_Print(const u8 *string, u8 left, bool8 copyToVram);
|
||||||
|
void HofPCTopBar_PrintPair(const u8 *string, const u8 *string2, bool8 noBg, u8 left, bool8 copyToVram);
|
||||||
void ResetBgPositions(void);
|
void ResetBgPositions(void);
|
||||||
void AddTextPrinterWithCustomSpeedForMessage(bool8 allowSkippingDelayWithButtonPress, u8 speed);
|
void AddTextPrinterWithCustomSpeedForMessage(bool8 allowSkippingDelayWithButtonPress, u8 speed);
|
||||||
void EraseYesNoWindow(void);
|
void EraseYesNoWindow(void);
|
||||||
void PrintTextArray(u8 windowId, u8 fontId, u8 left, u8 top, u8 lineHeight, u8 itemCount, const struct MenuAction *strs);
|
void PrintMenuActionTextsAtPos(u8 windowId, u8 fontId, u8 left, u8 top, u8 lineHeight, u8 itemCount, const struct MenuAction *strs);
|
||||||
void Menu_LoadStdPal(void);
|
void Menu_LoadStdPal(void);
|
||||||
|
|
||||||
#endif // GUARD_MENU_H
|
#endif // GUARD_MENU_H
|
||||||
|
@ -645,7 +645,7 @@ static void CreateApprenticeMenu(u8 menu)
|
|||||||
for (i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
AddTextPrinterParameterized(windowId, FONT_NORMAL, strings[i], 8, (i * 16) + 1, TEXT_SPEED_FF, NULL);
|
AddTextPrinterParameterized(windowId, FONT_NORMAL, strings[i], 8, (i * 16) + 1, TEXT_SPEED_FF, NULL);
|
||||||
|
|
||||||
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(windowId, count, 0);
|
InitMenuInUpperLeftCornerNormal(windowId, count, 0);
|
||||||
CreateChooseAnswerTask(TRUE, count, windowId);
|
CreateChooseAnswerTask(TRUE, count, windowId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -979,7 +979,7 @@ static void OpenContextMenu(u8 taskId)
|
|||||||
static void PrintMenuActionText_SingleRow(u8 windowId)
|
static void PrintMenuActionText_SingleRow(u8 windowId)
|
||||||
{
|
{
|
||||||
AddItemMenuActionTextPrinters(windowId, FONT_NARROW, 8, 1, 0, 0x10, gPyramidBagMenu->menuActionsCount, sMenuActions, gPyramidBagMenu->menuActionIds);
|
AddItemMenuActionTextPrinters(windowId, FONT_NARROW, 8, 1, 0, 0x10, gPyramidBagMenu->menuActionsCount, sMenuActions, gPyramidBagMenu->menuActionIds);
|
||||||
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(windowId, gPyramidBagMenu->menuActionsCount, 0);
|
InitMenuInUpperLeftCornerNormal(windowId, gPyramidBagMenu->menuActionsCount, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void PrintMenuActionText_MultiRow(u8 windowId, u8 horizontalCount, u8 verticalCount)
|
static void PrintMenuActionText_MultiRow(u8 windowId, u8 horizontalCount, u8 verticalCount)
|
||||||
|
@ -1078,7 +1078,7 @@ static void Task_EnterCableClubSeat(u8 taskId)
|
|||||||
case 3:
|
case 3:
|
||||||
// Exit, failure
|
// Exit, failure
|
||||||
SetLinkWaitingForScript();
|
SetLinkWaitingForScript();
|
||||||
sub_8197AE8(TRUE);
|
EraseFieldMessageBox(TRUE);
|
||||||
DestroyTask(taskId);
|
DestroyTask(taskId);
|
||||||
EnableBothScriptContexts();
|
EnableBothScriptContexts();
|
||||||
break;
|
break;
|
||||||
|
@ -557,7 +557,7 @@ static void AddDecorationActionsWindow(void)
|
|||||||
{
|
{
|
||||||
u8 windowId = AddDecorationWindow(WINDOW_MAIN_MENU);
|
u8 windowId = AddDecorationWindow(WINDOW_MAIN_MENU);
|
||||||
PrintMenuTable(windowId, ARRAY_COUNT(sDecorationMainMenuActions), sDecorationMainMenuActions);
|
PrintMenuTable(windowId, ARRAY_COUNT(sDecorationMainMenuActions), sDecorationMainMenuActions);
|
||||||
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(windowId, ARRAY_COUNT(sDecorationMainMenuActions), sDecorationActionsCursorPos);
|
InitMenuInUpperLeftCornerNormal(windowId, ARRAY_COUNT(sDecorationMainMenuActions), sDecorationActionsCursorPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void InitDecorationActionsWindow(void)
|
static void InitDecorationActionsWindow(void)
|
||||||
@ -697,7 +697,7 @@ static void InitDecorationCategoriesWindow(u8 taskId)
|
|||||||
{
|
{
|
||||||
u8 windowId = AddDecorationWindow(WINDOW_DECORATION_CATEGORIES);
|
u8 windowId = AddDecorationWindow(WINDOW_DECORATION_CATEGORIES);
|
||||||
PrintDecorationCategoryMenuItems(taskId);
|
PrintDecorationCategoryMenuItems(taskId);
|
||||||
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(windowId, DECORCAT_COUNT + 1, sCurDecorationCategory);
|
InitMenuInUpperLeftCornerNormal(windowId, DECORCAT_COUNT + 1, sCurDecorationCategory);
|
||||||
gTasks[taskId].func = HandleDecorationCategoriesMenuInput;
|
gTasks[taskId].func = HandleDecorationCategoriesMenuInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -705,7 +705,7 @@ static void ReinitDecorationCategoriesWindow(u8 taskId)
|
|||||||
{
|
{
|
||||||
FillWindowPixelBuffer(sDecorMenuWindowIds[WINDOW_DECORATION_CATEGORIES], PIXEL_FILL(1));
|
FillWindowPixelBuffer(sDecorMenuWindowIds[WINDOW_DECORATION_CATEGORIES], PIXEL_FILL(1));
|
||||||
PrintDecorationCategoryMenuItems(taskId);
|
PrintDecorationCategoryMenuItems(taskId);
|
||||||
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(sDecorMenuWindowIds[WINDOW_DECORATION_CATEGORIES], DECORCAT_COUNT + 1, sCurDecorationCategory);
|
InitMenuInUpperLeftCornerNormal(sDecorMenuWindowIds[WINDOW_DECORATION_CATEGORIES], DECORCAT_COUNT + 1, sCurDecorationCategory);
|
||||||
gTasks[taskId].func = HandleDecorationCategoriesMenuInput;
|
gTasks[taskId].func = HandleDecorationCategoriesMenuInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1272,10 +1272,10 @@ const u32 gPokedexAreaScreenAreaUnknown_Gfx[] = INCBIN_U32("graphics/pokedex/are
|
|||||||
|
|
||||||
// seems to be fire red leftovers, but the menu elements is reused in the item menu for TM descriptions.
|
// seems to be fire red leftovers, but the menu elements is reused in the item menu for TM descriptions.
|
||||||
|
|
||||||
const u16 gFireRedMenuElements1_Pal[] = INCBIN_U16("graphics/interface_fr/menu1.gbapal");
|
const u16 gMenuInfoElements1_Pal[] = INCBIN_U16("graphics/interface/menu_info1.gbapal");
|
||||||
const u16 gFireRedMenuElements2_Pal[] = INCBIN_U16("graphics/interface_fr/menu2.gbapal");
|
const u16 gMenuInfoElements2_Pal[] = INCBIN_U16("graphics/interface/menu_info2.gbapal");
|
||||||
const u16 gFireRedMenuElements3_Pal[] = INCBIN_U16("graphics/interface_fr/menu3.gbapal");
|
const u16 gMenuInfoElements3_Pal[] = INCBIN_U16("graphics/interface/menu_info3.gbapal");
|
||||||
const u8 gFireRedMenuElements_Gfx[] = INCBIN_U8("graphics/interface_fr/menu.4bpp"); //the types are reused for item menu
|
const u8 gMenuInfoElements_Gfx[] = INCBIN_U8("graphics/interface/menu_info.4bpp"); //the types are reused for item menu
|
||||||
|
|
||||||
const u8 gBagMenuHMIcon_Gfx[] = INCBIN_U8("graphics/interface/hm.4bpp");
|
const u8 gBagMenuHMIcon_Gfx[] = INCBIN_U8("graphics/interface/hm.4bpp");
|
||||||
|
|
||||||
|
@ -343,7 +343,6 @@ static const struct HallofFameMon sDummyFameMon =
|
|||||||
static const u8 sHallOfFame_SlotOrder[] = {
|
static const u8 sHallOfFame_SlotOrder[] = {
|
||||||
2, 1, 3,
|
2, 1, 3,
|
||||||
6, 4, 5,
|
6, 4, 5,
|
||||||
0, 0
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// code
|
// code
|
||||||
@ -862,7 +861,7 @@ void CB2_DoHallOfFamePC(void)
|
|||||||
|
|
||||||
static void Task_HofPC_CopySaveData(u8 taskId)
|
static void Task_HofPC_CopySaveData(u8 taskId)
|
||||||
{
|
{
|
||||||
sub_81980F0(0, 0x1E, 0, 0xC, 0x226);
|
HofPCTopBar_AddWindow(0, 30, 0, 12, 0x226);
|
||||||
if (Save_LoadGameData(SAVE_HALL_OF_FAME) != SAVE_STATUS_OK)
|
if (Save_LoadGameData(SAVE_HALL_OF_FAME) != SAVE_STATUS_OK)
|
||||||
{
|
{
|
||||||
gTasks[taskId].func = Task_HofPC_PrintDataIsCorrupted;
|
gTasks[taskId].func = Task_HofPC_PrintDataIsCorrupted;
|
||||||
@ -950,9 +949,9 @@ static void Task_HofPC_DrawSpritesPrintText(u8 taskId)
|
|||||||
StringExpandPlaceholders(gStringVar4, gText_HOFNumber);
|
StringExpandPlaceholders(gStringVar4, gText_HOFNumber);
|
||||||
|
|
||||||
if (gTasks[taskId].tCurrTeamNo <= 0)
|
if (gTasks[taskId].tCurrTeamNo <= 0)
|
||||||
sub_8198204(gStringVar4, gText_PickCancel, 0, 0, TRUE);
|
HofPCTopBar_PrintPair(gStringVar4, gText_PickCancel, FALSE, 0, TRUE);
|
||||||
else
|
else
|
||||||
sub_8198204(gStringVar4, gText_PickNextCancel, 0, 0, TRUE);
|
HofPCTopBar_PrintPair(gStringVar4, gText_PickNextCancel, FALSE, 0, TRUE);
|
||||||
|
|
||||||
gTasks[taskId].func = Task_HofPC_PrintMonInfo;
|
gTasks[taskId].func = Task_HofPC_PrintMonInfo;
|
||||||
}
|
}
|
||||||
@ -1073,7 +1072,7 @@ static void Task_HofPC_HandleExit(u8 taskId)
|
|||||||
HideBg(0);
|
HideBg(0);
|
||||||
HideBg(1);
|
HideBg(1);
|
||||||
HideBg(3);
|
HideBg(3);
|
||||||
sub_8198314();
|
HofPCTopBar_RemoveWindow();
|
||||||
FreeAllWindowBuffers();
|
FreeAllWindowBuffers();
|
||||||
UnsetBgTilemapBuffer(1);
|
UnsetBgTilemapBuffer(1);
|
||||||
UnsetBgTilemapBuffer(3);
|
UnsetBgTilemapBuffer(3);
|
||||||
@ -1091,7 +1090,7 @@ static void Task_HofPC_HandleExit(u8 taskId)
|
|||||||
|
|
||||||
static void Task_HofPC_PrintDataIsCorrupted(u8 taskId)
|
static void Task_HofPC_PrintDataIsCorrupted(u8 taskId)
|
||||||
{
|
{
|
||||||
sub_8198180(gText_AButtonExit, 8, TRUE);
|
HofPCTopBar_Print(gText_AButtonExit, 8, TRUE);
|
||||||
DrawDialogueFrame(0, 0);
|
DrawDialogueFrame(0, 0);
|
||||||
AddTextPrinterParameterized2(0, FONT_NORMAL, gText_HOFCorrupted, 0, NULL, 2, 1, 3);
|
AddTextPrinterParameterized2(0, FONT_NORMAL, gText_HOFCorrupted, 0, NULL, 2, 1, 3);
|
||||||
CopyWindowToVram(0, COPYWIN_FULL);
|
CopyWindowToVram(0, COPYWIN_FULL);
|
||||||
|
@ -1668,7 +1668,7 @@ static void OpenContextMenu(u8 taskId)
|
|||||||
static void PrintContextMenuItems(u8 windowId)
|
static void PrintContextMenuItems(u8 windowId)
|
||||||
{
|
{
|
||||||
AddItemMenuActionTextPrinters(windowId, FONT_NARROW, 8, 1, 0, 16, gBagMenu->contextMenuNumItems, sItemMenuActions, gBagMenu->contextMenuItemsPtr);
|
AddItemMenuActionTextPrinters(windowId, FONT_NARROW, 8, 1, 0, 16, gBagMenu->contextMenuNumItems, sItemMenuActions, gBagMenu->contextMenuItemsPtr);
|
||||||
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(windowId, gBagMenu->contextMenuNumItems, 0);
|
InitMenuInUpperLeftCornerNormal(windowId, gBagMenu->contextMenuNumItems, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void PrintContextMenuItemGrid(u8 windowId, u8 columns, u8 rows)
|
static void PrintContextMenuItemGrid(u8 windowId, u8 columns, u8 rows)
|
||||||
|
@ -2090,7 +2090,7 @@ static void NewGameBirchSpeech_ShowGenderMenu(void)
|
|||||||
DrawMainMenuWindowBorder(&gNewGameBirchSpeechTextWindows[1], 0xF3);
|
DrawMainMenuWindowBorder(&gNewGameBirchSpeechTextWindows[1], 0xF3);
|
||||||
FillWindowPixelBuffer(1, PIXEL_FILL(1));
|
FillWindowPixelBuffer(1, PIXEL_FILL(1));
|
||||||
PrintMenuTable(1, ARRAY_COUNT(sMenuActions_Gender), sMenuActions_Gender);
|
PrintMenuTable(1, ARRAY_COUNT(sMenuActions_Gender), sMenuActions_Gender);
|
||||||
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(1, 2, 0);
|
InitMenuInUpperLeftCornerNormal(1, 2, 0);
|
||||||
PutWindowTilemap(1);
|
PutWindowTilemap(1);
|
||||||
CopyWindowToVram(1, COPYWIN_FULL);
|
CopyWindowToVram(1, COPYWIN_FULL);
|
||||||
}
|
}
|
||||||
|
@ -1346,7 +1346,7 @@ static void PrintStoryList(void)
|
|||||||
AddTextPrinterParameterized(sStorytellerWindowId, FONT_NORMAL, GetStoryTitleByStat(gameStatID), 8, 16 * i + 1, 0xFF, NULL);
|
AddTextPrinterParameterized(sStorytellerWindowId, FONT_NORMAL, GetStoryTitleByStat(gameStatID), 8, 16 * i + 1, 0xFF, NULL);
|
||||||
}
|
}
|
||||||
AddTextPrinterParameterized(sStorytellerWindowId, FONT_NORMAL, gText_Exit, 8, 16 * i + 1, 0xFF, NULL);
|
AddTextPrinterParameterized(sStorytellerWindowId, FONT_NORMAL, gText_Exit, 8, 16 * i + 1, 0xFF, NULL);
|
||||||
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(sStorytellerWindowId, GetFreeStorySlot() + 1, 0);
|
InitMenuInUpperLeftCornerNormal(sStorytellerWindowId, GetFreeStorySlot() + 1, 0);
|
||||||
CopyWindowToVram(sStorytellerWindowId, COPYWIN_FULL);
|
CopyWindowToVram(sStorytellerWindowId, COPYWIN_FULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
214
src/menu.c
214
src/menu.c
@ -48,13 +48,24 @@ struct Menu
|
|||||||
bool8 APressMuted;
|
bool8 APressMuted;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static u16 AddWindowParameterized(u8, u8, u8, u8, u8, u8, u16);
|
||||||
|
static void WindowFunc_DrawStandardFrame(u8, u8, u8, u8, u8, u8);
|
||||||
|
static void WindowFunc_DrawDialogueFrame(u8, u8, u8, u8, u8, u8);
|
||||||
|
static void WindowFunc_ClearStdWindowAndFrame(u8, u8, u8, u8, u8, u8);
|
||||||
|
static void WindowFunc_ClearDialogWindowAndFrame(u8, u8, u8, u8, u8, u8);
|
||||||
|
static void WindowFunc_DrawDialogFrameWithCustomTileAndPalette(u8, u8, u8, u8, u8, u8);
|
||||||
|
static void WindowFunc_ClearDialogWindowAndFrameNullPalette(u8, u8, u8, u8, u8, u8);
|
||||||
|
static void WindowFunc_DrawStdFrameWithCustomTileAndPalette(u8, u8, u8, u8, u8, u8);
|
||||||
|
static void WindowFunc_ClearStdWindowAndFrameToTransparent(u8, u8, u8, u8, u8, u8);
|
||||||
|
static void task_free_buf_after_copying_tile_data_to_vram(u8 taskId);
|
||||||
|
|
||||||
static EWRAM_DATA u8 sStartMenuWindowId = 0;
|
static EWRAM_DATA u8 sStartMenuWindowId = 0;
|
||||||
static EWRAM_DATA u8 sMapNamePopupWindowId = 0;
|
static EWRAM_DATA u8 sMapNamePopupWindowId = 0;
|
||||||
static EWRAM_DATA struct Menu sMenu = {0};
|
static EWRAM_DATA struct Menu sMenu = {0};
|
||||||
static EWRAM_DATA u16 sTileNum = 0;
|
static EWRAM_DATA u16 sTileNum = 0;
|
||||||
static EWRAM_DATA u8 sPaletteNum = 0;
|
static EWRAM_DATA u8 sPaletteNum = 0;
|
||||||
static EWRAM_DATA u8 sYesNoWindowId = 0;
|
static EWRAM_DATA u8 sYesNoWindowId = 0;
|
||||||
static EWRAM_DATA u8 sWindowId = 0;
|
static EWRAM_DATA u8 sHofPCTopBarWindowId = 0;
|
||||||
static EWRAM_DATA u16 sFiller = 0; // needed to align
|
static EWRAM_DATA u16 sFiller = 0; // needed to align
|
||||||
static EWRAM_DATA bool8 sScheduledBgCopiesToVram[4] = {FALSE};
|
static EWRAM_DATA bool8 sScheduledBgCopiesToVram[4] = {FALSE};
|
||||||
static EWRAM_DATA u16 sTempTileDataBufferIdx = 0;
|
static EWRAM_DATA u16 sTempTileDataBufferIdx = 0;
|
||||||
@ -94,10 +105,10 @@ static const struct WindowTemplate sYesNo_WindowTemplates =
|
|||||||
.baseBlock = 0x125
|
.baseBlock = 0x125
|
||||||
};
|
};
|
||||||
|
|
||||||
const u16 gUnknown_0860F0B0[] = INCBIN_U16("graphics/interface/860F0B0.gbapal");
|
static const u16 sHofPC_TopBar_Pal[] = INCBIN_U16("graphics/interface/hof_pc_topbar.gbapal");
|
||||||
const u8 sTextColors[] = { TEXT_DYNAMIC_COLOR_6, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY };
|
static const u8 sTextColors[] = { TEXT_DYNAMIC_COLOR_6, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY };
|
||||||
|
|
||||||
// Table of move info icon offsets in graphics/interface_fr/menu.png
|
// Table of move info icon offsets in graphics/interface/menu_info.png
|
||||||
static const struct MenuInfoIcon sMenuInfoIcons[] =
|
static const struct MenuInfoIcon sMenuInfoIcons[] =
|
||||||
{ // { width, height, offset }
|
{ // { width, height, offset }
|
||||||
{ 12, 12, 0x00 }, // Unused
|
{ 12, 12, 0x00 }, // Unused
|
||||||
@ -128,18 +139,6 @@ static const struct MenuInfoIcon sMenuInfoIcons[] =
|
|||||||
[MENU_INFO_ICON_BALL_BLUE] = { 8, 8, 0xAF }, // For placed decorations in player's room
|
[MENU_INFO_ICON_BALL_BLUE] = { 8, 8, 0xAF }, // For placed decorations in player's room
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Forward declarations
|
|
||||||
void WindowFunc_DrawStandardFrame(u8, u8, u8, u8, u8, u8);
|
|
||||||
void WindowFunc_DrawDialogueFrame(u8, u8, u8, u8, u8, u8);
|
|
||||||
void WindowFunc_ClearStdWindowAndFrame(u8, u8, u8, u8, u8, u8);
|
|
||||||
void WindowFunc_ClearDialogWindowAndFrame(u8, u8, u8, u8, u8, u8);
|
|
||||||
void WindowFunc_DrawDialogFrameWithCustomTileAndPalette(u8, u8, u8, u8, u8, u8);
|
|
||||||
void WindowFunc_ClearDialogWindowAndFrameNullPalette(u8, u8, u8, u8, u8, u8);
|
|
||||||
void WindowFunc_DrawStdFrameWithCustomTileAndPalette(u8, u8, u8, u8, u8, u8);
|
|
||||||
void WindowFunc_ClearStdWindowAndFrameToTransparent(u8, u8, u8, u8, u8, u8);
|
|
||||||
void task_free_buf_after_copying_tile_data_to_vram(u8 taskId);
|
|
||||||
|
|
||||||
void InitStandardTextBoxWindows(void)
|
void InitStandardTextBoxWindows(void)
|
||||||
{
|
{
|
||||||
InitWindows(sStandardTextBox_WindowTemplates);
|
InitWindows(sStandardTextBox_WindowTemplates);
|
||||||
@ -249,7 +248,7 @@ void ClearStdWindowAndFrame(u8 windowId, bool8 copyToVram)
|
|||||||
CopyWindowToVram(windowId, COPYWIN_FULL);
|
CopyWindowToVram(windowId, COPYWIN_FULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindowFunc_DrawStandardFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum)
|
static void WindowFunc_DrawStandardFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -316,7 +315,7 @@ void WindowFunc_DrawStandardFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width
|
|||||||
STD_WINDOW_PALETTE_NUM);
|
STD_WINDOW_PALETTE_NUM);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindowFunc_DrawDialogueFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum)
|
static void WindowFunc_DrawDialogueFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum)
|
||||||
{
|
{
|
||||||
FillBgTilemapBufferRect(bg,
|
FillBgTilemapBufferRect(bg,
|
||||||
DLG_WINDOW_BASE_TILE_NUM + 1,
|
DLG_WINDOW_BASE_TILE_NUM + 1,
|
||||||
@ -411,12 +410,12 @@ void WindowFunc_DrawDialogueFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width
|
|||||||
DLG_WINDOW_PALETTE_NUM);
|
DLG_WINDOW_PALETTE_NUM);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindowFunc_ClearStdWindowAndFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum)
|
static void WindowFunc_ClearStdWindowAndFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum)
|
||||||
{
|
{
|
||||||
FillBgTilemapBufferRect(bg, 0, tilemapLeft - 1, tilemapTop - 1, width + 2, height + 2, STD_WINDOW_PALETTE_NUM);
|
FillBgTilemapBufferRect(bg, 0, tilemapLeft - 1, tilemapTop - 1, width + 2, height + 2, STD_WINDOW_PALETTE_NUM);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindowFunc_ClearDialogWindowAndFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum)
|
static void WindowFunc_ClearDialogWindowAndFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum)
|
||||||
{
|
{
|
||||||
FillBgTilemapBufferRect(bg, 0, tilemapLeft - 3, tilemapTop - 1, width + 6, height + 2, STD_WINDOW_PALETTE_NUM);
|
FillBgTilemapBufferRect(bg, 0, tilemapLeft - 3, tilemapTop - 1, width + 6, height + 2, STD_WINDOW_PALETTE_NUM);
|
||||||
}
|
}
|
||||||
@ -489,10 +488,10 @@ u8 GetPlayerTextSpeedDelay(void)
|
|||||||
return sTextSpeedFrameDelays[speed];
|
return sTextSpeedFrameDelays[speed];
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 sub_81979C4(u8 a1)
|
u8 AddStartMenuWindow(u8 numActions)
|
||||||
{
|
{
|
||||||
if (sStartMenuWindowId == WINDOW_NONE)
|
if (sStartMenuWindowId == WINDOW_NONE)
|
||||||
sStartMenuWindowId = sub_8198AA4(0, 0x16, 1, 7, (a1 * 2) + 2, 0xF, 0x139);
|
sStartMenuWindowId = AddWindowParameterized(0, 22, 1, 7, (numActions * 2) + 2, 15, 0x139);
|
||||||
return sStartMenuWindowId;
|
return sStartMenuWindowId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -525,7 +524,7 @@ static u16 GetStandardFrameBaseTileNum(void)
|
|||||||
u8 AddMapNamePopUpWindow(void)
|
u8 AddMapNamePopUpWindow(void)
|
||||||
{
|
{
|
||||||
if (sMapNamePopupWindowId == WINDOW_NONE)
|
if (sMapNamePopupWindowId == WINDOW_NONE)
|
||||||
sMapNamePopupWindowId = sub_8198AA4(0, 1, 1, 10, 3, 14, 0x107);
|
sMapNamePopupWindowId = AddWindowParameterized(0, 1, 1, 10, 3, 14, 0x107);
|
||||||
return sMapNamePopupWindowId;
|
return sMapNamePopupWindowId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -549,7 +548,7 @@ void AddTextPrinterWithCallbackForMessage(bool8 a1, void (*callback)(struct Text
|
|||||||
AddTextPrinterParameterized2(0, FONT_NORMAL, gStringVar4, GetPlayerTextSpeedDelay(), callback, 2, 1, 3);
|
AddTextPrinterParameterized2(0, FONT_NORMAL, gStringVar4, GetPlayerTextSpeedDelay(), callback, 2, 1, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_8197AE8(bool8 copyToVram)
|
void EraseFieldMessageBox(bool8 copyToVram)
|
||||||
{
|
{
|
||||||
FillBgTilemapBufferRect(0, 0, 0, 0, 32, 32, 0x11);
|
FillBgTilemapBufferRect(0, 0, 0, 0, 32, 32, 0x11);
|
||||||
if (copyToVram == TRUE)
|
if (copyToVram == TRUE)
|
||||||
@ -568,7 +567,7 @@ void DrawDialogFrameWithCustomTileAndPalette(u8 windowId, bool8 copyToVram, u16
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Never used.
|
// Never used.
|
||||||
void DrawDialogFrameWithCustomTile(u8 windowId, bool8 copyToVram, u16 tileNum)
|
static void DrawDialogFrameWithCustomTile(u8 windowId, bool8 copyToVram, u16 tileNum)
|
||||||
{
|
{
|
||||||
sTileNum = tileNum;
|
sTileNum = tileNum;
|
||||||
sPaletteNum = GetWindowAttribute(windowId, WINDOW_PALETTE_NUM);
|
sPaletteNum = GetWindowAttribute(windowId, WINDOW_PALETTE_NUM);
|
||||||
@ -579,7 +578,7 @@ void DrawDialogFrameWithCustomTile(u8 windowId, bool8 copyToVram, u16 tileNum)
|
|||||||
CopyWindowToVram(windowId, COPYWIN_FULL);
|
CopyWindowToVram(windowId, COPYWIN_FULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindowFunc_DrawDialogFrameWithCustomTileAndPalette(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum)
|
static void WindowFunc_DrawDialogFrameWithCustomTileAndPalette(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum)
|
||||||
{
|
{
|
||||||
FillBgTilemapBufferRect(bg,
|
FillBgTilemapBufferRect(bg,
|
||||||
sTileNum + 1,
|
sTileNum + 1,
|
||||||
@ -684,7 +683,7 @@ void ClearDialogWindowAndFrameToTransparent(u8 windowId, bool8 copyToVram)
|
|||||||
CopyWindowToVram(windowId, COPYWIN_FULL);
|
CopyWindowToVram(windowId, COPYWIN_FULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindowFunc_ClearDialogWindowAndFrameNullPalette(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum)
|
static void WindowFunc_ClearDialogWindowAndFrameNullPalette(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum)
|
||||||
{
|
{
|
||||||
FillBgTilemapBufferRect(bg, 0, tilemapLeft - 3, tilemapTop - 1, width + 6, height + 2, 0);
|
FillBgTilemapBufferRect(bg, 0, tilemapLeft - 3, tilemapTop - 1, width + 6, height + 2, 0);
|
||||||
}
|
}
|
||||||
@ -712,7 +711,7 @@ void DrawStdFrameWithCustomTile(u8 windowId, bool8 copyToVram, u16 baseTileNum)
|
|||||||
CopyWindowToVram(windowId, COPYWIN_FULL);
|
CopyWindowToVram(windowId, COPYWIN_FULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindowFunc_DrawStdFrameWithCustomTileAndPalette(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum)
|
static void WindowFunc_DrawStdFrameWithCustomTileAndPalette(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum)
|
||||||
{
|
{
|
||||||
FillBgTilemapBufferRect(bg,
|
FillBgTilemapBufferRect(bg,
|
||||||
sTileNum + 0,
|
sTileNum + 0,
|
||||||
@ -781,12 +780,13 @@ void ClearStdWindowAndFrameToTransparent(u8 windowId, bool8 copyToVram)
|
|||||||
CopyWindowToVram(windowId, COPYWIN_FULL);
|
CopyWindowToVram(windowId, COPYWIN_FULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindowFunc_ClearStdWindowAndFrameToTransparent(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum)
|
static void WindowFunc_ClearStdWindowAndFrameToTransparent(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum)
|
||||||
{
|
{
|
||||||
FillBgTilemapBufferRect(bg, 0, tilemapLeft - 1, tilemapTop - 1, width + 2, height + 2, 0);
|
FillBgTilemapBufferRect(bg, 0, tilemapLeft - 1, tilemapTop - 1, width + 2, height + 2, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 sub_81980F0(u8 bg, u8 xPos, u8 yPos, u8 palette, u16 baseTile)
|
// Creates the window used to display the info bar at the top of the HOF PC that shows the controls and team number.
|
||||||
|
u8 HofPCTopBar_AddWindow(u8 bg, u8 xPos, u8 yPos, u8 palette, u16 baseTile)
|
||||||
{
|
{
|
||||||
struct WindowTemplate window;
|
struct WindowTemplate window;
|
||||||
memset(&window, 0, sizeof(window));
|
memset(&window, 0, sizeof(window));
|
||||||
@ -798,51 +798,54 @@ u8 sub_81980F0(u8 bg, u8 xPos, u8 yPos, u8 palette, u16 baseTile)
|
|||||||
|
|
||||||
window.tilemapTop = yPos;
|
window.tilemapTop = yPos;
|
||||||
window.height = 2;
|
window.height = 2;
|
||||||
window.tilemapLeft = 0x1E - xPos;
|
window.tilemapLeft = 30 - xPos;
|
||||||
window.width = xPos;
|
window.width = xPos;
|
||||||
window.paletteNum = palette;
|
window.paletteNum = palette;
|
||||||
window.baseBlock = baseTile;
|
window.baseBlock = baseTile;
|
||||||
|
|
||||||
sWindowId = AddWindow(&window);
|
sHofPCTopBarWindowId = AddWindow(&window);
|
||||||
|
|
||||||
if (palette > 15)
|
if (palette > 15)
|
||||||
palette = 15 * 16;
|
palette = 15 * 16;
|
||||||
else
|
else
|
||||||
palette *= 16;
|
palette *= 16;
|
||||||
|
|
||||||
LoadPalette(gUnknown_0860F0B0, palette, sizeof(gUnknown_0860F0B0));
|
LoadPalette(sHofPC_TopBar_Pal, palette, sizeof(sHofPC_TopBar_Pal));
|
||||||
return sWindowId;
|
return sHofPCTopBarWindowId;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_8198180(const u8 *string, u8 a2, bool8 copyToVram)
|
// All the below functions checking WINDOW_NONE only handle failure of AddWindow in the above function.
|
||||||
|
// Because sHofPCTopBarWindowId is not initialized to WINDOW_NONE anywhere it does not handle
|
||||||
|
// the window not having been drawn yet.
|
||||||
|
void HofPCTopBar_Print(const u8 *string, u8 left, bool8 copyToVram)
|
||||||
{
|
{
|
||||||
u16 width = 0;
|
u16 width = 0;
|
||||||
|
|
||||||
if (sWindowId != WINDOW_NONE)
|
if (sHofPCTopBarWindowId != WINDOW_NONE)
|
||||||
{
|
{
|
||||||
PutWindowTilemap(sWindowId);
|
PutWindowTilemap(sHofPCTopBarWindowId);
|
||||||
FillWindowPixelBuffer(sWindowId, PIXEL_FILL(15));
|
FillWindowPixelBuffer(sHofPCTopBarWindowId, PIXEL_FILL(15));
|
||||||
width = GetStringWidth(FONT_SMALL, string, 0);
|
width = GetStringWidth(FONT_SMALL, string, 0);
|
||||||
AddTextPrinterParameterized3(sWindowId,
|
AddTextPrinterParameterized3(sHofPCTopBarWindowId,
|
||||||
FONT_SMALL,
|
FONT_SMALL,
|
||||||
0xEC - (GetWindowAttribute(sWindowId, WINDOW_TILEMAP_LEFT) * 8) - a2 - width,
|
236 - (GetWindowAttribute(sHofPCTopBarWindowId, WINDOW_TILEMAP_LEFT) * 8) - left - width,
|
||||||
1,
|
1,
|
||||||
sTextColors,
|
sTextColors,
|
||||||
0,
|
0,
|
||||||
string);
|
string);
|
||||||
if (copyToVram)
|
if (copyToVram)
|
||||||
CopyWindowToVram(sWindowId, COPYWIN_FULL);
|
CopyWindowToVram(sHofPCTopBarWindowId, COPYWIN_FULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_8198204(const u8 *string, const u8 *string2, u8 a3, u8 a4, bool8 copyToVram)
|
void HofPCTopBar_PrintPair(const u8 *string, const u8 *string2, bool8 noBg, u8 left, bool8 copyToVram)
|
||||||
{
|
{
|
||||||
u8 color[3];
|
u8 color[3];
|
||||||
u16 width = 0;
|
u16 width = 0;
|
||||||
|
|
||||||
if (sWindowId != WINDOW_NONE)
|
if (sHofPCTopBarWindowId != WINDOW_NONE)
|
||||||
{
|
{
|
||||||
if (a3 != 0)
|
if (noBg)
|
||||||
{
|
{
|
||||||
color[0] = TEXT_COLOR_TRANSPARENT;
|
color[0] = TEXT_COLOR_TRANSPARENT;
|
||||||
color[1] = TEXT_COLOR_WHITE;
|
color[1] = TEXT_COLOR_WHITE;
|
||||||
@ -854,53 +857,55 @@ void sub_8198204(const u8 *string, const u8 *string2, u8 a3, u8 a4, bool8 copyTo
|
|||||||
color[1] = TEXT_COLOR_WHITE;
|
color[1] = TEXT_COLOR_WHITE;
|
||||||
color[2] = TEXT_COLOR_DARK_GRAY;
|
color[2] = TEXT_COLOR_DARK_GRAY;
|
||||||
}
|
}
|
||||||
PutWindowTilemap(sWindowId);
|
PutWindowTilemap(sHofPCTopBarWindowId);
|
||||||
FillWindowPixelBuffer(sWindowId, PIXEL_FILL(15));
|
FillWindowPixelBuffer(sHofPCTopBarWindowId, PIXEL_FILL(15));
|
||||||
if (string2 != NULL)
|
if (string2 != NULL)
|
||||||
{
|
{
|
||||||
width = GetStringWidth(FONT_SMALL, string2, 0);
|
width = GetStringWidth(FONT_SMALL, string2, 0);
|
||||||
AddTextPrinterParameterized3(sWindowId,
|
AddTextPrinterParameterized3(sHofPCTopBarWindowId,
|
||||||
FONT_SMALL,
|
FONT_SMALL,
|
||||||
0xEC - (GetWindowAttribute(sWindowId, WINDOW_TILEMAP_LEFT) * 8) - a4 - width,
|
236 - (GetWindowAttribute(sHofPCTopBarWindowId, WINDOW_TILEMAP_LEFT) * 8) - left - width,
|
||||||
1,
|
1,
|
||||||
color,
|
color,
|
||||||
0,
|
0,
|
||||||
string2);
|
string2);
|
||||||
}
|
}
|
||||||
AddTextPrinterParameterized4(sWindowId, FONT_NORMAL, 4, 1, 0, 0, color, 0, string);
|
AddTextPrinterParameterized4(sHofPCTopBarWindowId, FONT_NORMAL, 4, 1, 0, 0, color, 0, string);
|
||||||
if (copyToVram)
|
if (copyToVram)
|
||||||
CopyWindowToVram(sWindowId, COPYWIN_FULL);
|
CopyWindowToVram(sHofPCTopBarWindowId, COPYWIN_FULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_81982D8(void)
|
// Unused
|
||||||
|
static void HofPCTopBar_CopyToVram(void)
|
||||||
{
|
{
|
||||||
if (sWindowId != WINDOW_NONE)
|
if (sHofPCTopBarWindowId != WINDOW_NONE)
|
||||||
CopyWindowToVram(sWindowId, COPYWIN_FULL);
|
CopyWindowToVram(sHofPCTopBarWindowId, COPYWIN_FULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_81982F0(void)
|
// Unused
|
||||||
|
static void HofPCTopBar_Clear(void)
|
||||||
{
|
{
|
||||||
if (sWindowId != WINDOW_NONE)
|
if (sHofPCTopBarWindowId != WINDOW_NONE)
|
||||||
{
|
{
|
||||||
FillWindowPixelBuffer(sWindowId, PIXEL_FILL(15));
|
FillWindowPixelBuffer(sHofPCTopBarWindowId, PIXEL_FILL(15));
|
||||||
CopyWindowToVram(sWindowId, COPYWIN_FULL);
|
CopyWindowToVram(sHofPCTopBarWindowId, COPYWIN_FULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_8198314(void)
|
void HofPCTopBar_RemoveWindow(void)
|
||||||
{
|
{
|
||||||
if (sWindowId != WINDOW_NONE)
|
if (sHofPCTopBarWindowId != WINDOW_NONE)
|
||||||
{
|
{
|
||||||
FillWindowPixelBuffer(sWindowId, PIXEL_FILL(0));
|
FillWindowPixelBuffer(sHofPCTopBarWindowId, PIXEL_FILL(0));
|
||||||
ClearWindowTilemap(sWindowId);
|
ClearWindowTilemap(sHofPCTopBarWindowId);
|
||||||
CopyWindowToVram(sWindowId, COPYWIN_FULL);
|
CopyWindowToVram(sHofPCTopBarWindowId, COPYWIN_FULL);
|
||||||
RemoveWindow(sWindowId);
|
RemoveWindow(sHofPCTopBarWindowId);
|
||||||
sWindowId = WINDOW_NONE;
|
sHofPCTopBarWindowId = WINDOW_NONE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 sub_8198348(u8 windowId, u8 fontId, u8 left, u8 top, u8 cursorHeight, u8 numChoices, u8 initialCursorPos, u8 a7)
|
static u8 InitMenu(u8 windowId, u8 fontId, u8 left, u8 top, u8 cursorHeight, u8 numChoices, u8 initialCursorPos, bool8 muteAPress)
|
||||||
{
|
{
|
||||||
s32 pos;
|
s32 pos;
|
||||||
|
|
||||||
@ -911,7 +916,7 @@ u8 sub_8198348(u8 windowId, u8 fontId, u8 left, u8 top, u8 cursorHeight, u8 numC
|
|||||||
sMenu.windowId = windowId;
|
sMenu.windowId = windowId;
|
||||||
sMenu.fontId = fontId;
|
sMenu.fontId = fontId;
|
||||||
sMenu.optionHeight = cursorHeight;
|
sMenu.optionHeight = cursorHeight;
|
||||||
sMenu.APressMuted = a7;
|
sMenu.APressMuted = muteAPress;
|
||||||
|
|
||||||
pos = initialCursorPos;
|
pos = initialCursorPos;
|
||||||
|
|
||||||
@ -924,15 +929,17 @@ u8 sub_8198348(u8 windowId, u8 fontId, u8 left, u8 top, u8 cursorHeight, u8 numC
|
|||||||
return sMenu.cursorPos;
|
return sMenu.cursorPos;
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 sub_81983AC(u8 windowId, u8 fontId, u8 left, u8 top, u8 cursorHeight, u8 numChoices, u8 initialCursorPos)
|
// There is no muted version of this, so the version that plays sound when A is pressed is the "Normal" one.
|
||||||
|
u8 InitMenuNormal(u8 windowId, u8 fontId, u8 left, u8 top, u8 cursorHeight, u8 numChoices, u8 initialCursorPos)
|
||||||
{
|
{
|
||||||
return sub_8198348(windowId, fontId, left, top, cursorHeight, numChoices, initialCursorPos, 0);
|
return InitMenu(windowId, fontId, left, top, cursorHeight, numChoices, initialCursorPos, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 sub_81983EC(u8 windowId, u8 fontId, u8 left, u8 top, u8 numChoices, u8 initialCursorPos)
|
// Unused
|
||||||
|
static u8 InitMenuDefaultCursorHeight(u8 windowId, u8 fontId, u8 left, u8 top, u8 numChoices, u8 initialCursorPos)
|
||||||
{
|
{
|
||||||
u8 cursorHeight = GetMenuCursorDimensionByFont(fontId, 1);
|
u8 cursorHeight = GetMenuCursorDimensionByFont(fontId, 1);
|
||||||
return sub_81983AC(windowId, fontId, left, top, cursorHeight, numChoices, initialCursorPos);
|
return InitMenuNormal(windowId, fontId, left, top, cursorHeight, numChoices, initialCursorPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RedrawMenuCursor(u8 oldPos, u8 newPos)
|
void RedrawMenuCursor(u8 oldPos, u8 newPos)
|
||||||
@ -1098,29 +1105,27 @@ s8 Menu_ProcessInputNoWrapAround_other(void)
|
|||||||
return MENU_NOTHING_CHOSEN;
|
return MENU_NOTHING_CHOSEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrintTextArray(u8 windowId, u8 fontId, u8 left, u8 top, u8 lineHeight, u8 itemCount, const struct MenuAction *menuActions)
|
void PrintMenuActionTextsAtPos(u8 windowId, u8 fontId, u8 left, u8 top, u8 lineHeight, u8 itemCount, const struct MenuAction *menuActions)
|
||||||
{
|
{
|
||||||
u8 i;
|
u8 i;
|
||||||
for (i = 0; i < itemCount; i++)
|
for (i = 0; i < itemCount; i++)
|
||||||
{
|
AddTextPrinterParameterized(windowId, fontId, menuActions[i].text, left, (lineHeight * i) + top, TEXT_SPEED_FF, NULL);
|
||||||
AddTextPrinterParameterized(windowId, fontId, menuActions[i].text, left, (lineHeight * i) + top, 0xFF, NULL);
|
|
||||||
}
|
|
||||||
CopyWindowToVram(windowId, COPYWIN_GFX);
|
CopyWindowToVram(windowId, COPYWIN_GFX);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_81987BC(u8 windowId, u8 fontId, u8 left, u8 top, u8 lineHeight, u8 itemCount, const struct MenuAction *menuActions, u8 a6, u8 a7)
|
// Unused
|
||||||
|
static void PrintMenuActionTextsWithSpacing(u8 windowId, u8 fontId, u8 left, u8 top, u8 lineHeight, u8 itemCount, const struct MenuAction *menuActions, u8 letterSpacing, u8 lineSpacing)
|
||||||
{
|
{
|
||||||
u8 i;
|
u8 i;
|
||||||
for (i = 0; i < itemCount; i++)
|
for (i = 0; i < itemCount; i++)
|
||||||
{
|
AddTextPrinterParameterized5(windowId, fontId, menuActions[i].text, left, (lineHeight * i) + top, TEXT_SPEED_FF, NULL, letterSpacing, lineSpacing);
|
||||||
AddTextPrinterParameterized5(windowId, fontId, menuActions[i].text, left, (lineHeight * i) + top, 0xFF, NULL, a6, a7);
|
|
||||||
}
|
|
||||||
CopyWindowToVram(windowId, COPYWIN_GFX);
|
CopyWindowToVram(windowId, COPYWIN_GFX);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_8198854(u8 windowId, u8 fontId, u8 lineHeight, u8 itemCount, const struct MenuAction *menuActions)
|
// Unused
|
||||||
|
static void PrintMenuActionTextsAtTop(u8 windowId, u8 fontId, u8 lineHeight, u8 itemCount, const struct MenuAction *menuActions)
|
||||||
{
|
{
|
||||||
PrintTextArray(windowId, fontId, GetFontAttribute(fontId, 0), 1, lineHeight, itemCount, menuActions);
|
PrintMenuActionTextsAtPos(windowId, fontId, GetFontAttribute(fontId, FONTATTR_MAX_LETTER_WIDTH), 1, lineHeight, itemCount, menuActions);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddItemMenuActionTextPrinters(u8 windowId, u8 fontId, u8 left, u8 top, u8 letterSpacing, u8 lineHeight, u8 itemCount, const struct MenuAction *menuActions, const u8 *actionIds)
|
void AddItemMenuActionTextPrinters(u8 windowId, u8 fontId, u8 left, u8 top, u8 letterSpacing, u8 lineHeight, u8 itemCount, const struct MenuAction *menuActions, const u8 *actionIds)
|
||||||
@ -1144,13 +1149,14 @@ void AddItemMenuActionTextPrinters(u8 windowId, u8 fontId, u8 left, u8 top, u8 l
|
|||||||
printer.currentChar = menuActions[actionIds[i]].text;
|
printer.currentChar = menuActions[actionIds[i]].text;
|
||||||
printer.y = (lineHeight * i) + top;
|
printer.y = (lineHeight * i) + top;
|
||||||
printer.currentY = printer.y;
|
printer.currentY = printer.y;
|
||||||
AddTextPrinter(&printer, 0xFF, NULL);
|
AddTextPrinter(&printer, TEXT_SPEED_FF, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
CopyWindowToVram(windowId, COPYWIN_GFX);
|
CopyWindowToVram(windowId, COPYWIN_GFX);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_81989B8(u8 windowId, u8 fontId, u8 lineHeight, u8 itemCount, const struct MenuAction *menuActions, const u8 *actionIds)
|
// Unused
|
||||||
|
static void AddItemMenuActionTextPrintersAtTop(u8 windowId, u8 fontId, u8 lineHeight, u8 itemCount, const struct MenuAction *menuActions, const u8 *actionIds)
|
||||||
{
|
{
|
||||||
AddItemMenuActionTextPrinters(windowId, fontId, GetFontAttribute(fontId, FONTATTR_MAX_LETTER_WIDTH), 1, GetFontAttribute(fontId, FONTATTR_LETTER_SPACING), lineHeight, itemCount, menuActions, actionIds);
|
AddItemMenuActionTextPrinters(windowId, fontId, GetFontAttribute(fontId, FONTATTR_MAX_LETTER_WIDTH), 1, GetFontAttribute(fontId, FONTATTR_LETTER_SPACING), lineHeight, itemCount, menuActions, actionIds);
|
||||||
}
|
}
|
||||||
@ -1173,14 +1179,15 @@ struct WindowTemplate CreateWindowTemplate(u8 bg, u8 left, u8 top, u8 width, u8
|
|||||||
return template;
|
return template;
|
||||||
}
|
}
|
||||||
|
|
||||||
u16 sub_8198AA4(u8 bg, u8 left, u8 top, u8 width, u8 height, u8 paletteNum, u16 baseBlock)
|
u16 AddWindowParameterized(u8 bg, u8 left, u8 top, u8 width, u8 height, u8 paletteNum, u16 baseBlock)
|
||||||
{
|
{
|
||||||
struct WindowTemplate template;
|
struct WindowTemplate template;
|
||||||
SetWindowTemplateFields(&template, bg, left, top, width, height, paletteNum, baseBlock);
|
SetWindowTemplateFields(&template, bg, left, top, width, height, paletteNum, baseBlock);
|
||||||
return AddWindow(&template);
|
return AddWindow(&template);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_8198AF8(const struct WindowTemplate *window, u8 fontId, u8 left, u8 top, u16 baseTileNum, u8 paletteNum, u8 initialCursorPos)
|
// As opposed to CreateYesNoMenu, which has a hard-coded position.
|
||||||
|
static void CreateYesNoMenuAtPos(const struct WindowTemplate *window, u8 fontId, u8 left, u8 top, u16 baseTileNum, u8 paletteNum, u8 initialCursorPos)
|
||||||
{
|
{
|
||||||
struct TextPrinterTemplate printer;
|
struct TextPrinterTemplate printer;
|
||||||
|
|
||||||
@ -1203,12 +1210,12 @@ void sub_8198AF8(const struct WindowTemplate *window, u8 fontId, u8 left, u8 top
|
|||||||
|
|
||||||
AddTextPrinter(&printer, TEXT_SPEED_FF, NULL);
|
AddTextPrinter(&printer, TEXT_SPEED_FF, NULL);
|
||||||
|
|
||||||
sub_81983AC(sYesNoWindowId, fontId, left, top, GetFontAttribute(fontId, FONTATTR_MAX_LETTER_HEIGHT), 2, initialCursorPos);
|
InitMenuNormal(sYesNoWindowId, fontId, left, top, GetFontAttribute(fontId, FONTATTR_MAX_LETTER_HEIGHT), 2, initialCursorPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_8198C34(const struct WindowTemplate *window, u8 fontId, u16 baseTileNum, u8 paletteNum)
|
static void CreateYesNoMenuInTopLeft(const struct WindowTemplate *window, u8 fontId, u16 baseTileNum, u8 paletteNum)
|
||||||
{
|
{
|
||||||
sub_8198AF8(window, fontId, 0, 1, baseTileNum, paletteNum, 0);
|
CreateYesNoMenuAtPos(window, fontId, 0, 1, baseTileNum, paletteNum, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
s8 Menu_ProcessInputNoWrapClearOnChoose(void)
|
s8 Menu_ProcessInputNoWrapClearOnChoose(void)
|
||||||
@ -1232,9 +1239,7 @@ void sub_8198C94(u8 windowId, u8 fontId, u8 left, u8 top, u8 a4, u8 a5, u8 a6, u
|
|||||||
for (i = 0; i < a7; i++)
|
for (i = 0; i < a7; i++)
|
||||||
{
|
{
|
||||||
for (j = 0; j < a6; j++)
|
for (j = 0; j < a6; j++)
|
||||||
{
|
AddTextPrinterParameterized(windowId, fontId, menuActions[(i * a6) + j].text, (a4 * j) + left, (a5 * i) + top, TEXT_SPEED_FF, NULL);
|
||||||
AddTextPrinterParameterized(windowId, fontId, menuActions[(i * a6) + j].text, (a4 * j) + left, (a5 * i) + top, 0xFF, NULL);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
CopyWindowToVram(windowId, COPYWIN_GFX);
|
CopyWindowToVram(windowId, COPYWIN_GFX);
|
||||||
}
|
}
|
||||||
@ -1268,7 +1273,7 @@ void PrintMenuActionGrid(u8 windowId, u8 fontId, u8 left, u8 top, u8 optionWidth
|
|||||||
printer.y = (GetFontAttribute(fontId, FONTATTR_MAX_LETTER_HEIGHT) * i) + top;
|
printer.y = (GetFontAttribute(fontId, FONTATTR_MAX_LETTER_HEIGHT) * i) + top;
|
||||||
printer.currentX = printer.x;
|
printer.currentX = printer.x;
|
||||||
printer.currentY = printer.y;
|
printer.currentY = printer.y;
|
||||||
AddTextPrinter(&printer, 0xFF, NULL);
|
AddTextPrinter(&printer, TEXT_SPEED_FF, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1593,7 +1598,8 @@ u8 InitMenuInUpperLeftCorner(u8 windowId, u8 itemCount, u8 initialCursorPos, boo
|
|||||||
return Menu_MoveCursor(0);
|
return Menu_MoveCursor(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 InitMenuInUpperLeftCornerPlaySoundWhenAPressed(u8 windowId, u8 itemCount, u8 initialCursorPos)
|
// There is no muted version of this function, so the version that plays sound when A is pressed is the "Normal" one.
|
||||||
|
u8 InitMenuInUpperLeftCornerNormal(u8 windowId, u8 itemCount, u8 initialCursorPos)
|
||||||
{
|
{
|
||||||
return InitMenuInUpperLeftCorner(windowId, itemCount, initialCursorPos, FALSE);
|
return InitMenuInUpperLeftCorner(windowId, itemCount, initialCursorPos, FALSE);
|
||||||
}
|
}
|
||||||
@ -1603,9 +1609,7 @@ void PrintMenuTable(u8 windowId, u8 itemCount, const struct MenuAction *menuActi
|
|||||||
u32 i;
|
u32 i;
|
||||||
|
|
||||||
for (i = 0; i < itemCount; i++)
|
for (i = 0; i < itemCount; i++)
|
||||||
{
|
AddTextPrinterParameterized(windowId, 1, menuActions[i].text, 8, (i * 16) + 1, TEXT_SPEED_FF, NULL);
|
||||||
AddTextPrinterParameterized(windowId, 1, menuActions[i].text, 8, (i * 16) + 1, 0xFF, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
CopyWindowToVram(windowId, COPYWIN_GFX);
|
CopyWindowToVram(windowId, COPYWIN_GFX);
|
||||||
}
|
}
|
||||||
@ -1631,7 +1635,7 @@ void sub_81995E4(u8 windowId, u8 itemCount, const struct MenuAction *menuActions
|
|||||||
printer.currentChar = menuActions[actionIds[i]].text;
|
printer.currentChar = menuActions[actionIds[i]].text;
|
||||||
printer.y = (i * 16) + 1;
|
printer.y = (i * 16) + 1;
|
||||||
printer.currentY = (i * 16) + 1;
|
printer.currentY = (i * 16) + 1;
|
||||||
AddTextPrinter(&printer, 0xFF, NULL);
|
AddTextPrinter(&printer, TEXT_SPEED_FF, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
CopyWindowToVram(windowId, COPYWIN_GFX);
|
CopyWindowToVram(windowId, COPYWIN_GFX);
|
||||||
@ -1658,8 +1662,8 @@ void CreateYesNoMenu(const struct WindowTemplate *window, u16 baseTileNum, u8 pa
|
|||||||
printer.letterSpacing = 0;
|
printer.letterSpacing = 0;
|
||||||
printer.lineSpacing = 0;
|
printer.lineSpacing = 0;
|
||||||
|
|
||||||
AddTextPrinter(&printer, 0xFF, NULL);
|
AddTextPrinter(&printer, TEXT_SPEED_FF, NULL);
|
||||||
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(sYesNoWindowId, 2, initialCursorPos);
|
InitMenuInUpperLeftCornerNormal(sYesNoWindowId, 2, initialCursorPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrintMenuGridTable(u8 windowId, u8 optionWidth, u8 columns, u8 rows, const struct MenuAction *menuActions)
|
void PrintMenuGridTable(u8 windowId, u8 optionWidth, u8 columns, u8 rows, const struct MenuAction *menuActions)
|
||||||
@ -1669,7 +1673,7 @@ void PrintMenuGridTable(u8 windowId, u8 optionWidth, u8 columns, u8 rows, const
|
|||||||
for (i = 0; i < rows; i++)
|
for (i = 0; i < rows; i++)
|
||||||
{
|
{
|
||||||
for (j = 0; j < columns; j++)
|
for (j = 0; j < columns; j++)
|
||||||
AddTextPrinterParameterized(windowId, 1, menuActions[(i * columns) + j].text, (optionWidth * j) + 8, (i * 16) + 1, 0xFF, NULL);
|
AddTextPrinterParameterized(windowId, 1, menuActions[(i * columns) + j].text, (optionWidth * j) + 8, (i * 16) + 1, TEXT_SPEED_FF, NULL);
|
||||||
}
|
}
|
||||||
CopyWindowToVram(windowId, COPYWIN_GFX);
|
CopyWindowToVram(windowId, COPYWIN_GFX);
|
||||||
}
|
}
|
||||||
@ -1698,7 +1702,7 @@ void sub_819983C(u8 windowId, u8 a4, u8 itemCount, u8 itemCount2, const struct M
|
|||||||
printer.y = (16 * i) + 1;
|
printer.y = (16 * i) + 1;
|
||||||
printer.currentX = printer.x;
|
printer.currentX = printer.x;
|
||||||
printer.currentY = printer.y;
|
printer.currentY = printer.y;
|
||||||
AddTextPrinter(&printer, 0xFF, NULL);
|
AddTextPrinter(&printer, TEXT_SPEED_FF, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2008,7 +2012,7 @@ void PrintPlayerNameOnWindow(u8 windowId, const u8 *src, u16 x, u16 y)
|
|||||||
|
|
||||||
StringExpandPlaceholders(gStringVar4, src);
|
StringExpandPlaceholders(gStringVar4, src);
|
||||||
|
|
||||||
AddTextPrinterParameterized(windowId, 1, gStringVar4, x, y, 0xFF, 0);
|
AddTextPrinterParameterized(windowId, 1, gStringVar4, x, y, TEXT_SPEED_FF, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unused. Similar to BlitBitmapRect4Bit.
|
// Unused. Similar to BlitBitmapRect4Bit.
|
||||||
@ -2105,13 +2109,13 @@ void ListMenuLoadStdPalAt(u8 palOffset, u8 palId)
|
|||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
default:
|
default:
|
||||||
palette = gFireRedMenuElements1_Pal;
|
palette = gMenuInfoElements1_Pal;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
palette = gFireRedMenuElements2_Pal;
|
palette = gMenuInfoElements2_Pal;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
palette = gFireRedMenuElements3_Pal;
|
palette = gMenuInfoElements3_Pal;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2120,7 +2124,7 @@ void ListMenuLoadStdPalAt(u8 palOffset, u8 palId)
|
|||||||
|
|
||||||
void BlitMenuInfoIcon(u8 windowId, u8 iconId, u16 x, u16 y)
|
void BlitMenuInfoIcon(u8 windowId, u8 iconId, u16 x, u16 y)
|
||||||
{
|
{
|
||||||
BlitBitmapRectToWindow(windowId, gFireRedMenuElements_Gfx + sMenuInfoIcons[iconId].offset * 32, 0, 0, 128, 128, x, y, sMenuInfoIcons[iconId].width, sMenuInfoIcons[iconId].height);
|
BlitBitmapRectToWindow(windowId, &gMenuInfoElements_Gfx[sMenuInfoIcons[iconId].offset * 32], 0, 0, 128, 128, x, y, sMenuInfoIcons[iconId].width, sMenuInfoIcons[iconId].height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BufferSaveMenuText(u8 textId, u8 *dest, u8 color)
|
void BufferSaveMenuText(u8 textId, u8 *dest, u8 color)
|
||||||
|
@ -2481,7 +2481,7 @@ static u8 DisplaySelectionWindow(u8 windowType)
|
|||||||
AddTextPrinterParameterized4(sPartyMenuInternal->windowId[0], FONT_NORMAL, cursorDimension, (i * 16) + 1, letterSpacing, 0, sFontColorTable[fontColorsId], 0, sCursorOptions[sPartyMenuInternal->actions[i]].text);
|
AddTextPrinterParameterized4(sPartyMenuInternal->windowId[0], FONT_NORMAL, cursorDimension, (i * 16) + 1, letterSpacing, 0, sFontColorTable[fontColorsId], 0, sCursorOptions[sPartyMenuInternal->actions[i]].text);
|
||||||
}
|
}
|
||||||
|
|
||||||
InitMenuInUpperLeftCorner(sPartyMenuInternal->windowId[0], sPartyMenuInternal->numActions, 0, 1);
|
InitMenuInUpperLeftCorner(sPartyMenuInternal->windowId[0], sPartyMenuInternal->numActions, 0, TRUE);
|
||||||
ScheduleBgCopyTilemapToVram(2);
|
ScheduleBgCopyTilemapToVram(2);
|
||||||
|
|
||||||
return sPartyMenuInternal->windowId[0];
|
return sPartyMenuInternal->windowId[0];
|
||||||
@ -4508,7 +4508,7 @@ static void ShowMoveSelectWindow(u8 slot)
|
|||||||
if (move != MOVE_NONE)
|
if (move != MOVE_NONE)
|
||||||
moveCount++;
|
moveCount++;
|
||||||
}
|
}
|
||||||
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(windowId, moveCount, 0);
|
InitMenuInUpperLeftCornerNormal(windowId, moveCount, 0);
|
||||||
ScheduleBgCopyTilemapToVram(2);
|
ScheduleBgCopyTilemapToVram(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -400,7 +400,7 @@ static void InitPlayerPCMenu(u8 taskId)
|
|||||||
tWindowId = AddWindow(&windowTemplate);
|
tWindowId = AddWindow(&windowTemplate);
|
||||||
SetStandardWindowBorderStyle(tWindowId, 0);
|
SetStandardWindowBorderStyle(tWindowId, 0);
|
||||||
sub_81995E4(tWindowId, sTopMenuNumOptions, sPlayerPCMenuActions, sTopMenuOptionOrder);
|
sub_81995E4(tWindowId, sTopMenuNumOptions, sPlayerPCMenuActions, sTopMenuOptionOrder);
|
||||||
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(tWindowId, sTopMenuNumOptions, 0);
|
InitMenuInUpperLeftCornerNormal(tWindowId, sTopMenuNumOptions, 0);
|
||||||
ScheduleBgCopyTilemapToVram(0);
|
ScheduleBgCopyTilemapToVram(0);
|
||||||
gTasks[taskId].func = PlayerPCProcessMenuInput;
|
gTasks[taskId].func = PlayerPCProcessMenuInput;
|
||||||
}
|
}
|
||||||
@ -511,7 +511,7 @@ static void InitItemStorageMenu(u8 taskId, u8 var)
|
|||||||
tWindowId = AddWindow(&windowTemplate);
|
tWindowId = AddWindow(&windowTemplate);
|
||||||
SetStandardWindowBorderStyle(tWindowId, 0);
|
SetStandardWindowBorderStyle(tWindowId, 0);
|
||||||
PrintMenuTable(tWindowId, ARRAY_COUNT(sItemStorage_MenuActions), sItemStorage_MenuActions);
|
PrintMenuTable(tWindowId, ARRAY_COUNT(sItemStorage_MenuActions), sItemStorage_MenuActions);
|
||||||
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(tWindowId, 4, var);
|
InitMenuInUpperLeftCornerNormal(tWindowId, 4, var);
|
||||||
ScheduleBgCopyTilemapToVram(0);
|
ScheduleBgCopyTilemapToVram(0);
|
||||||
ItemStorageMenuPrint(sItemStorage_OptionDescriptions[var]);
|
ItemStorageMenuPrint(sItemStorage_OptionDescriptions[var]);
|
||||||
}
|
}
|
||||||
@ -753,7 +753,7 @@ static void Mailbox_PrintMailOptions(u8 taskId)
|
|||||||
{
|
{
|
||||||
u8 windowId = MailboxMenu_AddWindow(MAILBOXWIN_OPTIONS);
|
u8 windowId = MailboxMenu_AddWindow(MAILBOXWIN_OPTIONS);
|
||||||
PrintMenuTable(windowId, ARRAY_COUNT(gMailboxMailOptions), gMailboxMailOptions);
|
PrintMenuTable(windowId, ARRAY_COUNT(gMailboxMailOptions), gMailboxMailOptions);
|
||||||
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(windowId, 4, 0);
|
InitMenuInUpperLeftCornerNormal(windowId, 4, 0);
|
||||||
ScheduleBgCopyTilemapToVram(0);
|
ScheduleBgCopyTilemapToVram(0);
|
||||||
gTasks[taskId].func = Mailbox_MailOptionsProcessInput;
|
gTasks[taskId].func = Mailbox_MailOptionsProcessInput;
|
||||||
}
|
}
|
||||||
|
@ -1150,7 +1150,7 @@ static void ShowPokeblockActionsWindow(u8 taskId)
|
|||||||
DestroyScrollArrows();
|
DestroyScrollArrows();
|
||||||
DrawStdFrameWithCustomTileAndPalette(tWindowId, 0, 1, 0xE);
|
DrawStdFrameWithCustomTileAndPalette(tWindowId, 0, 1, 0xE);
|
||||||
sub_81995E4(tWindowId, sPokeblockMenu->numActions, sPokeblockMenuActions, sPokeblockMenu->pokeblockActionIds);
|
sub_81995E4(tWindowId, sPokeblockMenu->numActions, sPokeblockMenuActions, sPokeblockMenu->pokeblockActionIds);
|
||||||
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(tWindowId, sPokeblockMenu->numActions, 0);
|
InitMenuInUpperLeftCornerNormal(tWindowId, sPokeblockMenu->numActions, 0);
|
||||||
PutWindowTilemap(tWindowId);
|
PutWindowTilemap(tWindowId);
|
||||||
ScheduleBgCopyTilemapToVram(1);
|
ScheduleBgCopyTilemapToVram(1);
|
||||||
|
|
||||||
|
@ -1699,7 +1699,7 @@ static void CreateMainMenu(u8 whichMenu, s16 *windowIdPtr)
|
|||||||
|
|
||||||
DrawStdWindowFrame(windowId, FALSE);
|
DrawStdWindowFrame(windowId, FALSE);
|
||||||
PrintMenuTable(windowId, OPTIONS_COUNT, (void *)sMainMenuTexts);
|
PrintMenuTable(windowId, OPTIONS_COUNT, (void *)sMainMenuTexts);
|
||||||
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(windowId, OPTIONS_COUNT, whichMenu);
|
InitMenuInUpperLeftCornerNormal(windowId, OPTIONS_COUNT, whichMenu);
|
||||||
*windowIdPtr = windowId;
|
*windowIdPtr = windowId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -8024,7 +8024,7 @@ static void AddMenu(void)
|
|||||||
ClearWindowTilemap(sStorage->menuWindowId);
|
ClearWindowTilemap(sStorage->menuWindowId);
|
||||||
DrawStdFrameWithCustomTileAndPalette(sStorage->menuWindowId, FALSE, 11, 14);
|
DrawStdFrameWithCustomTileAndPalette(sStorage->menuWindowId, FALSE, 11, 14);
|
||||||
PrintMenuTable(sStorage->menuWindowId, sStorage->menuItemsCount, (void*)sStorage->menuItems);
|
PrintMenuTable(sStorage->menuWindowId, sStorage->menuItemsCount, (void*)sStorage->menuItems);
|
||||||
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(sStorage->menuWindowId, sStorage->menuItemsCount, 0);
|
InitMenuInUpperLeftCornerNormal(sStorage->menuWindowId, sStorage->menuItemsCount, 0);
|
||||||
ScheduleBgCopyTilemapToVram(0);
|
ScheduleBgCopyTilemapToVram(0);
|
||||||
sStorage->menuUnusedField = 0;
|
sStorage->menuUnusedField = 0;
|
||||||
}
|
}
|
||||||
|
@ -109,7 +109,7 @@ static void DrawMultichoiceMenu(u8 left, u8 top, u8 multichoiceId, bool8 ignoreB
|
|||||||
windowId = CreateWindowFromRect(left, top, newWidth, count * 2);
|
windowId = CreateWindowFromRect(left, top, newWidth, count * 2);
|
||||||
SetStandardWindowBorderStyle(windowId, 0);
|
SetStandardWindowBorderStyle(windowId, 0);
|
||||||
PrintMenuTable(windowId, count, actions);
|
PrintMenuTable(windowId, count, actions);
|
||||||
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(windowId, count, cursorPos);
|
InitMenuInUpperLeftCornerNormal(windowId, count, cursorPos);
|
||||||
ScheduleBgCopyTilemapToVram(0);
|
ScheduleBgCopyTilemapToVram(0);
|
||||||
InitMultichoiceCheckWrap(ignoreBPress, count, windowId, multichoiceId);
|
InitMultichoiceCheckWrap(ignoreBPress, count, windowId, multichoiceId);
|
||||||
}
|
}
|
||||||
@ -372,7 +372,7 @@ static void CreatePCMultichoice(void)
|
|||||||
|
|
||||||
StringExpandPlaceholders(gStringVar4, gText_PlayersPC);
|
StringExpandPlaceholders(gStringVar4, gText_PlayersPC);
|
||||||
PrintPlayerNameOnWindow(windowId, gStringVar4, y, 17);
|
PrintPlayerNameOnWindow(windowId, gStringVar4, y, 17);
|
||||||
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(windowId, numChoices, 0);
|
InitMenuInUpperLeftCornerNormal(windowId, numChoices, 0);
|
||||||
CopyWindowToVram(windowId, COPYWIN_FULL);
|
CopyWindowToVram(windowId, COPYWIN_FULL);
|
||||||
InitMultichoiceCheckWrap(FALSE, numChoices, windowId, MULTI_PC);
|
InitMultichoiceCheckWrap(FALSE, numChoices, windowId, MULTI_PC);
|
||||||
}
|
}
|
||||||
@ -532,7 +532,7 @@ static void CreateLilycoveSSTidalMultichoice(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(windowId, count, count - 1);
|
InitMenuInUpperLeftCornerNormal(windowId, count, count - 1);
|
||||||
CopyWindowToVram(windowId, COPYWIN_FULL);
|
CopyWindowToVram(windowId, COPYWIN_FULL);
|
||||||
InitMultichoiceCheckWrap(FALSE, count, windowId, MULTI_SSTIDAL_LILYCOVE);
|
InitMultichoiceCheckWrap(FALSE, count, windowId, MULTI_SSTIDAL_LILYCOVE);
|
||||||
}
|
}
|
||||||
@ -696,7 +696,7 @@ static void CreateStartMenuForPokenavTutorial(void)
|
|||||||
AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_MenuOptionSave, 8, 89, TEXT_SPEED_FF, NULL);
|
AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_MenuOptionSave, 8, 89, TEXT_SPEED_FF, NULL);
|
||||||
AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_MenuOptionOption, 8, 105, TEXT_SPEED_FF, NULL);
|
AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_MenuOptionOption, 8, 105, TEXT_SPEED_FF, NULL);
|
||||||
AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_MenuOptionExit, 8, 121, TEXT_SPEED_FF, NULL);
|
AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_MenuOptionExit, 8, 121, TEXT_SPEED_FF, NULL);
|
||||||
sub_81983AC(windowId, FONT_NORMAL, 0, 9, 16, ARRAY_COUNT(MultichoiceList_ForcedStartMenu), 0);
|
InitMenuNormal(windowId, FONT_NORMAL, 0, 9, 16, ARRAY_COUNT(MultichoiceList_ForcedStartMenu), 0);
|
||||||
InitMultichoiceNoWrap(FALSE, ARRAY_COUNT(MultichoiceList_ForcedStartMenu), windowId, MULTI_FORCED_START_MENU);
|
InitMultichoiceNoWrap(FALSE, ARRAY_COUNT(MultichoiceList_ForcedStartMenu), windowId, MULTI_FORCED_START_MENU);
|
||||||
CopyWindowToVram(windowId, COPYWIN_FULL);
|
CopyWindowToVram(windowId, COPYWIN_FULL);
|
||||||
}
|
}
|
||||||
|
@ -1028,7 +1028,7 @@ static void ShowRegistryMenuActions(u8 taskId)
|
|||||||
tActionWindowId = AddWindow(&template);
|
tActionWindowId = AddWindow(&template);
|
||||||
SetStandardWindowBorderStyle(tActionWindowId, 0);
|
SetStandardWindowBorderStyle(tActionWindowId, 0);
|
||||||
PrintMenuTable(tActionWindowId, ARRAY_COUNT(sRegistryMenuActions), sRegistryMenuActions);
|
PrintMenuTable(tActionWindowId, ARRAY_COUNT(sRegistryMenuActions), sRegistryMenuActions);
|
||||||
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(tActionWindowId, 2, 0);
|
InitMenuInUpperLeftCornerNormal(tActionWindowId, 2, 0);
|
||||||
ScheduleBgCopyTilemapToVram(0);
|
ScheduleBgCopyTilemapToVram(0);
|
||||||
gTasks[taskId].func = HandleRegistryMenuActionsInput;
|
gTasks[taskId].func = HandleRegistryMenuActionsInput;
|
||||||
}
|
}
|
||||||
|
@ -301,7 +301,7 @@ static u8 CreateShopMenu(u8 martType)
|
|||||||
|
|
||||||
SetStandardWindowBorderStyle(sMartInfo.windowId, 0);
|
SetStandardWindowBorderStyle(sMartInfo.windowId, 0);
|
||||||
PrintMenuTable(sMartInfo.windowId, numMenuItems, sMartInfo.menuActions);
|
PrintMenuTable(sMartInfo.windowId, numMenuItems, sMartInfo.menuActions);
|
||||||
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(sMartInfo.windowId, numMenuItems, 0);
|
InitMenuInUpperLeftCornerNormal(sMartInfo.windowId, numMenuItems, 0);
|
||||||
PutWindowTilemap(sMartInfo.windowId);
|
PutWindowTilemap(sMartInfo.windowId);
|
||||||
CopyWindowToVram(sMartInfo.windowId, COPYWIN_MAP);
|
CopyWindowToVram(sMartInfo.windowId, COPYWIN_MAP);
|
||||||
|
|
||||||
|
@ -466,7 +466,7 @@ static bool32 InitStartMenuStep(void)
|
|||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
LoadMessageBoxAndBorderGfx();
|
LoadMessageBoxAndBorderGfx();
|
||||||
DrawStdWindowFrame(sub_81979C4(sNumStartMenuActions), FALSE);
|
DrawStdWindowFrame(AddStartMenuWindow(sNumStartMenuActions), FALSE);
|
||||||
sInitStartMenuData[1] = 0;
|
sInitStartMenuData[1] = 0;
|
||||||
sInitStartMenuData[0]++;
|
sInitStartMenuData[0]++;
|
||||||
break;
|
break;
|
||||||
@ -482,7 +482,7 @@ static bool32 InitStartMenuStep(void)
|
|||||||
sInitStartMenuData[0]++;
|
sInitStartMenuData[0]++;
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
sStartMenuCursorPos = sub_81983AC(GetStartMenuWindowId(), FONT_NORMAL, 0, 9, 16, sNumStartMenuActions, sStartMenuCursorPos);
|
sStartMenuCursorPos = InitMenuNormal(GetStartMenuWindowId(), FONT_NORMAL, 0, 9, 16, sNumStartMenuActions, sStartMenuCursorPos);
|
||||||
CopyWindowToVram(GetStartMenuWindowId(), COPYWIN_MAP);
|
CopyWindowToVram(GetStartMenuWindowId(), COPYWIN_MAP);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -1395,7 +1395,7 @@ static void TradeMenuProcessInput(void)
|
|||||||
DrawTextBorderOuter(1, 1, 14);
|
DrawTextBorderOuter(1, 1, 14);
|
||||||
FillWindowPixelBuffer(1, PIXEL_FILL(1));
|
FillWindowPixelBuffer(1, PIXEL_FILL(1));
|
||||||
PrintMenuTable(1, ARRAY_COUNT(sSelectTradeMonActions), sSelectTradeMonActions);
|
PrintMenuTable(1, ARRAY_COUNT(sSelectTradeMonActions), sSelectTradeMonActions);
|
||||||
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(1, 2, 0);
|
InitMenuInUpperLeftCornerNormal(1, 2, 0);
|
||||||
PutWindowTilemap(1);
|
PutWindowTilemap(1);
|
||||||
CopyWindowToVram(1, COPYWIN_FULL);
|
CopyWindowToVram(1, COPYWIN_FULL);
|
||||||
sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_SELECTED_MON;
|
sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_SELECTED_MON;
|
||||||
|
@ -82,7 +82,7 @@ void CreateAvailableDecorationsMenu(u8 taskId)
|
|||||||
AddTextPrinterParameterized(data[3], FONT_NORMAL, gDecorations[trader->decorations[i]].name, 8, 16 * i + 1, 255, NULL);
|
AddTextPrinterParameterized(data[3], FONT_NORMAL, gDecorations[trader->decorations[i]].name, 8, 16 * i + 1, 255, NULL);
|
||||||
}
|
}
|
||||||
AddTextPrinterParameterized(data[3], FONT_NORMAL, gText_Exit, 8, 16 * i + 1, 255, NULL);
|
AddTextPrinterParameterized(data[3], FONT_NORMAL, gText_Exit, 8, 16 * i + 1, 255, NULL);
|
||||||
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(data[3], 5, 0);
|
InitMenuInUpperLeftCornerNormal(data[3], 5, 0);
|
||||||
ScheduleBgCopyTilemapToVram(0);
|
ScheduleBgCopyTilemapToVram(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2743,7 +2743,7 @@ static void AddYesNoMenuAt(u8 left, u8 top, u8 initialCursorPos)
|
|||||||
AddTextPrinterParameterized(sDisplay->yesNoMenuWindowId, FONT_NORMAL, gText_Yes, 8, 1, TEXT_SPEED_FF, NULL);
|
AddTextPrinterParameterized(sDisplay->yesNoMenuWindowId, FONT_NORMAL, gText_Yes, 8, 1, TEXT_SPEED_FF, NULL);
|
||||||
AddTextPrinterParameterized(sDisplay->yesNoMenuWindowId, FONT_NORMAL, gText_No, 8, 17, TEXT_SPEED_FF, NULL);
|
AddTextPrinterParameterized(sDisplay->yesNoMenuWindowId, FONT_NORMAL, gText_No, 8, 17, TEXT_SPEED_FF, NULL);
|
||||||
DrawTextBorderOuter(sDisplay->yesNoMenuWindowId, 1, 13);
|
DrawTextBorderOuter(sDisplay->yesNoMenuWindowId, 1, 13);
|
||||||
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(sDisplay->yesNoMenuWindowId, 2, initialCursorPos);
|
InitMenuInUpperLeftCornerNormal(sDisplay->yesNoMenuWindowId, 2, initialCursorPos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2987,8 +2987,8 @@ static void ShowKeyboardSwapMenu(void)
|
|||||||
{
|
{
|
||||||
FillWindowPixelBuffer(3, PIXEL_FILL(1));
|
FillWindowPixelBuffer(3, PIXEL_FILL(1));
|
||||||
DrawTextBorderOuter(3, 1, 13);
|
DrawTextBorderOuter(3, 1, 13);
|
||||||
PrintTextArray(3, FONT_SHORT, 8, 1, 14, 5, sKeyboardPageTitleTexts);
|
PrintMenuActionTextsAtPos(3, FONT_SHORT, 8, 1, 14, 5, sKeyboardPageTitleTexts);
|
||||||
sub_81983AC(3, FONT_SHORT, 0, 1, 14, 5, GetCurrentKeyboardPage());
|
InitMenuNormal(3, FONT_SHORT, 0, 1, 14, 5, GetCurrentKeyboardPage());
|
||||||
PutWindowTilemap(3);
|
PutWindowTilemap(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user