diff options
Diffstat (limited to 'src/field/party_menu.c')
-rw-r--r-- | src/field/party_menu.c | 112 |
1 files changed, 56 insertions, 56 deletions
diff --git a/src/field/party_menu.c b/src/field/party_menu.c index 790aede60..7d243f569 100644 --- a/src/field/party_menu.c +++ b/src/field/party_menu.c @@ -32,7 +32,7 @@ #include "string_util.h" #include "strings.h" #include "task.h" -#include "unknown_task.h" +#include "scanline_effect.h" #include "util.h" #include "script_pokemon_80F9.h" #include "ewram.h" @@ -648,7 +648,7 @@ bool8 InitPartyMenu(void) gMain.state++; break; case 1: - remove_some_task(); + ScanlineEffect_Stop(); gMain.state++; break; case 2: @@ -679,11 +679,11 @@ bool8 InitPartyMenu(void) gMain.state++; break; case 7: - SetUpWindowConfig(&gWindowConfig_81E6C90); + Text_LoadWindowTemplate(&gWindowTemplate_81E6C90); gMain.state++; break; case 8: - InitWindowFromConfig(&gUnknown_03004210, &gWindowConfig_81E6C90); + Text_InitWindowWithTemplate(&gUnknown_03004210, &gWindowTemplate_81E6C90); MultistepInitWindowTileData(&gUnknown_03004210, 1); gMain.state++; break; @@ -716,7 +716,7 @@ bool8 InitPartyMenu(void) } break; case 13: - MultistepInitMenuWindowBegin(&gWindowConfig_81E6CC8); + MultistepInitMenuWindowBegin(&gWindowTemplate_81E6CC8); gMain.state++; break; case 14: @@ -2676,26 +2676,26 @@ void PrintPartyMenuPromptText(u8 textId, u8 b) switch (b) { case 0: - MenuDrawTextWindow(0, 16, 23, 19); + Menu_DrawStdWindowFrame(0, 16, 23, 19); break; case 1: - MenuDrawTextWindow(0, 16, 19, 19); + Menu_DrawStdWindowFrame(0, 16, 19, 19); break; case 2: - MenuDrawTextWindow(0, 16, 22, 19); + Menu_DrawStdWindowFrame(0, 16, 22, 19); break; case 3: - MenuDrawTextWindow(0, 16, 18, 19); + Menu_DrawStdWindowFrame(0, 16, 18, 19); break; } - MenuPrint(PartyMenuPromptTexts[textId], 1, 17); + Menu_PrintText(PartyMenuPromptTexts[textId], 1, 17); } } void sub_806D5A4(void) { - MenuZeroFillWindowRect(0, 16, 29, 19); + Menu_EraseWindowRect(0, 16, 29, 19); } void sub_806D5B8(u8 monIndex) @@ -2706,7 +2706,7 @@ void sub_806D5B8(u8 monIndex) u8 right = gUnknown_08376948[IsDoubleBattle()][monIndex].right; u8 bottom = gUnknown_08376948[IsDoubleBattle()][monIndex].bottom; - ZeroFillWindowRect(&gUnknown_03004210, left, top, right, bottom); + Text_EraseWindowRect(&gUnknown_03004210, left, top, right, bottom); var1 = 0; CpuFastSet(&var1, OBJ_VRAM1 + monIndex * 0x400, 0x1000100); @@ -2720,7 +2720,7 @@ void sub_806D668(u8 monIndex) u8 right = gUnknown_08376978[IsDoubleBattle()][monIndex].right; u8 bottom = gUnknown_08376978[IsDoubleBattle()][monIndex].bottom; - ZeroFillWindowRect(&gUnknown_03004210, left, top, right, bottom); + Text_EraseWindowRect(&gUnknown_03004210, left, top, right, bottom); var1 = 0; CpuFastSet(&var1, OBJ_VRAM1 + 0x300 + monIndex * 0x400, 0x1000040); @@ -3313,7 +3313,7 @@ void PartyMenuDoPrintMonNickname(u8 monIndex, int b, const u8 *nameBuffer) { u32 var1 = 0; CpuFastSet(&var1, gTileBuffer, 0x1000100); - sub_8004E3C((struct WindowConfig *)&gWindowConfig_81E6CAC, gTileBuffer, nameBuffer); + Text_InitWindow8004E3C((struct WindowTemplate *)&gWindowTemplate_81E6CAC, gTileBuffer, nameBuffer); CpuFastSet(gTileBuffer, OBJ_VRAM1 + (monIndex * 0x400), 128); } @@ -3423,7 +3423,7 @@ void PartyMenuDoPrintLevel(u8 monIndex, u8 menuLayout, u8 level) var1 = 0; CpuFastSet(&var1, gUnknown_02039460, 0x1000020); - sub_8004E3C((struct WindowConfig *)&gWindowConfig_81E6CAC, gUnknown_02039460 - 0x100 /*gTileBuffer*/, gStringVar1); + Text_InitWindow8004E3C((struct WindowTemplate *)&gWindowTemplate_81E6CAC, gUnknown_02039460 - 0x100 /*gTileBuffer*/, gStringVar1); CpuFastSet(gUnknown_02039460, OBJ_VRAM1 + 0x200 + (monIndex * 0x400), 32); } @@ -3517,7 +3517,7 @@ void PartyMenuDoPrintHP(u8 monIndex, u8 b, u16 currentHP, u16 maxHP) var = 0; CpuFastSet(&var, gUnknown_02039460, 0x1000040); - sub_8004E3C((struct WindowConfig *)&gWindowConfig_81E6CAC, gUnknown_02039460 - 0x100 /*gTileBuffer*/, gStringVar1); + Text_InitWindow8004E3C((struct WindowTemplate *)&gWindowTemplate_81E6CAC, gUnknown_02039460 - 0x100 /*gTileBuffer*/, gStringVar1); CpuFastSet(gUnknown_02039460, OBJ_VRAM1 + 0x300 + (monIndex * 0x400), 64); } @@ -3667,8 +3667,8 @@ void ClosePartyPopupMenu(u8 index, const struct PartyPopupMenu *menu) SetPartyPopupMenuOffsets(index, &left, &top, menu); - MenuZeroFillWindowRect(left, top, left + menu[index].width, menu[index].numChoices * 2 + top + 1); - HandleDestroyMenuCursors(); + Menu_EraseWindowRect(left, top, left + menu[index].width, menu[index].numChoices * 2 + top + 1); + Menu_DestroyCursor(); } TaskFunc PartyMenuGetPopupMenuFunc(u8 menuIndex, const struct PartyPopupMenu *menus, const struct MenuAction2 *menuActions, u8 itemIndex) @@ -3683,7 +3683,7 @@ u8 sub_806E834(const u8 *message, u8 arg1) gUnknown_0202E8F6 = 1; - MenuDrawTextWindow(WINDOW_LEFT, 14, WINDOW_RIGHT, 19); + Menu_DrawStdWindowFrame(WINDOW_LEFT, 14, WINDOW_RIGHT, 19); MenuPrintMessage(message, WINDOW_LEFT + 1, 15); taskId = CreateTask(sub_806E884, 1); @@ -3694,11 +3694,11 @@ u8 sub_806E834(const u8 *message, u8 arg1) static void sub_806E884(u8 taskId) { - if (MenuUpdateWindowText()) + if (Menu_UpdateWindowText()) { gUnknown_0202E8F6 = 0; if (gTasks[taskId].data[0] == 0) - MenuZeroFillWindowRect(WINDOW_LEFT, 14, WINDOW_RIGHT, 19); + Menu_EraseWindowRect(WINDOW_LEFT, 14, WINDOW_RIGHT, 19); DestroyTask(taskId); } } @@ -3788,13 +3788,13 @@ void party_menu_link_mon_held_item_object(u8 taskId) void PartyMenuTryGiveMonHeldItem_806EACC(u8 taskId) { - s8 selection = ProcessMenuInputNoWrap_(); + s8 selection = Menu_ProcessInputNoWrap_(); if (selection == 0) { u16 currentItem; - MenuZeroFillWindowRect(23, 8, 29, 13); + Menu_EraseWindowRect(23, 8, 29, 13); currentItem = GetMonData(ewram1C000.pokemon, MON_DATA_HELD_ITEM); RemoveBagItem(ewram1C000.unk6, 1); if (AddBagItem(currentItem, 1) == TRUE) @@ -3823,7 +3823,7 @@ void PartyMenuTryGiveMonHeldItem_806EACC(u8 taskId) return; if (selection == -1) PlaySE(SE_SELECT); - MenuZeroFillWindowRect(23, 8, 29, 13); + Menu_EraseWindowRect(23, 8, 29, 13); } gTasks[taskId].func = party_menu_link_mon_held_item_object; } @@ -3925,7 +3925,7 @@ void DoTakeMail(u8 taskId, TaskFunc func) void Task_LoseMailMessage(u8 taskId) { - s8 selection = ProcessMenuInputNoWrap_(); + s8 selection = Menu_ProcessInputNoWrap_(); if (selection == 0) { @@ -3938,7 +3938,7 @@ void Task_LoseMailMessage(u8 taskId) { sub_806E834(gOtherText_BagFullCannotRemoveItem, 0); } - MenuZeroFillWindowRect(23, 8, 29, 13); + Menu_EraseWindowRect(23, 8, 29, 13); gTasks[taskId].func = party_menu_link_mon_held_item_object; } else @@ -3947,8 +3947,8 @@ void Task_LoseMailMessage(u8 taskId) return; if (selection == -1) PlaySE(SE_SELECT); - MenuZeroFillWindowRect(23, 8, 29, 13); - MenuZeroFillWindowRect(0, 14, 29, 19); + Menu_EraseWindowRect(23, 8, 29, 13); + Menu_EraseWindowRect(0, 14, 29, 19); gTasks[taskId].func = party_menu_link_mon_held_item_object; } } @@ -3964,11 +3964,11 @@ void Task_ConfirmLoseMailMessage(u8 taskId) void Task_TakeHeldMail(u8 taskId) { - s8 selection = ProcessMenuInputNoWrap_(); + s8 selection = Menu_ProcessInputNoWrap_(); if (selection == 0) { - MenuZeroFillWindowRect(23, 8, 29, 13); + Menu_EraseWindowRect(23, 8, 29, 13); if (TakeMailFromMon2(ewram1C000.pokemon) != 0xFF) sub_806E834(gOtherText_MailWasSent, 0); else @@ -3981,7 +3981,7 @@ void Task_TakeHeldMail(u8 taskId) return; if (selection == -1) PlaySE(SE_SELECT); - MenuZeroFillWindowRect(23, 8, 29, 13); + Menu_EraseWindowRect(23, 8, 29, 13); sub_806E834(gOtherText_MailRemovedMessageLost, 1); gTasks[taskId].func = Task_ConfirmLoseMailMessage; } @@ -4126,11 +4126,11 @@ void sub_806F358(u8 taskId) void sub_806F390(u8 taskId) { - s8 selection = ProcessMenuInputNoWrap_(); + s8 selection = Menu_ProcessInputNoWrap_(); if (selection == 0) { - MenuZeroFillWindowRect(23, 8, 29, 13); + Menu_EraseWindowRect(23, 8, 29, 13); sub_806E834(gOtherText_WhichMoveToForget2, 1); gTasks[taskId].func = sub_806F44C; } @@ -4206,7 +4206,7 @@ void StopTryingToTeachMove_806F588(u8 taskId) void StopTryingToTeachMove_806F614(u8 taskId) { - MenuZeroFillWindowRect(23, 8, 29, 13); + Menu_EraseWindowRect(23, 8, 29, 13); StringCopy(gStringVar2, gMoveNames[ewram1C000.unk8]); StringExpandPlaceholders(gStringVar4, gOtherText_StopTryingTo); sub_806E834(gStringVar4, 1); @@ -4224,11 +4224,11 @@ void StopTryingToTeachMove_806F67C(u8 taskId) void StopTryingToTeachMove_806F6B4(u8 taskId) { - s8 selection = ProcessMenuInputNoWrap_(); + s8 selection = Menu_ProcessInputNoWrap_(); if (selection == 0) { - MenuZeroFillWindowRect(23, 8, 29, 13); + Menu_EraseWindowRect(23, 8, 29, 13); GetMonNickname(ewram1C000.pokemon, gStringVar1); StringCopy(gStringVar2, gMoveNames[ewram1C000.unk8]); StringExpandPlaceholders(gStringVar4, gOtherText_DidNotLearnMove2); @@ -4241,7 +4241,7 @@ void StopTryingToTeachMove_806F6B4(u8 taskId) return; if (selection == -1) PlaySE(SE_SELECT); - MenuZeroFillWindowRect(23, 8, 29, 13); + Menu_EraseWindowRect(23, 8, 29, 13); GetMonNickname(ewram1C000.pokemon, gStringVar1); StringCopy(gStringVar2, gMoveNames[ewram1C000.unk8]); StringExpandPlaceholders(gStringVar4, gOtherText_WantsToLearn); @@ -4592,7 +4592,7 @@ void sub_8070088(u8 taskId) else { gUnknown_0202E8F4 = 1; - MenuZeroFillWindowRect(WINDOW_LEFT, 14, WINDOW_RIGHT, 19); + Menu_EraseWindowRect(WINDOW_LEFT, 14, WINDOW_RIGHT, 19); PlaySE(SE_KAIFUKU); PartyMenuUpdateLevelOrStatus(ewram1C000.pokemon, ewram1C000.unk5); task_pc_turn_off(&gUnknown_083769A8[IsDoubleBattle() * 12 + ewram1C000.unk5 * 2], 9); @@ -4649,12 +4649,12 @@ void CreateItemUseMoveMenu(u8 partyMonIndex) u8 i; r6 = 0; - MenuDrawTextWindow(19, 10, 29, 19); + Menu_DrawStdWindowFrame(19, 10, 29, 19); for (i = 0; i < 4; i++) { u16 move = GetMonData(&gPlayerParty[partyMonIndex], MON_DATA_MOVE1 + i); - MenuPrint(gMoveNames[move], 20, i * 2 + 11); + Menu_PrintText(gMoveNames[move], 20, i * 2 + 11); if (move != 0) r6++; } @@ -4666,12 +4666,12 @@ void Task_HandleItemUseMoveMenuInput(u8 taskId) if (gMain.newKeys & DPAD_UP) { PlaySE(SE_SELECT); - MoveMenuCursor(-1); + Menu_MoveCursor(-1); } else if (gMain.newKeys & DPAD_DOWN) { PlaySE(SE_SELECT); - MoveMenuCursor(1); + Menu_MoveCursor(1); } else if (gMain.newKeys & A_BUTTON) { @@ -4713,17 +4713,17 @@ void DoPPRecoveryItemEffect(u8 taskId, u16 item, TaskFunc c) void ItemUseMoveMenu_HandleMoveSelection(u8 taskId) { - HandleDestroyMenuCursors(); - MenuZeroFillWindowRect(19, 10, 29, 19); + Menu_DestroyCursor(); + Menu_EraseWindowRect(19, 10, 29, 19); sub_806D5A4(); - gTasks[taskId].data[11] = GetMenuCursorPos(); + gTasks[taskId].data[11] = Menu_GetCursorPos(); DoRecoverPP(taskId); } void ItemUseMoveMenu_HandleCancel(u8 taskId) { - HandleDestroyMenuCursors(); - MenuZeroFillWindowRect(19, 10, 29, 19); + Menu_DestroyCursor(); + Menu_EraseWindowRect(19, 10, 29, 19); if (gMain.inBattle) gTasks[ewram1C000.unk4].func = HandleBattlePartyMenu; else @@ -4852,7 +4852,7 @@ void PrintStatGrowthsInLevelUpWindow(u8 taskId) { u8 i; - MenuDrawTextWindow(11, 0, 29, 7); + Menu_DrawStdWindowFrame(11, 0, 29, 7); for (i = 0; i < NUM_STATS; i++) { @@ -4868,12 +4868,12 @@ void PrintStatGrowthsInLevelUpWindow(u8 taskId) x = (i / 3) * 9 + 11; y = ((i % 3) << 1) + 1; - MenuPrint_PixelCoords(StatNames[i], (x + 1) * 8, y * 8, 1); + Menu_PrintTextPixelCoords(StatNames[i], (x + 1) * 8, y * 8, 1); if (i == 2) - MenuPrint_PixelCoords(gOtherText_TallPlusAndRightArrow, (x + 6) * 8 + 6, y * 8, 0); + Menu_PrintTextPixelCoords(gOtherText_TallPlusAndRightArrow, (x + 6) * 8 + 6, y * 8, 0); else - MenuPrint_PixelCoords(gOtherText_TallPlusAndRightArrow, (x + 6) * 8 + 6, y * 8, 1); + Menu_PrintTextPixelCoords(gOtherText_TallPlusAndRightArrow, (x + 6) * 8 + 6, y * 8, 1); gStringVar1[0] = EXT_CTRL_CODE_BEGIN; gStringVar1[1] = 0x14; @@ -4881,7 +4881,7 @@ void PrintStatGrowthsInLevelUpWindow(u8 taskId) ConvertIntToDecimalStringN(gStringVar1 + 3, ewram1B000.statGrowths[i], 1, 2); - MenuPrint_PixelCoords(gStringVar1, (x + 6) * 8 + 12, y * 8, 0); + Menu_PrintTextPixelCoords(gStringVar1, (x + 6) * 8 + 12, y * 8, 0); } } #elif GERMAN @@ -4897,7 +4897,7 @@ void PrintStatGrowthsInLevelUpWindow(u8 taskId) { movs r1, 0\n\ movs r2, 0x1D\n\ movs r3, 0x7\n\ - bl MenuDrawTextWindow\n\ + bl Menu_DrawStdWindowFrame\n\ movs r7, 0\n\ ldr r0, _0807092C @ =gStringVar1\n\ mov r10, r0\n\ @@ -4981,7 +4981,7 @@ _0807086C:\n\ mov r0, r10\n\ adds r1, r4, 0\n\ adds r2, r5, 0\n\ - bl MenuPrint\n\ + bl Menu_PrintText\n\ adds r0, r7, 0x1\n\ lsls r0, 24\n\ lsrs r7, r0, 24\n\ @@ -5028,7 +5028,7 @@ void PrintNewStatsInLevelUpWindow(u8 taskId) gStringVar1[2] = 0x06; ConvertIntToDecimalStringN(gStringVar1 + 3, ewram1B000.statGrowths[newStatIndex], 1, 3); - MenuPrint_PixelCoords(gStringVar1, (x + 6) * 8 + 6, y * 8, 0); + Menu_PrintTextPixelCoords(gStringVar1, (x + 6) * 8 + 6, y * 8, 0); } } @@ -5070,7 +5070,7 @@ void Task_RareCandy3(u8 taskId) u16 learnedMove; u16 evolutionSpecies; - MenuZeroFillWindowRect(11, 0, 29, 7); + Menu_EraseWindowRect(11, 0, 29, 7); learnedMove = MonTryLearningNewMove(ewram1C000.pokemon, TRUE); ewram1B000.unk282 = 1; |