diff --git a/asm/rom_8011DC0.s b/asm/rom_8011DC0.s index 7d43b1815..9a77545a7 100644 --- a/asm/rom_8011DC0.s +++ b/asm/rom_8011DC0.s @@ -472,7 +472,7 @@ sub_8017020: @ 8017020 bl sub_81973A4 movs r0, 0 movs r1, 0x1 - bl NewMenuHelpers_DrawDialogueFrame + bl DrawDialogueFrame ldr r0, =gStringVar4 adds r1, r4, 0 bl StringExpandPlaceholders @@ -517,7 +517,7 @@ _08017076: bl sub_81973A4 movs r0, 0 movs r1, 0x1 - bl NewMenuHelpers_DrawDialogueFrame + bl DrawDialogueFrame ldr r0, =gStringVar4 adds r1, r5, 0 bl StringExpandPlaceholders @@ -563,7 +563,7 @@ _080170CA: negs r0, r0 b _08017110 _080170D4: - bl DisplayYesNoMenu + bl DisplayYesNoMenuWithDefault ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] @@ -609,7 +609,7 @@ sub_8017118: @ 8017118 lsrs r4, 24 adds r0, r4, 0 movs r1, 0 - bl NewMenuHelpers_DrawStdWindowFrame + bl DrawStdWindowFrame adds r0, r4, 0 movs r1, 0xFF bl FillWindowPixelBuffer @@ -705,7 +705,7 @@ _080171DC: strb r0, [r5] ldrb r0, [r5] movs r1, 0 - bl NewMenuHelpers_DrawStdWindowFrame + bl DrawStdWindowFrame ldr r0, =gMultiuseListMenuTemplate adds r2, r0, 0 ldr r1, [sp, 0x24] @@ -745,7 +745,7 @@ _08017228: bl DestroyListMenuTask ldrb r0, [r5] movs r1, 0x1 - bl ClearWindowAndBorder + bl ClearStdWindowAndFrame ldrb r0, [r5] bl RemoveWindow movs r0, 0 @@ -765,7 +765,7 @@ _08017264: bl DestroyListMenuTask ldrb r0, [r5] movs r1, 0x1 - bl ClearWindowAndBorder + bl ClearStdWindowAndFrame ldrb r0, [r5] bl RemoveWindow strb r4, [r7] @@ -818,7 +818,7 @@ _080172C8: strb r0, [r6] ldrb r0, [r6] movs r1, 0 - bl NewMenuHelpers_DrawStdWindowFrame + bl DrawStdWindowFrame ldr r0, =gMultiuseListMenuTemplate adds r2, r0, 0 ldr r1, [sp, 0x24] @@ -18242,7 +18242,7 @@ sub_801FEBC: @ 801FEBC lsls r0, 24 lsrs r0, 24 movs r1, 0 - bl sub_8198070 + bl ClearStdWindowAndFrameToTransparent ldr r0, [r4] ldrb r0, [r0, 0x18] bl ClearWindowTilemap @@ -18470,7 +18470,7 @@ sub_8020094: @ 8020094 lsls r0, 24 lsrs r0, 24 movs r1, 0 - bl sub_8198070 + bl ClearStdWindowAndFrameToTransparent ldr r0, [r4] ldrb r0, [r0, 0x1E] bl ClearWindowTilemap @@ -18913,7 +18913,7 @@ sub_802040C: @ 802040C push {lr} movs r0, 0x3 movs r1, 0 - bl sub_8198070 + bl ClearStdWindowAndFrameToTransparent movs r0, 0x3 bl ClearWindowTilemap pop {r0} @@ -22378,7 +22378,7 @@ _0802210C: movs r1, 0 adds r2, r4, 0 movs r3, 0xD - bl SetWindowBorderStyle + bl DrawStdFrameWithCustomTileAndPalette b _08022218 .pool _08022130: @@ -22509,7 +22509,7 @@ sub_802222C: @ 802222C adds r5, r4, r0 ldrb r0, [r5] movs r1, 0x1 - bl sub_8198070 + bl ClearStdWindowAndFrameToTransparent ldrb r0, [r5] bl RemoveWindow adds r0, r4, 0 @@ -22577,7 +22577,7 @@ _08022296: movs r1, 0 adds r2, r4, 0 movs r3, 0xD - bl SetWindowBorderStyle + bl DrawStdFrameWithCustomTileAndPalette b _080224BA .pool _080222D0: @@ -22773,7 +22773,7 @@ _08022480: _08022494: ldrb r0, [r6, 0x2] movs r1, 0x1 - bl sub_8198070 + bl ClearStdWindowAndFrameToTransparent ldrb r0, [r6, 0x2] bl ClearWindowTilemap ldrb r0, [r6, 0x2] @@ -23864,7 +23864,7 @@ _08022D38: _08022D42: movs r0, 0 movs r1, 0 - bl NewMenuHelpers_DrawDialogueFrame + bl DrawDialogueFrame ldrb r1, [r5, 0x1] movs r0, 0x2 mov r8, r0 @@ -23946,7 +23946,7 @@ _08022DE8: beq _08022DFA movs r0, 0 movs r1, 0x1 - bl ClearWindowAndWideBorder + bl ClearDialogWindowAndFrame _08022DFA: ldrb r0, [r7, 0xE] movs r1, 0x1 @@ -24250,7 +24250,7 @@ _0802301E: _08023044: movs r0, 0 movs r1, 0x1 - bl ClearWindowAndWideBorder + bl ClearDialogWindowAndFrame movs r0, 0xA movs r1, 0x1 movs r2, 0 @@ -26462,7 +26462,7 @@ _080241A6: beq _0802421E movs r0, 0 movs r1, 0 - bl NewMenuHelpers_DrawDialogueFrame + bl DrawDialogueFrame ldr r2, =gText_SavingDontTurnOffPower movs r0, 0 str r0, [sp] @@ -26550,7 +26550,7 @@ _08024246: strb r0, [r5, 0xC] b _080242D8 _0802426A: - bl DisplayYesNoMenu + bl DisplayYesNoMenuWithDefault b _080242D0 _08024270: bl Menu_ProcessInputNoWrapClearOnChoose @@ -26583,7 +26583,7 @@ _080242A4: _080242A6: movs r0, 0 movs r1, 0x1 - bl ClearWindowAndWideBorder + bl ClearDialogWindowAndFrame movs r4, 0 str r4, [sp] adds r0, r6, 0 @@ -26761,7 +26761,7 @@ _080243EA: _080243F6: movs r0, 0 movs r1, 0x1 - bl ClearWindowAndWideBorder + bl ClearDialogWindowAndFrame adds r0, r5, 0 bl sub_8021488 movs r0, 0x1 @@ -26819,7 +26819,7 @@ _0802445A: _08024460: movs r0, 0 movs r1, 0 - bl NewMenuHelpers_DrawDialogueFrame + bl DrawDialogueFrame ldrh r1, [r5, 0x14] cmp r1, 0x3 bne _08024490 @@ -27347,7 +27347,7 @@ sub_802482C: @ 802482C movs r1, 0 adds r2, r4, 0 adds r3, r5, 0 - bl SetWindowBorderStyle + bl DrawStdFrameWithCustomTileAndPalette ldr r2, =gText_Powder movs r0, 0x1 str r0, [sp] @@ -27446,7 +27446,7 @@ sub_8024918: @ 8024918 bl ClearWindowTilemap ldrb r0, [r4] movs r1, 0x1 - bl sub_8198070 + bl ClearStdWindowAndFrameToTransparent ldrb r0, [r4] bl RemoveWindow pop {r4} @@ -38552,7 +38552,7 @@ _0802A3A4: _0802A3AE: movs r0, 0 movs r1, 0 - bl NewMenuHelpers_DrawDialogueFrame + bl DrawDialogueFrame ldr r2, =gText_SavingDontTurnOffPower str r4, [sp] movs r0, 0x2 diff --git a/asm/rom_81D1C44.s b/asm/rom_81D1C44.s index 13664a4b2..eab52bbf4 100644 --- a/asm/rom_81D1C44.s +++ b/asm/rom_81D1C44.s @@ -108,7 +108,7 @@ sub_81D1D04: @ 81D1D04 adds r4, r0 ldrb r0, [r4] movs r1, 0 - bl sub_8198070 + bl ClearStdWindowAndFrameToTransparent ldrb r0, [r4] bl ClearWindowTilemap ldrb r0, [r4] @@ -1613,7 +1613,7 @@ _081D284A: movs r1, 0 movs r2, 0x1 movs r3, 0xE - bl SetWindowBorderStyle + bl DrawStdFrameWithCustomTileAndPalette b _081D288E .pool _081D287C: @@ -1623,7 +1623,7 @@ _081D287C: movs r1, 0 movs r2, 0x1 movs r3, 0xE - bl SetWindowBorderStyle + bl DrawStdFrameWithCustomTileAndPalette _081D288E: movs r0, 0x2 bl PutWindowTilemap @@ -1633,12 +1633,12 @@ _081D288E: movs r1, 0 movs r2, 0x1 movs r3, 0xE - bl SetWindowBorderStyle + bl DrawStdFrameWithCustomTileAndPalette movs r0, 0x3 movs r1, 0 movs r2, 0x1 movs r3, 0xE - bl SetWindowBorderStyle + bl DrawStdFrameWithCustomTileAndPalette bl nullsub_79 movs r0, 0x1 bl schedule_bg_copy_tilemap_to_vram diff --git a/include/menu.h b/include/menu.h index cb017187a..ae89a1ab4 100644 --- a/include/menu.h +++ b/include/menu.h @@ -25,23 +25,23 @@ void InitStandardTextBoxWindows(void); void sub_8197200(void); u16 RunTextPrintersAndIsPrinter0Active(void); void sub_81973A4(void); -void NewMenuHelpers_DrawDialogueFrame(u8, u8); -void ClearWindowAndBorder(u8 windowId, bool8 copyToVram); +void DrawDialogueFrame(u8, u8); +void ClearStdWindowAndFrame(u8 windowId, bool8 copyToVram); u16 AddTextPrinterParameterized2(u8 windowId, u8 fontId, const u8 *str, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16), u8 fgColor, u8 bgColor, u8 shadowColor); void PrintPlayerNameOnWindow(u8, const u8*, u16, u16); void DisplayItemMessageOnField(u8 taskId, const u8 *src, TaskFunc callback); -void ClearWindowAndWideBorder(u8 windowId, bool8 copyToVram); +void ClearDialogWindowAndFrame(u8 windowId, bool8 copyToVram); void SetStandardWindowBorderStyle(u8 a0, u8 a1); -void DisplayYesNoMenu(void); +void DisplayYesNoMenuWithDefault(void); u32 GetPlayerTextSpeed(void); u8 GetPlayerTextSpeedDelay(void); void sub_81978B0(u16 arg0); void AddTextPrinterWithCallbackForMessage(bool8 a1, void (*callback)(struct TextPrinterTemplate *, u16)); void sub_8199DF0(u32 bg, u8 a1, int a2, int a3); void AddTextPrinterParameterized3(u8 windowId, u8 fontId, u8 left, u8 top, const u8 *color, s8 speed, const u8 *str); -void sub_8198070(u8 windowId, bool8 copyToVram); +void ClearStdWindowAndFrameToTransparent(u8 windowId, bool8 copyToVram); void SetWindowTemplateFields(struct WindowTemplate* template, u8 priority, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 palNum, u16 baseBlock); -void SetWindowBorderStyle(u8 windowId, bool8 copyToVram, u16 tileStart, u8 palette); +void DrawStdFrameWithCustomTileAndPalette(u8 windowId, bool8 copyToVram, u16 tileStart, u8 palette); void schedule_bg_copy_tilemap_to_vram(u8 bgNum); void PrintMenuTable(u8 windowId, u8 itemCount, const struct MenuAction *strs); u8 InitMenuInUpperLeftCornerPlaySoundWhenAPressed(u8 windowId, u8 numItems, u8 initialCursorPos); @@ -60,9 +60,9 @@ s8 ProcessMenuInput_other(void); void do_scheduled_bg_tilemap_copies_to_vram(void); void clear_scheduled_bg_copies_to_vram(void); void AddTextPrinterParameterized4(u8 windowId, u8 fontId, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, const u8 *color, s8 speed, const u8 *str); -void sub_8197B1C(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_8197DF8(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); u16 copy_decompressed_tile_data_to_vram(u8 bgId, const void *src, u16 size, u16 offset, u8 mode); @@ -75,13 +75,13 @@ u8 GetStartMenuWindowId(void); void sub_819A2BC(u8, u8); u8 Menu_MoveCursor(s8 cursorDelta); u8 Menu_MoveCursorNoWrapAround(s8 cursorDelta); -void NewMenuHelpers_DrawStdWindowFrame(u8 windowId, bool8 CopyToVram); +void DrawStdWindowFrame(u8 windowId, bool8 CopyToVram); u8 sub_81979C4(u8 a1); u8 sub_81983AC(u8 windowId, u8 fontId, u8 left, u8 top, u8 cursorHeight, u8 numChoices, u8 initialCursorPos); void sub_819786C(u8 windowId, bool8 copyToVram); void AddTextPrinterForMessage_2(bool8 allowSkippingDelayWithButtonPress); void RemoveStartMenuWindow(void); -void sub_8197948(u8 initialCursorPos); +void DisplayYesNoMenuWithDefaultDefaultNo(u8 initialCursorPos); void sub_819A344(u8 a0, u8 *dest, u8 color); void RemoveMapNamePopUpWindow(void); u8 GetMapNamePopUpWindowId(void); diff --git a/include/window.h b/include/window.h index 1daee39ef..ece1ecd21 100644 --- a/include/window.h +++ b/include/window.h @@ -75,7 +75,4 @@ extern u32 filler_03002F58; extern u32 filler_03002F5C; extern u32 filler_03002F64; -// This global is set to 0 and never changed. -extern u8 gTransparentTileNumber; - #endif // GUARD_WINDOW_H diff --git a/src/apprentice.c b/src/apprentice.c index 9cf8cd4b4..27ff8e36e 100644 --- a/src/apprentice.c +++ b/src/apprentice.c @@ -1619,7 +1619,7 @@ static u8 CreateAndShowWindow(u8 left, u8 top, u8 width, u8 height) static void RemoveAndHideWindow(u8 windowId) { - sub_8198070(windowId, TRUE); + ClearStdWindowAndFrameToTransparent(windowId, TRUE); RemoveWindow(windowId); } @@ -1826,7 +1826,7 @@ static void Script_PrintMessage(void) FreezeEventObjects(); sub_808B864(); sub_808BCF4(); - NewMenuHelpers_DrawDialogueFrame(0, 1); + DrawDialogueFrame(0, 1); PrintMessage(); } diff --git a/src/battle_pyramid_bag.c b/src/battle_pyramid_bag.c index 510356215..20029b284 100644 --- a/src/battle_pyramid_bag.c +++ b/src/battle_pyramid_bag.c @@ -1146,7 +1146,7 @@ static void sub_81C64B4(u8 taskId) else if (gMain.newKeys & A_BUTTON) { PlaySE(SE_SELECT); - sub_8198070(3, 0); + ClearStdWindowAndFrameToTransparent(3, 0); ClearWindowTilemap(3); schedule_bg_copy_tilemap_to_vram(1); sub_81C6350(taskId); @@ -1154,7 +1154,7 @@ static void sub_81C64B4(u8 taskId) else if (gMain.newKeys & B_BUTTON) { PlaySE(SE_SELECT); - sub_8198070(3, 0); + ClearStdWindowAndFrameToTransparent(3, 0); ClearWindowTilemap(3); schedule_bg_copy_tilemap_to_vram(1); DontTossItem(taskId); @@ -1415,7 +1415,7 @@ static void PrintOnWindow_Font7(u8 windowId, const u8 *src, u8 x, u8 y, u8 lette static void sub_81C6CEC(u8 windowId) { - SetWindowBorderStyle(windowId, 0, 1, 0xE); + DrawStdFrameWithCustomTileAndPalette(windowId, 0, 1, 0xE); schedule_bg_copy_tilemap_to_vram(1); } @@ -1430,7 +1430,7 @@ static u8 sub_81C6D24(u8 windowArrayId) if (*windowId == 0xFF) { *windowId = AddWindow(&gUnknown_0861F350[windowArrayId]); - SetWindowBorderStyle(*windowId, FALSE, 1, 0xE); + DrawStdFrameWithCustomTileAndPalette(*windowId, FALSE, 1, 0xE); schedule_bg_copy_tilemap_to_vram(1); } return *windowId; @@ -1441,7 +1441,7 @@ static void sub_81C6D6C(u8 windowArrayId) u8 *windowId = &gPyramidBagResources->windowIds[windowArrayId]; if (*windowId != 0xFF) { - sub_8198070(*windowId, FALSE); + ClearStdWindowAndFrameToTransparent(*windowId, FALSE); ClearWindowTilemap(*windowId); RemoveWindow(*windowId); schedule_bg_copy_tilemap_to_vram(1); @@ -1463,7 +1463,8 @@ void DisplayItemMessageInBattlePyramid(u8 taskId, const u8 *str, void (*callback static void sub_81C6E1C(void) { - sub_8197DF8(2, FALSE); + ClearDialogWindowAndFrameToTransparent(2, FALSE); + // This ClearWindowTilemap call is redundant, since ClearDialogWindowAndFrameToTransparent already calls it. ClearWindowTilemap(2); schedule_bg_copy_tilemap_to_vram(1); } diff --git a/src/battle_records.c b/src/battle_records.c index eb41dcc94..03d2088b4 100644 --- a/src/battle_records.c +++ b/src/battle_records.c @@ -320,7 +320,7 @@ void ShowLinkBattleRecords(void) s32 i, x; gRecordsWindowId = AddWindow(&sLinkBattleRecordsWindow); - NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, FALSE); + DrawStdWindowFrame(gRecordsWindowId, FALSE); FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); StringExpandPlaceholders(gStringVar4, gText_PlayersBattleResults); @@ -342,7 +342,7 @@ void ShowLinkBattleRecords(void) void RemoveRecordsWindow(void) { - ClearWindowAndBorder(gRecordsWindowId, FALSE); + ClearStdWindowAndFrame(gRecordsWindowId, FALSE); RemoveWindow(gRecordsWindowId); } diff --git a/src/berry_blender.c b/src/berry_blender.c index 0a35c672f..35749db54 100644 --- a/src/berry_blender.c +++ b/src/berry_blender.c @@ -1251,7 +1251,7 @@ static void sub_8080018(void) case 10: if (++sBerryBlenderData->framesToWait > 20) { - sub_8197DF8(4, TRUE); + ClearDialogWindowAndFrameToTransparent(4, TRUE); if (GetBlockReceivedStatus() == sub_800A9D8()) { for (i = 0; i < GetLinkPlayerCount(); i++) @@ -3325,7 +3325,7 @@ static bool8 Blender_PrintBlendingResults(void) sBerryBlenderData->mainState++; break; case 5: - sub_8198070(5, 1); + ClearStdWindowAndFrameToTransparent(5, 1); for (i = 0; i < BLENDER_MAX_PLAYERS; i++) { @@ -3466,7 +3466,7 @@ static bool8 Blender_PrintBlendingRanking(void) } break; case 3: - SetWindowBorderStyle(5, 0, 1, 0xD); + DrawStdFrameWithCustomTileAndPalette(5, 0, 1, 0xD); xPos = GetStringCenterAlignXOffset(1, sText_Ranking, 0xA8); Blender_AddTextPrinter(5, sText_Ranking, xPos, 1, TEXT_SPEED_FF, 0); @@ -3537,7 +3537,7 @@ void ShowBerryBlenderRecordWindow(void) winTemplate = sBlenderRecordWindowTemplate; gRecordsWindowId = AddWindow(&winTemplate); - NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, 0); + DrawStdWindowFrame(gRecordsWindowId, 0); FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); xPos = GetStringCenterAlignXOffset(1, gText_BlenderMaxSpeedRecord, 0x90); @@ -3658,7 +3658,7 @@ static bool32 Blender_PrintText(s16 *textState, const u8 *string, s32 textSpeed) switch (*textState) { case 0: - sub_8197B1C(4, FALSE, 0x14, 0xF); + DrawDialogFrameWithCustomTileAndPalette(4, FALSE, 0x14, 0xF); Blender_AddTextPrinter(4, string, 0, 1, textSpeed, 0); PutWindowTilemap(4); CopyWindowToVram(4, 3); diff --git a/src/cable_club.c b/src/cable_club.c index f8137fd8f..dfef39975 100644 --- a/src/cable_club.c +++ b/src/cable_club.c @@ -93,8 +93,8 @@ static void sub_80B23B0(u16 windowId, u32 value) static void sub_80B241C(u16 windowId) { // Following this call with a copy-to-vram with mode 3 is identical to - // calling ClearWindowAndBorder(windowId, TRUE). - ClearWindowAndBorder(windowId, FALSE); + // calling ClearStdWindowAndFrame(windowId, TRUE). + ClearStdWindowAndFrame(windowId, FALSE); CopyWindowToVram(windowId, 3); } diff --git a/src/clear_save_data_screen.c b/src/clear_save_data_screen.c index 7fdd101e2..619b39410 100644 --- a/src/clear_save_data_screen.c +++ b/src/clear_save_data_screen.c @@ -79,7 +79,7 @@ void CB2_InitClearSaveDataScreen(void) static void Task_DoClearSaveDataScreenYesNo(u8 taskId) { - SetWindowBorderStyle(0, 0, 2, 14); + DrawStdFrameWithCustomTileAndPalette(0, 0, 2, 14); AddTextPrinterParameterized(0, 1, gText_ClearAllSaveData, 0, 1, 0, 0); CreateYesNoMenu(sClearSaveYesNo, 2, 14, 1); gTasks[taskId].func = Task_ClearSaveDataScreenYesNoChoice; diff --git a/src/coins.c b/src/coins.c index c6fbf1216..a8d8eae06 100644 --- a/src/coins.c +++ b/src/coins.c @@ -29,13 +29,13 @@ void ShowCoinsWindow(u32 coinAmount, u8 x, u8 y) sCoinsWindowId = AddWindow(&template); FillWindowPixelBuffer(sCoinsWindowId, PALETTE_NUM_TO_FILL_VALUE(0)); PutWindowTilemap(sCoinsWindowId); - SetWindowBorderStyle(sCoinsWindowId, FALSE, 0x214, 0xE); + DrawStdFrameWithCustomTileAndPalette(sCoinsWindowId, FALSE, 0x214, 0xE); PrintCoinsString(coinAmount); } void HideCoinsWindow(void) { - ClearWindowAndBorder(sCoinsWindowId, TRUE); + ClearStdWindowAndFrame(sCoinsWindowId, TRUE); RemoveWindow(sCoinsWindowId); } diff --git a/src/daycare.c b/src/daycare.c index 14120f20b..885ac31a1 100644 --- a/src/daycare.c +++ b/src/daycare.c @@ -1259,7 +1259,7 @@ static void Task_HandleDaycareLevelMenuInput(u8 taskId) break; } DestroyListMenuTask(gTasks[taskId].tMenuListTaskId, NULL, NULL); - ClearWindowAndBorder(gTasks[taskId].tWindowId, TRUE); + ClearStdWindowAndFrame(gTasks[taskId].tWindowId, TRUE); RemoveWindow(gTasks[taskId].tWindowId); DestroyTask(taskId); EnableBothScriptContexts(); @@ -1268,7 +1268,7 @@ static void Task_HandleDaycareLevelMenuInput(u8 taskId) { gSpecialVar_Result = 2; DestroyListMenuTask(gTasks[taskId].tMenuListTaskId, NULL, NULL); - ClearWindowAndBorder(gTasks[taskId].tWindowId, TRUE); + ClearStdWindowAndFrame(gTasks[taskId].tWindowId, TRUE); RemoveWindow(gTasks[taskId].tWindowId); DestroyTask(taskId); EnableBothScriptContexts(); @@ -1283,7 +1283,7 @@ void ShowDaycareLevelMenu(void) u8 daycareMenuTaskId; windowId = AddWindow(&sDaycareLevelMenuWindowTemplate); - NewMenuHelpers_DrawStdWindowFrame(windowId, FALSE); + DrawStdWindowFrame(windowId, FALSE); menuTemplate = sDaycareListMenuLevelTemplate; menuTemplate.windowId = windowId; diff --git a/src/decoration.c b/src/decoration.c index c3434522d..98c3ef028 100644 --- a/src/decoration.c +++ b/src/decoration.c @@ -463,14 +463,14 @@ u8 sub_81269D4(u8 idx) { *winidx = AddWindow(&gUnknown_085A6B90[idx]); } - SetWindowBorderStyle(*winidx, 0, 0x214, 0xe); + DrawStdFrameWithCustomTileAndPalette(*winidx, 0, 0x214, 0xe); schedule_bg_copy_tilemap_to_vram(0); return *winidx; } void sub_8126A58(u8 idx) { - sub_8198070(sDecorMenuWindowIndices[idx], FALSE); + ClearStdWindowAndFrameToTransparent(sDecorMenuWindowIndices[idx], FALSE); ClearWindowTilemap(sDecorMenuWindowIndices[idx]); RemoveWindow(sDecorMenuWindowIndices[idx]); schedule_bg_copy_tilemap_to_vram(0); @@ -572,7 +572,7 @@ void SecretBasePC_PutAway(u8 taskId) else { sub_8126A58(0); - ClearWindowAndWideBorder(0, 0); + ClearDialogWindowAndFrame(0, 0); FadeScreen(1, 0); gTasks[taskId].data[2] = 0; gTasks[taskId].func = sub_8129ABC; @@ -617,7 +617,7 @@ void sub_8126DA4(u8 taskId) void SecretBasePC_PrepMenuForSelectingStoredDecors(u8 taskId) { LoadPalette(gUnknown_085A6BB0, 0xd0, 0x20); - ClearWindowAndWideBorder(0, 0); + ClearDialogWindowAndFrame(0, 0); sub_8126A58(0); sub_8126DFC(taskId); } @@ -751,7 +751,7 @@ void sub_81270E8(u8 taskId) void sub_8127180(u8 taskId) { - ClearWindowAndWideBorder(0, 0); + ClearDialogWindowAndFrame(0, 0); sub_8126DFC(taskId); } @@ -771,7 +771,7 @@ void sub_81271CC(u8 taskId) { sub_8126A58(1); sub_8126A88(); - NewMenuHelpers_DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, 0); sub_8126C08(); gTasks[taskId].func = sub_8126B80; } @@ -779,7 +779,7 @@ void sub_81271CC(u8 taskId) void sub_8127208(u8 taskId) { LoadPalette(gUnknown_085A6BB0, 0xd0, 0x20); - ClearWindowAndWideBorder(0, 0); + ClearDialogWindowAndFrame(0, 0); gTasks[taskId].data[11] = 2; sCurDecorationCategory = DECORCAT_DESK; sub_8126DFC(taskId); @@ -1095,7 +1095,7 @@ void sub_8127A14(u8 taskId) void sub_8127A30(u8 taskId) { - ClearWindowAndWideBorder(0, 0); + ClearDialogWindowAndFrame(0, 0); gTasks[taskId].func = sub_8127A14; } @@ -1103,7 +1103,7 @@ void sub_8127A5C(u8 taskId) { if (gMain.newKeys & (A_BUTTON | B_BUTTON)) { - ClearWindowAndWideBorder(0, 0); + ClearDialogWindowAndFrame(0, 0); sub_81269D4(1); sub_8127620(taskId); } @@ -1628,13 +1628,13 @@ void sub_8128950(u8 taskId) void sub_81289D0(u8 taskId) { - DisplayYesNoMenu(); + DisplayYesNoMenuWithDefault(); DoYesNoFuncWithChoice(taskId, &gUnknown_085A72C4); } void sub_81289F0(u8 taskId) { - ClearWindowAndWideBorder(0, 0); + ClearDialogWindowAndFrame(0, 0); sub_8128AAC(taskId); if (gDecorations[gCurDecorInventoryItems[gCurDecorationIndex]].permission != DECORPERM_SOLID_MAT) { @@ -1693,13 +1693,13 @@ void sub_8128AAC(u8 taskId) void sub_8128B80(u8 taskId) { - DisplayYesNoMenu(); + DisplayYesNoMenuWithDefault(); DoYesNoFuncWithChoice(taskId, &gUnknown_085A72CC); } void sub_8128BA0(u8 taskId) { - ClearWindowAndWideBorder(0, 0); + ClearDialogWindowAndFrame(0, 0); sub_8128BBC(taskId); } @@ -1887,7 +1887,7 @@ void sub_8128E18(u8 taskId) void sub_8128FD8(u8 taskId) { - ClearWindowAndWideBorder(0, 1); + ClearDialogWindowAndFrame(0, 1); gSprites[sDecor_CameraSpriteObjectIdx1].data[7] = 0; gTasks[taskId].data[10] = 0; gTasks[taskId].func = sub_8128E18; @@ -2251,7 +2251,7 @@ void sub_81298EC(u8 taskId) if (!gPaletteFade.active) { DrawWholeMapView(); ScriptContext1_SetupScript(EventScript_275D2E); - ClearWindowAndWideBorder(0, 1); + ClearDialogWindowAndFrame(0, 1); gTasks[taskId].data[2] = 2; } break; @@ -2343,7 +2343,7 @@ void sub_8129ABC(u8 taskId) void sub_8129B34(u8 taskId) { - ClearWindowAndWideBorder(0, 1); + ClearDialogWindowAndFrame(0, 1); gSprites[sDecor_CameraSpriteObjectIdx1].data[7] = 0; gSprites[sDecor_CameraSpriteObjectIdx1].invisible = FALSE; gSprites[sDecor_CameraSpriteObjectIdx1].callback = sub_812A36C; @@ -2588,7 +2588,7 @@ void sub_812A0E8(u8 taskId) void sub_812A1A0(u8 taskId) { - DisplayYesNoMenu(); + DisplayYesNoMenuWithDefault(); DoYesNoFuncWithChoice(taskId, &gUnknown_085A7348); } @@ -2601,13 +2601,13 @@ void sub_812A1C0(u8 taskId) void sub_812A1F0(u8 taskId) { - DisplayYesNoMenu(); + DisplayYesNoMenuWithDefault(); DoYesNoFuncWithChoice(taskId, &gUnknown_085A7350); } void sub_812A210(u8 taskId) { - ClearWindowAndWideBorder(0, 0); + ClearDialogWindowAndFrame(0, 0); sub_812A22C(taskId); } @@ -2671,7 +2671,7 @@ void sub_812A334(void) u8 taskId; pal_fill_black(); - NewMenuHelpers_DrawDialogueFrame(0, 1); + DrawDialogueFrame(0, 1); sub_8126ABC(); taskId = CreateTask(sub_812A2C4, 8); gTasks[taskId].data[2] = 0; @@ -2725,7 +2725,7 @@ void sub_812A3D4(u8 taskId) void sub_812A458(u8 taskId) { - DisplayYesNoMenu(); + DisplayYesNoMenuWithDefault(); DoYesNoFuncWithChoice(taskId, &gUnknown_085A741C); } diff --git a/src/field_message_box.c b/src/field_message_box.c index 111807240..ac5e7a4bb 100755 --- a/src/field_message_box.c +++ b/src/field_message_box.c @@ -33,7 +33,7 @@ static void sub_8098154(u8 taskId) task->data[0]++; break; case 1: - NewMenuHelpers_DrawDialogueFrame(0, 1); + DrawDialogueFrame(0, 1); task->data[0]++; break; case 2: @@ -127,7 +127,7 @@ static void textbox_auto_and_task_add(void) void HideFieldMessageBox(void) { task_del_textbox(); - ClearWindowAndWideBorder(0, 1); + ClearDialogWindowAndFrame(0, 1); sFieldMessageBoxMode = 0; } @@ -146,7 +146,7 @@ bool8 IsFieldMessageBoxHidden(void) void sub_8098358(void) { task_del_textbox(); - NewMenuHelpers_DrawStdWindowFrame(0, 1); + DrawStdWindowFrame(0, 1); sFieldMessageBoxMode = 0; } diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index ddaaa208b..4ab3cb21e 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -1944,7 +1944,7 @@ static bool8 Fishing11(struct Task *task) sub_8155604(gEventObjects[gPlayerAvatar.eventObjectId].fieldEffectSpriteId, 0, 0); gSprites[gPlayerAvatar.spriteId].pos2.x = 0; gSprites[gPlayerAvatar.spriteId].pos2.y = 0; - ClearWindowAndWideBorder(0, TRUE); + ClearDialogWindowAndFrame(0, TRUE); task->tFrameCounter++; return FALSE; } @@ -2017,7 +2017,7 @@ static bool8 Fishing16(struct Task *task) gPlayerAvatar.preventStep = FALSE; ScriptContext2_Disable(); UnfreezeEventObjects(); - ClearWindowAndWideBorder(0, TRUE); + ClearDialogWindowAndFrame(0, TRUE); sub_80ED950(0); DestroyTask(FindTaskIdByFunc(Task_Fishing)); } diff --git a/src/field_region_map.c b/src/field_region_map.c index e128c7084..850e84554 100644 --- a/src/field_region_map.c +++ b/src/field_region_map.c @@ -139,11 +139,11 @@ static void FieldUpdateRegionMap(void) sFieldRegionMapHandler->state++; break; case 1: - SetWindowBorderStyle(1, 0, 0x27, 0xd); + DrawStdFrameWithCustomTileAndPalette(1, 0, 0x27, 0xd); offset = GetStringCenterAlignXOffset(1, gText_Hoenn, 0x38); AddTextPrinterParameterized(1, 1, gText_Hoenn, offset, 1, 0, NULL); schedule_bg_copy_tilemap_to_vram(0); - SetWindowBorderStyle(0, 0, 0x27, 0xd); + DrawStdFrameWithCustomTileAndPalette(0, 0, 0x27, 0xd); PrintRegionMapSecName(); BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0); sFieldRegionMapHandler->state++; diff --git a/src/field_specials.c b/src/field_specials.c index 62d3b8e59..bdac426bd 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -1859,7 +1859,7 @@ void sub_8139B60(void) void sub_8139C10(void) { - sub_8198070(gUnknown_0203AB5E, TRUE); + ClearStdWindowAndFrameToTransparent(gUnknown_0203AB5E, TRUE); RemoveWindow(gUnknown_0203AB5E); } @@ -2644,7 +2644,7 @@ static void sub_813A570(u8 taskId) sub_813A738(taskId); DestroyListMenuTask(task->data[14], NULL, NULL); Free(gUnknown_0203AB64); - sub_8198070(task->data[13], 1); + ClearStdWindowAndFrameToTransparent(task->data[13], 1); FillWindowPixelBuffer(task->data[13], PALETTE_NUM_TO_FILL_VALUE(0)); CopyWindowToVram(task->data[13], 2); RemoveWindow(task->data[13]); @@ -2889,7 +2889,7 @@ void sub_813A958(void) void sub_813A988(void) { - sub_8198070(gUnknown_0203AB6D, TRUE); + ClearStdWindowAndFrameToTransparent(gUnknown_0203AB6D, TRUE); RemoveWindow(gUnknown_0203AB6D); } @@ -2941,7 +2941,7 @@ void sub_813AA18(void) void sub_813AA44(void) { - sub_8198070(gUnknown_0203AB6E, TRUE); + ClearStdWindowAndFrameToTransparent(gUnknown_0203AB6E, TRUE); RemoveWindow(gUnknown_0203AB6E); } @@ -3153,7 +3153,7 @@ static void sub_813AD34(u8 a0, u16 a1) void sub_813ADB8(void) { - sub_8198070(gUnknown_0203AB5E, TRUE); + ClearStdWindowAndFrameToTransparent(gUnknown_0203AB5E, TRUE); RemoveWindow(gUnknown_0203AB5E); } @@ -3225,7 +3225,7 @@ void sub_813AF48(void) struct Task *task = &gTasks[taskId]; DestroyListMenuTask(task->data[14], NULL, NULL); Free(gUnknown_0203AB64); - sub_8198070(task->data[13], TRUE); + ClearStdWindowAndFrameToTransparent(task->data[13], TRUE); FillWindowPixelBuffer(task->data[13], PALETTE_NUM_TO_FILL_VALUE(0)); ClearWindowTilemap(task->data[13]); CopyWindowToVram(task->data[13], 2); diff --git a/src/fldeff_softboiled.c b/src/fldeff_softboiled.c index adec780b3..eca7d045b 100644 --- a/src/fldeff_softboiled.c +++ b/src/fldeff_softboiled.c @@ -86,7 +86,7 @@ static void sub_8161724(u8 taskId) sub_81B0FCC(gUnknown_0203CEC8.unk9, 0); gUnknown_0203CEC8.unk9 = gUnknown_0203CEC8.unkA; sub_81B0FCC(gUnknown_0203CEC8.unkA, 1); - sub_8198070(0x6, FALSE); + ClearStdWindowAndFrameToTransparent(0x6, FALSE); ClearWindowTilemap(0x6); display_pokemon_menu_message(0); gTasks[taskId].func = sub_81B1370; diff --git a/src/frontier_util.c b/src/frontier_util.c index 5846616b7..ec7327ca3 100644 --- a/src/frontier_util.c +++ b/src/frontier_util.c @@ -1044,7 +1044,7 @@ static void TowerPrintPrevOrCurrentStreak(u8 battleMode, u8 lvlMode, u8 x1, u8 x static void ShowTowerResultsWindow(u8 battleMode) { gRecordsWindowId = AddWindow(&gUnknown_08611C74); - NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, FALSE); + DrawStdWindowFrame(gRecordsWindowId, FALSE); FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); if (battleMode == FRONTIER_MODE_SINGLES) StringExpandPlaceholders(gStringVar4, gText_SingleBattleRoomResults); @@ -1115,7 +1115,7 @@ static void DomePrintPrevOrCurrentStreak(u8 battleMode, u8 lvlMode, u8 x1, u8 x2 static void ShowDomeResultsWindow(u8 battleMode) { gRecordsWindowId = AddWindow(&gUnknown_08611C74); - NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, FALSE); + DrawStdWindowFrame(gRecordsWindowId, FALSE); FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); if (battleMode == FRONTIER_MODE_SINGLES) StringExpandPlaceholders(gStringVar4, gText_SingleBattleTourneyResults); @@ -1191,7 +1191,7 @@ static void PalacePrintPrevOrCurrentStreak(u8 battleMode, u8 lvlMode, u8 x1, u8 static void ShowPalaceResultsWindow(u8 battleMode) { gRecordsWindowId = AddWindow(&gUnknown_08611C74); - NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, FALSE); + DrawStdWindowFrame(gRecordsWindowId, FALSE); FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); if (battleMode == FRONTIER_MODE_SINGLES) StringExpandPlaceholders(gStringVar4, gText_SingleBattleHallResults); @@ -1247,7 +1247,7 @@ static void PikePrintPrevOrCurrentStreak(u8 lvlMode, u8 x1, u8 x2, u8 y) static void ShowPikeResultsWindow(void) { gRecordsWindowId = AddWindow(&gUnknown_08611C74); - NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, FALSE); + DrawStdWindowFrame(gRecordsWindowId, FALSE); FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); StringExpandPlaceholders(gStringVar4, gText_BattleChoiceResults); PrintAligned(gStringVar4, 0); @@ -1309,7 +1309,7 @@ static void ArenaPrintPrevOrCurrentStreak(u8 lvlMode, u8 x1, u8 x2, u8 y) static void ShowArenaResultsWindow(void) { gRecordsWindowId = AddWindow(&gUnknown_08611C74); - NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, FALSE); + DrawStdWindowFrame(gRecordsWindowId, FALSE); FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); PrintHyphens(10); StringExpandPlaceholders(gStringVar4, gText_SetKOTourneyResults); @@ -1395,7 +1395,7 @@ static void FactoryPrintPrevOrCurrentStreak(u8 battleMode, u8 lvlMode, u8 x1, u8 static void ShowFactoryResultsWindow(u8 battleMode) { gRecordsWindowId = AddWindow(&gUnknown_08611C74); - NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, FALSE); + DrawStdWindowFrame(gRecordsWindowId, FALSE); FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); if (battleMode == FRONTIER_MODE_SINGLES) StringExpandPlaceholders(gStringVar4, gText_BattleSwapSingleResults); @@ -1460,7 +1460,7 @@ static void PyramidPrintPrevOrCurrentStreak(u8 lvlMode, u8 x1, u8 x2, u8 y) static void ShowPyramidResultsWindow(void) { gRecordsWindowId = AddWindow(&gUnknown_08611C74); - NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, FALSE); + DrawStdWindowFrame(gRecordsWindowId, FALSE); FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); StringExpandPlaceholders(gStringVar4, gText_BattleQuestResults); PrintAligned(gStringVar4, 2); @@ -1483,7 +1483,7 @@ static void ShowLinkContestResultsWindow(void) s32 x; gRecordsWindowId = AddWindow(&gUnknown_08611C7C); - NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, FALSE); + DrawStdWindowFrame(gRecordsWindowId, FALSE); FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); StringExpandPlaceholders(gStringVar4, gText_LinkContestResults); @@ -2353,7 +2353,7 @@ static void PrintHallRecords(s32 hallFacilityId, s32 lvlMode) void ShowRankingHallRecordsWindow(void) { gRecordsWindowId = AddWindow(&gUnknown_08611C84); - NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, FALSE); + DrawStdWindowFrame(gRecordsWindowId, FALSE); FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); PrintHallRecords(gSpecialVar_0x8005, FRONTIER_LVL_50); PutWindowTilemap(gRecordsWindowId); diff --git a/src/hall_of_fame.c b/src/hall_of_fame.c index b25342021..d3b94cff6 100644 --- a/src/hall_of_fame.c +++ b/src/hall_of_fame.c @@ -490,7 +490,7 @@ static void Task_Hof_InitTeamSaveData(u8 taskId) } *lastSavedTeam = *sHofMonPtr; - NewMenuHelpers_DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, 0); AddTextPrinterParameterized2(0, 1, gText_SavingDontTurnOffPower, 0, NULL, 2, 1, 3); CopyWindowToVram(0, 3); gTasks[taskId].func = Task_Hof_TrySaveData; @@ -570,7 +570,7 @@ static void Task_Hof_DisplayMon(u8 taskId) gSprites[spriteId].tSpecies = currMon->species; gSprites[spriteId].callback = SpriteCB_GetOnScreenAndAnimate; gTasks[taskId].tMonSpriteId(currMonId) = spriteId; - ClearWindowAndWideBorder(0, TRUE); + ClearDialogWindowAndFrame(0, TRUE); gTasks[taskId].func = Task_Hof_PrintMonInfoAfterAnimating; } @@ -697,7 +697,7 @@ static void Task_Hof_WaitAndPrintPlayerInfo(u8 taskId) { FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 0x20, 0x20); HallOfFame_PrintPlayerInfo(1, 2); - NewMenuHelpers_DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, 0); AddTextPrinterParameterized2(0, 1, gText_LeagueChamp, 0, NULL, 2, 1, 3); CopyWindowToVram(0, 3); gTasks[taskId].func = Task_Hof_ExitOnKeyPressed; @@ -1066,7 +1066,7 @@ static void Task_HofPC_HandleExit(u8 taskId) static void Task_HofPC_PrintDataIsCorrupted(u8 taskId) { sub_8198180(gText_UnkCtrlF800Exit, 8, TRUE); - NewMenuHelpers_DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, 0); AddTextPrinterParameterized2(0, 1, gText_HOFCorrupted, 0, NULL, 2, 1, 3); CopyWindowToVram(0, 3); gTasks[taskId].func = Task_HofPC_ExitOnButtonPress; @@ -1182,7 +1182,7 @@ static void HallOfFame_PrintPlayerInfo(u8 unused1, u8 unused2) FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(1)); PutWindowTilemap(1); - SetWindowBorderStyle(1, FALSE, 0x21D, 0xD); + DrawStdFrameWithCustomTileAndPalette(1, FALSE, 0x21D, 0xD); AddTextPrinterParameterized3(1, 1, 0, 1, sUnknown_085E538C, -1, gText_Name); width = GetStringRightAlignXOffset(1, gSaveBlock2Ptr->playerName, 0x70); diff --git a/src/item_menu.c b/src/item_menu.c index ae24c8a03..f561ebb36 100755 --- a/src/item_menu.c +++ b/src/item_menu.c @@ -2306,7 +2306,7 @@ u8 bag_menu_add_window(u8 a) if (*ptr == 0xFF) { *ptr = AddWindow(&gUnknown_086141AC[a]); - SetWindowBorderStyle(*ptr, 0, 1, 14); + DrawStdFrameWithCustomTileAndPalette(*ptr, 0, 1, 14); schedule_bg_copy_tilemap_to_vram(1); } return *ptr; @@ -2317,7 +2317,7 @@ void bag_menu_remove_window(u8 a) u8 *ptr = &gUnknown_0203CE54->windowPointers[a]; if (*ptr != 0xFF) { - sub_8198070(*ptr, 0); + ClearStdWindowAndFrameToTransparent(*ptr, 0); ClearWindowTilemap(*ptr); RemoveWindow(*ptr); schedule_bg_copy_tilemap_to_vram(1); @@ -2338,7 +2338,8 @@ void bag_menu_RemoveBagItem_message_window(u8 a) u8 *ptr = &gUnknown_0203CE54->windowPointers[a]; if (*ptr != 0xFF) { - sub_8197DF8(*ptr, 0); + ClearDialogWindowAndFrameToTransparent(*ptr, FALSE); + // This ClearWindowTilemap call is redundant, since ClearDialogWindowAndFrameToTransparent already calls it. ClearWindowTilemap(*ptr); RemoveWindow(*ptr); schedule_bg_copy_tilemap_to_vram(1); diff --git a/src/item_use.c b/src/item_use.c index 81f4b7b54..2281cc198 100755 --- a/src/item_use.c +++ b/src/item_use.c @@ -188,7 +188,7 @@ void DisplayCannotDismountBikeMessage(u8 taskId, bool8 isUsingRegisteredKeyItemO void CleanUpAfterFailingToUseRegisteredKeyItemOnField(u8 taskId) { - ClearWindowAndWideBorder(0, 1); + ClearDialogWindowAndFrame(0, 1); DestroyTask(taskId); ScriptUnfreezeEventObjects(); ScriptContext2_Disable(); @@ -350,7 +350,7 @@ void sub_80FD504(u8 taskId) void sub_80FD5CC(u8 taskId) { - ClearWindowAndWideBorder(0, 1); + ClearDialogWindowAndFrame(0, 1); ScriptUnfreezeEventObjects(); ScriptContext2_Disable(); DestroyTask(taskId); diff --git a/src/list_menu.c b/src/list_menu.c index 656ab7a15..b8e186348 100644 --- a/src/list_menu.c +++ b/src/list_menu.c @@ -355,11 +355,11 @@ s32 DoMysteryGiftListMenu(struct WindowTemplate *windowTemplate, struct ListMenu switch (arg2) { case 0: // can never be reached, because of the if statement above - ClearWindowAndBorder(sMysteryGiftLinkMenu.windowId, FALSE); + ClearStdWindowAndFrame(sMysteryGiftLinkMenu.windowId, FALSE); break; case 2: case 1: - ClearWindowAndBorder(sMysteryGiftLinkMenu.windowId, FALSE); + ClearStdWindowAndFrame(sMysteryGiftLinkMenu.windowId, FALSE); break; } } diff --git a/src/main_menu.c b/src/main_menu.c index cb39f036e..6ad1776f8 100644 --- a/src/main_menu.c +++ b/src/main_menu.c @@ -944,14 +944,14 @@ static void Task_HandleMainMenuAPressed(u8 taskId) { if (gTasks[taskId].tMenuType == HAS_MYSTERY_EVENTS) RemoveScrollIndicatorArrowPair(gTasks[taskId].tScrollArrowTaskId); - ClearWindowAndBorder(0, TRUE); - ClearWindowAndBorder(1, TRUE); - ClearWindowAndBorder(2, TRUE); - ClearWindowAndBorder(3, TRUE); - ClearWindowAndBorder(4, TRUE); - ClearWindowAndBorder(5, TRUE); - ClearWindowAndBorder(6, TRUE); - ClearWindowAndBorder(7, TRUE); + ClearStdWindowAndFrame(0, TRUE); + ClearStdWindowAndFrame(1, TRUE); + ClearStdWindowAndFrame(2, TRUE); + ClearStdWindowAndFrame(3, TRUE); + ClearStdWindowAndFrame(4, TRUE); + ClearStdWindowAndFrame(5, TRUE); + ClearStdWindowAndFrame(6, TRUE); + ClearStdWindowAndFrame(7, TRUE); wirelessAdapterConnected = IsWirelessAdapterConnected(); switch (gTasks[taskId].tMenuType) { diff --git a/src/map_name_popup.c b/src/map_name_popup.c index 30b04c21d..8936198ae 100644 --- a/src/map_name_popup.c +++ b/src/map_name_popup.c @@ -276,7 +276,7 @@ static void Task_MapNamePopUpWindow(u8 taskId) } break; case 4: - ClearWindowAndBorder(GetMapNamePopUpWindowId(), TRUE); + ClearStdWindowAndFrame(GetMapNamePopUpWindowId(), TRUE); task->data[0] = 5; break; case 5: @@ -290,7 +290,7 @@ void HideMapNamePopUpWindow(void) { if (FuncIsActiveTask(Task_MapNamePopUpWindow)) { - ClearWindowAndBorder(GetMapNamePopUpWindowId(), TRUE); + ClearStdWindowAndFrame(GetMapNamePopUpWindowId(), TRUE); RemoveMapNamePopUpWindow(); SetGpuReg_ForcedBlank(REG_OFFSET_BG0VOFS, 0); DestroyTask(sPopupTaskId); diff --git a/src/mauville_old_man.c b/src/mauville_old_man.c index fd8e74c0a..ec5cb238b 100644 --- a/src/mauville_old_man.c +++ b/src/mauville_old_man.c @@ -437,7 +437,7 @@ static void BardSong_TextSubPrinter(struct TextPrinterTemplate * printer, u16 a1 static void sub_8120708(const u8 * src) { - NewMenuHelpers_DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, 0); AddTextPrinterParameterized(0, 1, src, 0, 1, 1, BardSong_TextSubPrinter); gUnknown_03002F84 = TRUE; CopyWindowToVram(0, 3); diff --git a/src/menu.c b/src/menu.c index 26ea99de2..39d6f3fd1 100644 --- a/src/menu.c +++ b/src/menu.c @@ -124,14 +124,14 @@ const struct MoveMenuInfoIcon gMoveMenuInfoIcons[] = // Forward declarations extern void sub_81973A4(void); -extern void DrawStandardFrame(u8, u8, u8, u8, u8, u8); -extern void DrawDialogueFrame(u8, u8, u8, u8, u8, u8); -extern void ClearWindowAndBorderTilemap(u8, u8, u8, u8, u8, u8); -extern void ClearWindowAndWideBorderTilemap(u8, u8, u8, u8, u8, u8); -extern void sub_8197BB4(u8, u8, u8, u8, u8, u8); -extern void sub_8197E30(u8, u8, u8, u8, u8, u8); -extern void DrawWindowBorder(u8, u8, u8, u8, u8, u8); -extern void sub_81980A8(u8, u8, u8, u8, u8, u8); +extern void WindowFunc_DrawStandardFrame(u8, u8, u8, u8, u8, u8); +extern void WindowFunc_DrawDialogueFrame(u8, u8, u8, u8, u8, u8); +extern void WindowFunc_ClearStdWindowAndFrame(u8, u8, u8, u8, u8, u8); +extern void WindowFunc_ClearDialogWindowAndFrame(u8, u8, u8, u8, u8, u8); +extern void WindowFunc_DrawDialogFrameWithCustomTileAndPalette(u8, u8, u8, u8, u8, u8); +extern void WindowFunc_ClearDialogWindowAndFrameNullPalette(u8, u8, u8, u8, u8, u8); +extern void WindowFunc_DrawStdFrameWithCustomTileAndPalette(u8, u8, u8, u8, u8, u8); +extern void WindowFunc_ClearStdWindowAndFrameToTransparent(u8, u8, u8, u8, u8, u8); extern u8 Menu_MoveCursor(s8); extern u8 sub_8199134(s8, s8); extern void sub_8198C78(void); @@ -210,43 +210,43 @@ void sub_81973A4(void) LoadUserWindowBorderGfx(0, STD_WINDOW_BASE_TILE_NUM, STD_WINDOW_PALETTE_NUM * 0x10); } -void NewMenuHelpers_DrawDialogueFrame(u8 windowId, bool8 copyToVram) +void DrawDialogueFrame(u8 windowId, bool8 copyToVram) { - CallWindowFunction(windowId, DrawDialogueFrame); + CallWindowFunction(windowId, WindowFunc_DrawDialogueFrame); FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); PutWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); } -void NewMenuHelpers_DrawStdWindowFrame(u8 windowId, bool8 copyToVram) +void DrawStdWindowFrame(u8 windowId, bool8 copyToVram) { - CallWindowFunction(windowId, DrawStandardFrame); + CallWindowFunction(windowId, WindowFunc_DrawStandardFrame); FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); PutWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); } -void ClearWindowAndWideBorder(u8 windowId, bool8 copyToVram) +void ClearDialogWindowAndFrame(u8 windowId, bool8 copyToVram) { - CallWindowFunction(windowId, ClearWindowAndWideBorderTilemap); + CallWindowFunction(windowId, WindowFunc_ClearDialogWindowAndFrame); FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); ClearWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); } -void ClearWindowAndBorder(u8 windowId, bool8 copyToVram) +void ClearStdWindowAndFrame(u8 windowId, bool8 copyToVram) { - CallWindowFunction(windowId, ClearWindowAndBorderTilemap); + CallWindowFunction(windowId, WindowFunc_ClearStdWindowAndFrame); FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); ClearWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); } -void DrawStandardFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) +void WindowFunc_DrawStandardFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) { int i; @@ -313,7 +313,7 @@ void DrawStandardFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height STD_WINDOW_PALETTE_NUM); } -void DrawDialogueFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) +void WindowFunc_DrawDialogueFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) { FillBgTilemapBufferRect(bg, DLG_WINDOW_BASE_TILE_NUM + 1, @@ -408,28 +408,25 @@ void DrawDialogueFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height DLG_WINDOW_PALETTE_NUM); } -// Clears the given window, and a 1-tile border around the window, to transparent tiles. -void ClearWindowAndBorderTilemap(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) +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); } -// Clears the given window, and a 1-tile border the top and bottom, plus a 3-tile border on the left and right. -// Tiles are set to a transparent tile. -void ClearWindowAndWideBorderTilemap(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) +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); } void SetStandardWindowBorderStyle(u8 windowId, bool8 copyToVram) { - SetWindowBorderStyle(windowId, copyToVram, STD_WINDOW_BASE_TILE_NUM, STD_WINDOW_PALETTE_NUM); + DrawStdFrameWithCustomTileAndPalette(windowId, copyToVram, STD_WINDOW_BASE_TILE_NUM, STD_WINDOW_PALETTE_NUM); } void sub_819786C(u8 windowId, bool8 copyToVram) { LoadMessageBoxGfx(windowId, DLG_WINDOW_BASE_TILE_NUM, DLG_WINDOW_PALETTE_NUM * 0x10); - sub_8197B1C(windowId, copyToVram, DLG_WINDOW_BASE_TILE_NUM, 0xF); + DrawDialogFrameWithCustomTileAndPalette(windowId, copyToVram, DLG_WINDOW_BASE_TILE_NUM, 0xF); } void sub_819789C(void) @@ -461,12 +458,12 @@ void DisplayItemMessageOnField(u8 taskId, const u8 *string, TaskFunc callback) CopyWindowToVram(0, 3); } -void DisplayYesNoMenu(void) +void DisplayYesNoMenuWithDefault(void) { CreateYesNoMenu(&sYesNo_WindowTemplates, STD_WINDOW_BASE_TILE_NUM, STD_WINDOW_PALETTE_NUM, 0); } -void sub_8197948(u8 initialCursorPos) +void DisplayYesNoMenuWithDefaultDefaultNo(u8 initialCursorPos) { CreateYesNoMenu(&sYesNo_WindowTemplates, STD_WINDOW_BASE_TILE_NUM, STD_WINDOW_PALETTE_NUM, initialCursorPos); } @@ -552,29 +549,30 @@ void sub_8197AE8(bool8 copyToVram) CopyBgTilemapBufferToVram(0); } -void sub_8197B1C(u8 windowId, bool8 copyToVram, u16 tileNum, u8 paletteNum) +void DrawDialogFrameWithCustomTileAndPalette(u8 windowId, bool8 copyToVram, u16 tileNum, u8 paletteNum) { sTileNum = tileNum; sPaletteNum = paletteNum; - CallWindowFunction(windowId, sub_8197BB4); + CallWindowFunction(windowId, WindowFunc_DrawDialogFrameWithCustomTileAndPalette); FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); PutWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); } -void sub_8197B64(u8 windowId, bool8 copyToVram, u16 tileNum) +// Never used. +void DrawDialogFrameWithCustomTile(u8 windowId, bool8 copyToVram, u16 tileNum) { sTileNum = tileNum; sPaletteNum = GetWindowAttribute(windowId, WINDOW_PALETTE_NUM); - CallWindowFunction(windowId, sub_8197BB4); + CallWindowFunction(windowId, WindowFunc_DrawDialogFrameWithCustomTileAndPalette); FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); PutWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); } -void sub_8197BB4(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) +void WindowFunc_DrawDialogFrameWithCustomTileAndPalette(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) { FillBgTilemapBufferRect(bg, sTileNum + 1, @@ -669,43 +667,45 @@ void sub_8197BB4(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 p sPaletteNum); } -void sub_8197DF8(u8 windowId, bool8 copyToVram) +void ClearDialogWindowAndFrameToTransparent(u8 windowId, bool8 copyToVram) { - CallWindowFunction(windowId, sub_8197E30); + // The palette slot doesn't matter, since the tiles are transparent. + CallWindowFunction(windowId, WindowFunc_ClearDialogWindowAndFrameNullPalette); FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(0)); ClearWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); } -void sub_8197E30(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) +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); } -void SetWindowBorderStyle(u8 windowId, bool8 copyToVram, u16 baseTileNum, u8 paletteNum) +void DrawStdFrameWithCustomTileAndPalette(u8 windowId, bool8 copyToVram, u16 baseTileNum, u8 paletteNum) { sTileNum = baseTileNum; sPaletteNum = paletteNum; - CallWindowFunction(windowId, DrawWindowBorder); + CallWindowFunction(windowId, WindowFunc_DrawStdFrameWithCustomTileAndPalette); FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); PutWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); } -void sub_8197EC8(u8 windowId, bool8 copyToVram, u16 baseTileNum) +// Never used. +void DrawStdFrameWithCustomTile(u8 windowId, bool8 copyToVram, u16 baseTileNum) { sTileNum = baseTileNum; sPaletteNum = GetWindowAttribute(windowId, WINDOW_PALETTE_NUM); - CallWindowFunction(windowId, DrawWindowBorder); + CallWindowFunction(windowId, WindowFunc_DrawStdFrameWithCustomTileAndPalette); FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); PutWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); } -void DrawWindowBorder(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) +void WindowFunc_DrawStdFrameWithCustomTileAndPalette(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) { FillBgTilemapBufferRect(bg, sTileNum + 0, @@ -765,16 +765,16 @@ void DrawWindowBorder(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, sPaletteNum); } -void sub_8198070(u8 windowId, bool8 copyToVram) +void ClearStdWindowAndFrameToTransparent(u8 windowId, bool8 copyToVram) { - CallWindowFunction(windowId, sub_81980A8); + CallWindowFunction(windowId, WindowFunc_ClearStdWindowAndFrameToTransparent); FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(0)); ClearWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); } -void sub_81980A8(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) +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); } @@ -1178,7 +1178,7 @@ void sub_8198AF8(const struct WindowTemplate *window, u8 fontId, u8 left, u8 top struct TextPrinterTemplate printer; sYesNoWindowId = AddWindow(window); - SetWindowBorderStyle(sYesNoWindowId, TRUE, baseTileNum, paletteNum); + DrawStdFrameWithCustomTileAndPalette(sYesNoWindowId, TRUE, baseTileNum, paletteNum); printer.currentChar = gText_YesNo; printer.windowId = sYesNoWindowId; @@ -1214,7 +1214,7 @@ s8 Menu_ProcessInputNoWrapClearOnChoose(void) void sub_8198C78(void) { - sub_8198070(sYesNoWindowId, TRUE); + ClearStdWindowAndFrameToTransparent(sYesNoWindowId, TRUE); RemoveWindow(sYesNoWindowId); } @@ -1643,7 +1643,7 @@ void CreateYesNoMenu(const struct WindowTemplate *window, u16 baseTileNum, u8 pa struct TextPrinterTemplate printer; sYesNoWindowId = AddWindow(window); - SetWindowBorderStyle(sYesNoWindowId, TRUE, baseTileNum, paletteNum); + DrawStdFrameWithCustomTileAndPalette(sYesNoWindowId, TRUE, baseTileNum, paletteNum); printer.currentChar = gText_YesNo; printer.windowId = sYesNoWindowId; diff --git a/src/menu_helpers.c b/src/menu_helpers.c index e6547b300..49da6bda3 100644 --- a/src/menu_helpers.c +++ b/src/menu_helpers.c @@ -129,7 +129,7 @@ void SetVBlankHBlankCallbacksToNull(void) void DisplayMessageAndContinueTask(u8 taskId, u8 windowId, u16 arg2, u8 arg3, u8 fontId, u8 textSpeed, const u8 *string, void *taskFunc) { gUnknown_0203A140 = windowId; - sub_8197B1C(windowId, TRUE, arg2, arg3); + DrawDialogFrameWithCustomTileAndPalette(windowId, TRUE, arg2, arg3); if (string != gStringVar4) StringExpandPlaceholders(gStringVar4, string); diff --git a/src/money.c b/src/money.c index 1b5e298f0..e7ae6080c 100644 --- a/src/money.c +++ b/src/money.c @@ -154,7 +154,7 @@ void PrintMoneyAmount(u8 windowId, u8 x, u8 y, int amount, u8 speed) void PrintMoneyAmountInMoneyBoxWithBorder(u8 windowId, u16 tileStart, u8 pallete, int amount) { - SetWindowBorderStyle(windowId, FALSE, tileStart, pallete); + DrawStdFrameWithCustomTileAndPalette(windowId, FALSE, tileStart, pallete); PrintMoneyAmountInMoneyBox(windowId, amount, 0); } @@ -179,7 +179,7 @@ void DrawMoneyBox(int amount, u8 x, u8 y) void HideMoneyBox(void) { RemoveMoneyLabelObject(); - sub_8198070(sMoneyBoxWindowId, FALSE); + ClearStdWindowAndFrameToTransparent(sMoneyBoxWindowId, FALSE); CopyWindowToVram(sMoneyBoxWindowId, 2); RemoveWindow(sMoneyBoxWindowId); } diff --git a/src/mystery_event_menu.c b/src/mystery_event_menu.c index b0f0ba302..2a1617592 100644 --- a/src/mystery_event_menu.c +++ b/src/mystery_event_menu.c @@ -133,7 +133,7 @@ static void CB2_MysteryEventMenu(void) switch (gMain.state) { case 0: - SetWindowBorderStyle(0, 1, 1, 0xD); + DrawStdFrameWithCustomTileAndPalette(0, 1, 1, 0xD); PutWindowTilemap(0); CopyWindowToVram(0, 3); ShowBg(0); @@ -180,7 +180,7 @@ static void CB2_MysteryEventMenu(void) { PlaySE(SE_SELECT); sub_800A620(); - SetWindowBorderStyle(1, 1, 1, 0xD); + DrawStdFrameWithCustomTileAndPalette(1, 1, 1, 0xD); PrintMysteryMenuText(1, gText_LoadingEvent, 1, 2, 0); PutWindowTilemap(1); CopyWindowToVram(1, 3); diff --git a/src/naming_screen.c b/src/naming_screen.c index 013eb37ca..e4159e3be 100644 --- a/src/naming_screen.c +++ b/src/naming_screen.c @@ -557,7 +557,7 @@ static void DisplaySentToPCMessage(void) stringToDisplay++; StringExpandPlaceholders(gStringVar4, gUnknown_0858BDB8[stringToDisplay]); - NewMenuHelpers_DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, 0); gTextFlags.canABSpeedUpPrint = TRUE; AddTextPrinterParameterized2(0, 1, gStringVar4, GetPlayerTextSpeedDelay(), 0, 2, 1, 3); CopyWindowToVram(0, 3); diff --git a/src/party_menu.c b/src/party_menu.c index 15128ab0c..51088af5f 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -2753,7 +2753,7 @@ static void sub_81B1B8C(u8 taskId) { if (gTasks[taskId].data[0] == 0) { - sub_8198070(6, 0); + ClearStdWindowAndFrameToTransparent(6, 0); ClearWindowTilemap(6); } DestroyTask(taskId); @@ -2778,7 +2778,7 @@ static void sub_81B1C1C(u8 taskId) { if (sub_81B1BD4() != TRUE) { - sub_8198070(6, 0); + ClearStdWindowAndFrameToTransparent(6, 0); ClearWindowTilemap(6); if (sub_81221AC() == TRUE) { @@ -3501,7 +3501,7 @@ static void sub_81B302C(u8 *ptr) { if (*ptr != 0xFF) { - sub_8198070(*ptr, 0); + ClearStdWindowAndFrameToTransparent(*ptr, 0); RemoveWindow(*ptr); *ptr = 0xFF; schedule_bg_copy_tilemap_to_vram(2); @@ -3546,7 +3546,7 @@ void display_pokemon_menu_message(u32 stringID) else if (sub_81B314C() == FALSE) stringID = 1; } - SetWindowBorderStyle(*windowPtr, FALSE, 0x4F, 0xD); + DrawStdFrameWithCustomTileAndPalette(*windowPtr, FALSE, 0x4F, 0xD); StringExpandPlaceholders(gStringVar4, gUnknown_08615AF4[stringID]); AddTextPrinterParameterized(*windowPtr, 1, gStringVar4, 0, 1, 0, 0); schedule_bg_copy_tilemap_to_vram(2); @@ -3596,7 +3596,7 @@ static u8 sub_81B31B0(u8 a) } gUnknown_0203CEC4->unkC[0] = AddWindow(&window); - SetWindowBorderStyle(gUnknown_0203CEC4->unkC[0], FALSE, 0x4F, 13); + DrawStdFrameWithCustomTileAndPalette(gUnknown_0203CEC4->unkC[0], FALSE, 0x4F, 13); if (a == 3) return gUnknown_0203CEC4->unkC[0]; cursorDimension = GetMenuCursorDimensionByFont(1, 0); @@ -3616,7 +3616,7 @@ static u8 sub_81B31B0(u8 a) static void sub_81B3300(const u8 *text) { - SetWindowBorderStyle(6, FALSE, 0x4F, 13); + DrawStdFrameWithCustomTileAndPalette(6, FALSE, 0x4F, 13); gTextFlags.canABSpeedUpPrint = TRUE; AddTextPrinterParameterized2(6, 1, text, GetPlayerTextSpeedDelay(), 0, 2, 1, 3); } @@ -3629,7 +3629,7 @@ static void sub_81B334C(void) static u8 sub_81B3364(void) { gUnknown_0203CEC4->unkC[0] = AddWindow(&gUnknown_08615970); - SetWindowBorderStyle(gUnknown_0203CEC4->unkC[0], FALSE, 0x4F, 13); + DrawStdFrameWithCustomTileAndPalette(gUnknown_0203CEC4->unkC[0], FALSE, 0x4F, 13); return gUnknown_0203CEC4->unkC[0]; } diff --git a/src/player_pc.c b/src/player_pc.c index 607c2a721..6ba5999ce 100644 --- a/src/player_pc.c +++ b/src/player_pc.c @@ -361,14 +361,14 @@ static void PlayerPCProcessMenuInput(u8 taskId) break; case MENU_B_PRESSED: PlaySE(SE_SELECT); - sub_8198070(data[4], FALSE); + ClearStdWindowAndFrameToTransparent(data[4], FALSE); ClearWindowTilemap(data[4]); RemoveWindow(data[4]); schedule_bg_copy_tilemap_to_vram(0); gTasks[taskId].func = PlayerPC_TurnOff; break; default: - sub_8198070(data[4], FALSE); + ClearStdWindowAndFrameToTransparent(data[4], FALSE); ClearWindowTilemap(data[4]); RemoveWindow(data[4]); schedule_bg_copy_tilemap_to_vram(0); @@ -403,7 +403,7 @@ static void PlayerPC_Mailbox(u8 taskId) ItemStorage_SetItemAndMailCount(taskId); if (sub_81D1C44(playerPCItemPageInfo.count) == TRUE) { - ClearWindowAndWideBorder(0, 0); + ClearDialogWindowAndFrame(0, 0); Mailbox_DrawMailboxMenu(taskId); gTasks[taskId].func = Mailbox_ProcessInput; } @@ -451,7 +451,7 @@ static void InitItemStorageMenu(u8 taskId, u8 var) static void ItemStorageMenuPrint(const u8 *textPtr) { - NewMenuHelpers_DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, 0); AddTextPrinterParameterized(0, 1, textPtr, 0, 1, 0, 0); } @@ -506,7 +506,7 @@ void sub_816B31C(void) void Mailbox_DoRedrawMailboxMenuAfterReturn(void) { sub_81973A4(); - NewMenuHelpers_DrawDialogueFrame(0, 1); + DrawDialogueFrame(0, 1); InitItemStorageMenu(CreateTask(ItemStorage_HandleReturnToProcessInput, 0), 1); pal_fill_black(); } @@ -560,7 +560,7 @@ static void ItemStorage_WithdrawToss_Helper(u8 taskId, bool8 toss) FreeAndReserveObjectSpritePalettes(); LoadListMenuArrowsGfx(); sub_8122344(gUnknown_0203BCC4->spriteIds, 7); - ClearWindowAndWideBorder(0,0); + ClearDialogWindowAndFrame(0,0); gTasks[taskId].func = ItemStorage_ProcessWithdrawTossInput; } @@ -583,7 +583,7 @@ static void sub_816B4DC(u8 taskId) { u16 *data = gTasks[taskId].data; - sub_8198070(data[4], FALSE); + ClearStdWindowAndFrameToTransparent(data[4], FALSE); ClearWindowTilemap(data[4]); RemoveWindow(data[4]); schedule_bg_copy_tilemap_to_vram(0); @@ -761,7 +761,7 @@ static void Mailbox_MoveToBag(u8 taskId) static void Mailbox_DrawYesNoBeforeMove(u8 taskId) { - DisplayYesNoMenu(); + DisplayYesNoMenuWithDefault(); gTasks[taskId].func = Mailbox_MoveToBagYesNoPrompt; } @@ -863,7 +863,7 @@ static void Mailbox_NoPokemonForMail(u8 taskId) static void Mailbox_Cancel(u8 taskId) { sub_81D1D04(2); - ClearWindowAndWideBorder(0, 0); + ClearDialogWindowAndFrame(0, 0); Mailbox_DrawMailboxMenu(taskId); schedule_bg_copy_tilemap_to_vram(0); gTasks[taskId].func = Mailbox_ProcessInput; @@ -892,7 +892,7 @@ static u8 sub_816BC7C(u8 a) if (*windowIdLoc == 0xFF) { *windowIdLoc = AddWindow(&gUnknown_085DFF5C[a]); - SetWindowBorderStyle(*windowIdLoc, FALSE, 0x214, 0xE); + DrawStdFrameWithCustomTileAndPalette(*windowIdLoc, FALSE, 0x214, 0xE); schedule_bg_copy_tilemap_to_vram(0); } return *windowIdLoc; @@ -903,7 +903,7 @@ static void sub_816BCC4(u8 a) u8 *windowIdLoc = &(gUnknown_0203BCC4->windowIds[a]); if (*windowIdLoc != 0xFF) { - sub_8198070(*windowIdLoc, FALSE); + ClearStdWindowAndFrameToTransparent(*windowIdLoc, FALSE); ClearWindowTilemap(*windowIdLoc); schedule_bg_copy_tilemap_to_vram(0); RemoveWindow(*windowIdLoc); @@ -1170,7 +1170,7 @@ static void ItemStorage_GoBackToPlayerPCMenu_InitStorage(u8 taskId) data = gTasks[taskId].data; if (!IsDma3ManagerBusyWithBgCopy()) { - NewMenuHelpers_DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, 0); if (!data[3]) InitItemStorageMenu(taskId, ITEMPC_MENU_WITHDRAW); else diff --git a/src/pokeblock.c b/src/pokeblock.c index 95f91a74d..4bd4a8ccb 100644 --- a/src/pokeblock.c +++ b/src/pokeblock.c @@ -1120,7 +1120,7 @@ static void PutPokeblockOptionsWindow(u8 taskId) data[1] = 9; sub_8136418(); - SetWindowBorderStyle(data[1], 0, 1, 0xE); + DrawStdFrameWithCustomTileAndPalette(data[1], 0, 1, 0xE); sub_81995E4(data[1], sPokeblockMenu->optionsNo, sPokeblockMenuActions, sPokeblockMenu->pokeblockOptionsIds); InitMenuInUpperLeftCornerPlaySoundWhenAPressed(data[1], sPokeblockMenu->optionsNo, 0); PutWindowTilemap(data[1]); @@ -1173,7 +1173,7 @@ static void PokeblockAction_Toss(u8 taskId) { s16 *data = gTasks[taskId].data; - sub_8198070(data[1], FALSE); + ClearStdWindowAndFrameToTransparent(data[1], FALSE); StringCopy(gStringVar1, gPokeblockNames[gSaveBlock1Ptr->pokeblocks[gSpecialVar_ItemId].color]); StringExpandPlaceholders(gStringVar4, gText_ThrowAwayVar1); DisplayMessageAndContinueTask(taskId, 10, 10, 13, 1, GetPlayerTextSpeedDelay(), gStringVar4, CreateTossPokeblockYesNoMenu); @@ -1219,7 +1219,7 @@ static void HandleErasePokeblock(u8 taskId) static void TossPokeblockChoice_No(u8 taskId) { - sub_8197DF8(10, FALSE); + ClearDialogWindowAndFrameToTransparent(10, FALSE); schedule_bg_copy_tilemap_to_vram(1); sub_81363BC(); gTasks[taskId].func = Task_HandlePokeblockMenuInput; @@ -1266,7 +1266,7 @@ static void PokeblockAction_Cancel(u8 taskId) { s16 *data = gTasks[taskId].data; - sub_8198070(data[1], FALSE); + ClearStdWindowAndFrameToTransparent(data[1], FALSE); schedule_bg_copy_tilemap_to_vram(1); sub_81363BC(); gTasks[taskId].func = Task_HandlePokeblockMenuInput; diff --git a/src/pokeblock_feed.c b/src/pokeblock_feed.c index 0a110120d..908aec1c0 100644 --- a/src/pokeblock_feed.c +++ b/src/pokeblock_feed.c @@ -581,7 +581,7 @@ static bool8 TransitionToPokeblockFeedScene(void) gMain.state++; break; case 10: - SetWindowBorderStyle(0, 1, 1, 14); + DrawStdFrameWithCustomTileAndPalette(0, 1, 1, 14); gMain.state++; break; case 11: diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index d4c4c5224..a99a473eb 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -1218,7 +1218,7 @@ static const u16 gWallpaperPalettes_Plain[][16] = static const u32 gWallpaperTiles_Plain[] = INCBIN_U32("graphics/pokemon_storage/plain.4bpp.lz"); static const u32 gWallpaperTilemap_Plain[] = INCBIN_U32("graphics/pokemon_storage/plain.bin.lz"); -// 12�18 tilemap +// 12x18 tilemap static const u32 gUnknown_085773C4[] = INCBIN_U32("graphics/unused/tilemap_5773C4.bin"); static const u16 gUnknown_08577574[][2] = @@ -1736,7 +1736,7 @@ static void Task_PokemonStorageSystemPC(u8 taskId) case 0: CreatePCMenu(task->data[1], &task->data[15]); sub_81973A4(); - NewMenuHelpers_DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, 0); FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); AddTextPrinterParameterized2(0, 1, gUnknown_085716C0[task->data[1]].desc, TEXT_SPEED_FF, NULL, 2, 1, 3); CopyWindowToVram(0, 3); @@ -1769,7 +1769,7 @@ static void Task_PokemonStorageSystemPC(u8 taskId) break; case MENU_B_PRESSED: case 4: - ClearWindowAndBorder(task->data[15], TRUE); + ClearStdWindowAndFrame(task->data[15], TRUE); ScriptContext2_Disable(); EnableBothScriptContexts(); RemoveWindow(task->data[15]); @@ -1865,7 +1865,7 @@ static void CreatePCMenu(u8 whichMenu, s16 *windowIdPtr) winTemplate.width = GetMaxWidthInMenuTable((void *)gUnknown_085716C0, ARRAY_COUNT(gUnknown_085716C0)); windowId = AddWindow(&winTemplate); - NewMenuHelpers_DrawStdWindowFrame(windowId, FALSE); + DrawStdWindowFrame(windowId, FALSE); PrintMenuTable(windowId, ARRAY_COUNT(gUnknown_085716C0), (void *)gUnknown_085716C0); InitMenuInUpperLeftCornerPlaySoundWhenAPressed(windowId, ARRAY_COUNT(gUnknown_085716C0), whichMenu); *windowIdPtr = windowId; @@ -4432,7 +4432,7 @@ static void ShowYesNoWindow(s8 cursorPos) static void ClearBottomWindow(void) { - sub_8198070(1, FALSE); + ClearStdWindowAndFrameToTransparent(1, FALSE); schedule_bg_copy_tilemap_to_vram(0); } @@ -8733,7 +8733,7 @@ static void AddMenu(void) sPSSData->menuWindow.tilemapTop = 15 - sPSSData->menuWindow.height; sPSSData->field_CB0 = AddWindow(&sPSSData->menuWindow); ClearWindowTilemap(sPSSData->field_CB0); - SetWindowBorderStyle(sPSSData->field_CB0, FALSE, 11, 14); + DrawStdFrameWithCustomTileAndPalette(sPSSData->field_CB0, FALSE, 11, 14); PrintMenuTable(sPSSData->field_CB0, sPSSData->menuItemsCount, (void*)sPSSData->menuItems); InitMenuInUpperLeftCornerPlaySoundWhenAPressed(sPSSData->field_CB0, sPSSData->menuItemsCount, 0); schedule_bg_copy_tilemap_to_vram(0); @@ -8787,7 +8787,7 @@ static s16 sub_80D00AC(void) static void sub_80D013C(void) { - sub_8198070(sPSSData->field_CB0, TRUE); + ClearStdWindowAndFrameToTransparent(sPSSData->field_CB0, TRUE); RemoveWindow(sPSSData->field_CB0); } diff --git a/src/record_mixing.c b/src/record_mixing.c index 7f091c4df..2ac5f9e4c 100644 --- a/src/record_mixing.c +++ b/src/record_mixing.c @@ -292,7 +292,7 @@ static void ReceiveExchangePacket(u32 which) static void PrintTextOnRecordMixing(const u8 *src) { - NewMenuHelpers_DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, 0); AddTextPrinterParameterized(0, 1, src, 0, 1, 0, NULL); CopyWindowToVram(0, 3); } @@ -370,7 +370,7 @@ static void Task_RecordMixing_Main(u8 taskId) { CreateTask(sub_80AF2B4, 10); } - ClearWindowAndWideBorder(0, 1); + ClearDialogWindowAndFrame(0, 1); DestroyTask(taskId); EnableBothScriptContexts(); } diff --git a/src/region_map.c b/src/region_map.c index fa5e26b11..6d5224821 100644 --- a/src/region_map.c +++ b/src/region_map.c @@ -1687,8 +1687,8 @@ static void sub_8124904(void) { StringLength(gUnknown_085A1EDC[i].name[sFlyMap->regionMap.posWithinMapSec]); flag = TRUE; - sub_8198070(0, FALSE); - SetWindowBorderStyle(1, FALSE, 0x65, 0x0d); + ClearStdWindowAndFrameToTransparent(0, FALSE); + DrawStdFrameWithCustomTileAndPalette(1, FALSE, 0x65, 0x0d); AddTextPrinterParameterized(1, 1, sFlyMap->regionMap.mapSecName, 0, 1, 0, NULL); name = gUnknown_085A1EDC[i].name[sFlyMap->regionMap.posWithinMapSec]; AddTextPrinterParameterized(1, 1, name, GetStringRightAlignXOffset(1, name, 0x60), 0x11, 0, NULL); @@ -1702,8 +1702,8 @@ static void sub_8124904(void) { if (gUnknown_03001180 == TRUE) { - sub_8198070(1, FALSE); - SetWindowBorderStyle(0, FALSE, 0x65, 0x0d); + ClearStdWindowAndFrameToTransparent(1, FALSE); + DrawStdFrameWithCustomTileAndPalette(0, FALSE, 0x65, 0x0d); } else { @@ -1718,8 +1718,8 @@ static void sub_8124904(void) { if (gUnknown_03001180 == TRUE) { - sub_8198070(1, FALSE); - SetWindowBorderStyle(0, FALSE, 0x65, 0x0d); + ClearStdWindowAndFrameToTransparent(1, FALSE); + DrawStdFrameWithCustomTileAndPalette(0, FALSE, 0x65, 0x0d); } FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); CopyWindowToVram(0, 2); diff --git a/src/reset_rtc_screen.c b/src/reset_rtc_screen.c index 34444cbf4..ce9f5b98b 100644 --- a/src/reset_rtc_screen.c +++ b/src/reset_rtc_screen.c @@ -290,7 +290,7 @@ static void FreeCursorPalette(void) static void HideChooseTimeWindow(u8 windowId) { - sub_8198070(windowId, FALSE); + ClearStdWindowAndFrameToTransparent(windowId, FALSE); RemoveWindow(windowId); schedule_bg_copy_tilemap_to_vram(0); } @@ -319,7 +319,7 @@ static void PrintTime(u8 windowId, u8 x, u8 y, u16 days, u8 hours, u8 minutes, u static void ShowChooseTimeWindow(u8 windowId, u16 days, u8 hours, u8 minutes, u8 seconds) { - SetWindowBorderStyle(windowId, FALSE, 0x214, 0xE); + DrawStdFrameWithCustomTileAndPalette(windowId, FALSE, 0x214, 0xE); PrintTime(windowId, 0, 1, days, hours, minutes, seconds); AddTextPrinterParameterized(windowId, 1, gText_Confirm2, 126, 1, 0, NULL); schedule_bg_copy_tilemap_to_vram(0); @@ -495,7 +495,7 @@ static void VBlankCB(void) static void ShowMessage(const u8 *str) { - sub_8197B1C(1, FALSE, 0x200, 0xF); + DrawDialogFrameWithCustomTileAndPalette(1, FALSE, 0x200, 0xF); AddTextPrinterParameterized(1, 1, str, 0, 1, 0, NULL); schedule_bg_copy_tilemap_to_vram(0); } @@ -507,7 +507,7 @@ static void Task_ShowResetRtcPrompt(u8 taskId) switch (data[0]) { case 0: - SetWindowBorderStyle(0, FALSE, 0x214, 0xE); + DrawStdFrameWithCustomTileAndPalette(0, FALSE, 0x214, 0xE); AddTextPrinterParameterized(0, 1, gText_PresentTime, 0, 1, TEXT_SPEED_FF, 0); PrintTime( 0, @@ -574,7 +574,7 @@ static void Task_ResetRtcScreen(u8 taskId) case 2: if (gTasks[data[1]].isActive != TRUE) { - sub_8198070(0, FALSE); + ClearStdWindowAndFrameToTransparent(0, FALSE); ShowMessage(gText_PleaseResetTime); gLocalTime = gSaveBlock2Ptr->lastBerryTreeUpdate; data[1] = CreateTask(Task_ResetRtc_0, 80); diff --git a/src/rom_8011DC0.c b/src/rom_8011DC0.c index 466ef430d..88e0bf4ac 100644 --- a/src/rom_8011DC0.c +++ b/src/rom_8011DC0.c @@ -511,12 +511,12 @@ void sub_8012780(u8 taskId) PutWindowTilemap(data->field_10); CopyWindowToVram(data->field_10, 2); - NewMenuHelpers_DrawStdWindowFrame(data->listWindowId, FALSE); + DrawStdWindowFrame(data->listWindowId, FALSE); gMultiuseListMenuTemplate = gUnknown_082F015C; gMultiuseListMenuTemplate.windowId = data->listWindowId; data->listTaskId = ListMenuInit(&gMultiuseListMenuTemplate, 0, 0); - NewMenuHelpers_DrawStdWindowFrame(data->field_11, FALSE); + DrawStdWindowFrame(data->field_11, FALSE); PutWindowTilemap(data->field_11); CopyWindowToVram(data->field_11, 2); @@ -786,10 +786,10 @@ void sub_8012780(u8 taskId) void sub_8012F64(struct UnkStruct_Leader *data) { ClearWindowTilemap(data->field_11); - ClearWindowAndBorder(data->field_11, FALSE); + ClearStdWindowAndFrame(data->field_11, FALSE); DestroyListMenuTask(data->listTaskId, 0, 0); ClearWindowTilemap(data->field_10); - ClearWindowAndBorder(data->listWindowId, FALSE); + ClearStdWindowAndFrame(data->listWindowId, FALSE); CopyBgTilemapBufferToVram(0); RemoveWindow(data->field_11); RemoveWindow(data->listWindowId); @@ -1080,12 +1080,12 @@ void sub_80134E8(u8 taskId) PutWindowTilemap(data->field_C); CopyWindowToVram(data->field_C, 2); - NewMenuHelpers_DrawStdWindowFrame(data->listWindowId, FALSE); + DrawStdWindowFrame(data->listWindowId, FALSE); gMultiuseListMenuTemplate = gUnknown_082F0204; gMultiuseListMenuTemplate.windowId = data->listWindowId; data->listTaskId = ListMenuInit(&gMultiuseListMenuTemplate, 0, 0); - NewMenuHelpers_DrawStdWindowFrame(data->field_D, FALSE); + DrawStdWindowFrame(data->field_D, FALSE); PutWindowTilemap(data->field_D); sub_80125BC(data->field_D); CopyWindowToVram(data->field_D, 2); @@ -1254,10 +1254,10 @@ void sub_80134E8(u8 taskId) case 18: case 20: ClearWindowTilemap(data->field_D); - ClearWindowAndBorder(data->field_D, FALSE); + ClearStdWindowAndFrame(data->field_D, FALSE); DestroyListMenuTask(data->listTaskId, 0, 0); ClearWindowTilemap(data->field_C); - ClearWindowAndBorder(data->listWindowId, FALSE); + ClearStdWindowAndFrame(data->listWindowId, FALSE); CopyBgTilemapBufferToVram(0); RemoveWindow(data->field_D); RemoveWindow(data->listWindowId); diff --git a/src/roulette.c b/src/roulette.c index 7826c1353..4723e0687 100644 --- a/src/roulette.c +++ b/src/roulette.c @@ -973,7 +973,7 @@ static void sub_81405CC(void) sub_814372C(6); sub_81436D0(0); sub_81424FC(0); - NewMenuHelpers_DrawStdWindowFrame(gUnknown_0203AB8C, FALSE); + DrawStdWindowFrame(gUnknown_0203AB8C, FALSE); AddTextPrinterParameterized(gUnknown_0203AB8C, 1, gUnknown_082A5B89, 0, 1, TEXT_SPEED_FF, NULL); CopyWindowToVram(gUnknown_0203AB8C, 3); gSpriteCoordOffsetX = -60; @@ -1043,8 +1043,8 @@ static void sub_81408A8(u8 taskId) static void sub_8140914(u8 taskId) { - DisplayYesNoMenu(); - NewMenuHelpers_DrawStdWindowFrame(gUnknown_0203AB8C, 0); + DisplayYesNoMenuWithDefault(); + DrawStdWindowFrame(gUnknown_0203AB8C, 0); AddTextPrinterParameterized(gUnknown_0203AB8C, 1, gUnknown_082A5C13, 0, 1, TEXT_SPEED_FF, 0); CopyWindowToVram(gUnknown_0203AB8C, 3); DoYesNoFuncWithChoice(taskId, &gUnknown_085B6410); @@ -1052,7 +1052,7 @@ static void sub_8140914(u8 taskId) static void sub_8140968(u8 taskId) { - ClearWindowAndBorder(0, TRUE); + ClearStdWindowAndFrame(0, TRUE); gTasks[taskId].func = sub_8140BD0; } @@ -1808,14 +1808,14 @@ static void sub_814189C(u8 taskId) if (gTasks[taskId].data[2] == 12) { PlayFanfare(MUS_ME_B_BIG); - NewMenuHelpers_DrawStdWindowFrame(gUnknown_0203AB8C, FALSE); + DrawStdWindowFrame(gUnknown_0203AB8C, FALSE); AddTextPrinterParameterized(gUnknown_0203AB8C, 1, gUnknown_082A5BD7, 0, 1, TEXT_SPEED_FF, NULL); CopyWindowToVram(gUnknown_0203AB8C, 3); } else { PlayFanfare(MUS_ME_B_SMALL); - NewMenuHelpers_DrawStdWindowFrame(gUnknown_0203AB8C, FALSE); + DrawStdWindowFrame(gUnknown_0203AB8C, FALSE); AddTextPrinterParameterized(gUnknown_0203AB8C, 1, gUnknown_082A5BCB, 0, 1, TEXT_SPEED_FF, NULL); CopyWindowToVram(gUnknown_0203AB8C, 3); } @@ -1823,7 +1823,7 @@ static void sub_814189C(u8 taskId) case 0: default: m4aSongNumStart(SE_HAZURE); - NewMenuHelpers_DrawStdWindowFrame(gUnknown_0203AB8C, FALSE); + DrawStdWindowFrame(gUnknown_0203AB8C, FALSE); AddTextPrinterParameterized(gUnknown_0203AB8C, 1, gUnknown_082A5BE0, 0, 1, TEXT_SPEED_FF, NULL); CopyWindowToVram(gUnknown_0203AB8C, 3); break; @@ -1867,7 +1867,7 @@ static void sub_8141A18(u8 taskId) { ConvertIntToDecimalStringN(gStringVar1, (gUnknown_0203AB88->var19 * gTasks[taskId].data[2]), STR_CONV_MODE_LEFT_ALIGN, 2); StringExpandPlaceholders(gStringVar4, gUnknown_082A5BEF); - NewMenuHelpers_DrawStdWindowFrame(gUnknown_0203AB8C, FALSE); + DrawStdWindowFrame(gUnknown_0203AB8C, FALSE); AddTextPrinterParameterized(gUnknown_0203AB8C, 1, gStringVar4, 0, 1, TEXT_SPEED_FF, NULL); CopyWindowToVram(gUnknown_0203AB8C, 3); gTasks[taskId].data[1] = (gUnknown_0203AB88->var19 * gTasks[taskId].data[2]); @@ -1900,14 +1900,14 @@ static void sub_8141B58(u8 taskId) { if (gTasks[taskId].data[6] == 6) { - NewMenuHelpers_DrawStdWindowFrame(gUnknown_0203AB8C, FALSE); + DrawStdWindowFrame(gUnknown_0203AB8C, FALSE); AddTextPrinterParameterized(gUnknown_0203AB8C, 1, gUnknown_082A5C21, 0, 1, TEXT_SPEED_FF, NULL); CopyWindowToVram(gUnknown_0203AB8C, 3); sub_8141F7C(taskId, dp01t_12_3_battle_menu, 0xFFFF, 3); } else if (gTasks[taskId].data[13] == 9999) { - NewMenuHelpers_DrawStdWindowFrame(gUnknown_0203AB8C, FALSE); + DrawStdWindowFrame(gUnknown_0203AB8C, FALSE); AddTextPrinterParameterized(gUnknown_0203AB8C, 1, gUnknown_082A5C61, 0, 1, TEXT_SPEED_FF, NULL); CopyWindowToVram(gUnknown_0203AB8C, 3); sub_8141F7C(taskId, sub_8140914, 0xFFFF, 0x3); @@ -1919,7 +1919,7 @@ static void sub_8141B58(u8 taskId) } else { - NewMenuHelpers_DrawStdWindowFrame(gUnknown_0203AB8C, FALSE); + DrawStdWindowFrame(gUnknown_0203AB8C, FALSE); AddTextPrinterParameterized(gUnknown_0203AB8C, 1, gUnknown_082A5C04, 0, 1, TEXT_SPEED_FF, NULL); CopyWindowToVram(gUnknown_0203AB8C, 3); sub_8141F7C(taskId, sub_8140994, 0x3C, 0x3); @@ -1944,7 +1944,7 @@ static void dp01t_12_3_battle_menu(u8 taskId) if (gTasks[taskId].data[13] == 9999) { - NewMenuHelpers_DrawStdWindowFrame(gUnknown_0203AB8C, FALSE); + DrawStdWindowFrame(gUnknown_0203AB8C, FALSE); AddTextPrinterParameterized(gUnknown_0203AB8C, 1, gUnknown_082A5C61, 0, 1, TEXT_SPEED_FF, NULL); CopyWindowToVram(gUnknown_0203AB8C, 3); sub_8141F7C(taskId, sub_8140914, 0xFFFF, 3); @@ -3256,7 +3256,7 @@ static const struct SpriteTemplate gUnknown_085B7AEC = static void sub_81428C4(u8 r0) { - DisplayYesNoMenu(); + DisplayYesNoMenuWithDefault(); DoYesNoFuncWithChoice(r0, &gUnknown_085B6408); } @@ -3272,7 +3272,7 @@ static void sub_81428E4(u8 taskId) static void sub_8142918(u8 taskId) { - ClearWindowAndBorder(0, TRUE); + ClearStdWindowAndFrame(0, TRUE); HideCoinsWindow(); FreeAllWindowBuffers(); BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); @@ -3283,7 +3283,7 @@ static void sub_8142918(u8 taskId) static void sub_814297C(u8 taskId) { - ClearWindowAndBorder(0, FALSE); + ClearStdWindowAndFrame(0, FALSE); HideCoinsWindow(); ScriptContext2_Disable(); DestroyTask(taskId); @@ -3296,7 +3296,7 @@ static void sub_81429A0(u8 taskId) { gSpecialVar_0x8004 = 1; HideCoinsWindow(); - ClearWindowAndBorder(0, TRUE); + ClearStdWindowAndFrame(0, TRUE); ScriptContext2_Disable(); DestroyTask(taskId); } @@ -3309,7 +3309,7 @@ static void sub_81429F0(u8 taskId) u32 temp = gUnknown_085B6344[(gSpecialVar_0x8004 & 1) + (gSpecialVar_0x8004 >> 7 << 1)]; ConvertIntToDecimalStringN(gStringVar1, temp, STR_CONV_MODE_LEADING_ZEROS, 1); StringExpandPlaceholders(gStringVar4, gUnknown_082A5B12); - NewMenuHelpers_DrawStdWindowFrame(0, FALSE); + DrawStdWindowFrame(0, FALSE); AddTextPrinterParameterized(0, 1, gStringVar4, 0, 1, TEXT_SPEED_FF, NULL); CopyWindowToVram(0, 3); gTasks[taskId].func = sub_81428C4; @@ -3326,7 +3326,7 @@ static void Task_Roulette_0(u8 taskId) { if ((gSpecialVar_0x8004 & 0x80) && (gSpecialVar_0x8004 & 1)) { - NewMenuHelpers_DrawStdWindowFrame(0, FALSE); + DrawStdWindowFrame(0, FALSE); AddTextPrinterParameterized(0, 1, gUnknown_082A5B6B, 0, 1, TEXT_SPEED_FF, NULL); CopyWindowToVram(0, 3); gTasks[taskId].func = sub_81429F0; @@ -3334,7 +3334,7 @@ static void Task_Roulette_0(u8 taskId) else { StringExpandPlaceholders(gStringVar4, gUnknown_082A5B12); - NewMenuHelpers_DrawStdWindowFrame(0, FALSE); + DrawStdWindowFrame(0, FALSE); AddTextPrinterParameterized(0, 1, gStringVar4, 0, 1, TEXT_SPEED_FF, NULL); CopyWindowToVram(0, 3); gTasks[taskId].func = sub_81428C4; @@ -3343,7 +3343,7 @@ static void Task_Roulette_0(u8 taskId) else { StringExpandPlaceholders(gStringVar4, gUnknown_082A5B4E); - NewMenuHelpers_DrawStdWindowFrame(0, FALSE); + DrawStdWindowFrame(0, FALSE); AddTextPrinterParameterized(0, 1, gStringVar4, 0, 1, TEXT_SPEED_FF, NULL); CopyWindowToVram(0, 3); gTasks[taskId].func = sub_81429A0; diff --git a/src/save_failed_screen.c b/src/save_failed_screen.c index 62d6f9e3e..1f0fe69c9 100644 --- a/src/save_failed_screen.c +++ b/src/save_failed_screen.c @@ -229,8 +229,8 @@ static void CB2_SaveFailedScreen(void) LoadPalette(sSaveFailedClockPal, 0x100, 0x20); LoadPalette(gTextWindowFrame1_Pal, 0xE0, 0x20); LoadPalette(gUnknown_0860F074, 0xF0, 0x20); - SetWindowBorderStyle(gSaveFailedWindowIds[TEXT_WIN_ID], FALSE, 0x214, 0xE); - SetWindowBorderStyle(gSaveFailedWindowIds[CLOCK_WIN_ID], FALSE, 0x214, 0xE); + DrawStdFrameWithCustomTileAndPalette(gSaveFailedWindowIds[TEXT_WIN_ID], FALSE, 0x214, 0xE); + DrawStdFrameWithCustomTileAndPalette(gSaveFailedWindowIds[CLOCK_WIN_ID], FALSE, 0x214, 0xE); FillWindowPixelBuffer(gSaveFailedWindowIds[CLOCK_WIN_ID], PALETTE_NUM_TO_FILL_VALUE(1)); // backwards? FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], PALETTE_NUM_TO_FILL_VALUE(1)); CopyWindowToVram(gSaveFailedWindowIds[CLOCK_WIN_ID], 2); // again? diff --git a/src/scrcmd.c b/src/scrcmd.c index 145437a2a..b42b3e5f7 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -1302,7 +1302,7 @@ bool8 ScrCmd_cmdDB(struct ScriptContext *ctx) if (msg == NULL) msg = (const u8 *)ctx->data[0]; sub_81973A4(); - NewMenuHelpers_DrawDialogueFrame(0, 1); + DrawDialogueFrame(0, 1); AddTextPrinterParameterized(0, 1, msg, 0, 1, 0, 0); return FALSE; } @@ -1517,7 +1517,7 @@ bool8 ScrCmd_braillemessage(struct ScriptContext *ctx) winTemplate = CreateWindowTemplate(0, xWindow, yWindow + 1, width, height, 0xF, 0x1); gUnknown_03000F30 = AddWindow(&winTemplate); LoadUserWindowBorderGfx(gUnknown_03000F30, 0x214, 0xE0); - NewMenuHelpers_DrawStdWindowFrame(gUnknown_03000F30, 0); + DrawStdWindowFrame(gUnknown_03000F30, 0); PutWindowTilemap(gUnknown_03000F30); FillWindowPixelBuffer(gUnknown_03000F30, PALETTE_NUM_TO_FILL_VALUE(1)); AddTextPrinterParameterized(gUnknown_03000F30, 6, gStringVar4, xText, yText, 0xFF, 0x0); @@ -2254,7 +2254,7 @@ bool8 ScrCmd_setmonmetlocation(struct ScriptContext *ctx) void sub_809BDB4(void) { - ClearWindowAndBorder(gUnknown_03000F30, 1); + ClearStdWindowAndFrame(gUnknown_03000F30, 1); RemoveWindow(gUnknown_03000F30); } diff --git a/src/script_menu.c b/src/script_menu.c index 8831d65c6..ccbbcdfe1 100644 --- a/src/script_menu.c +++ b/src/script_menu.c @@ -1202,7 +1202,7 @@ bool8 ScriptMenu_YesNo(u8 left, u8 top) else { gSpecialVar_Result = 0xFF; - DisplayYesNoMenu(); + DisplayYesNoMenuWithDefault(); taskId = CreateTask(Task_HandleYesNoInput, 0x50); return TRUE; } @@ -1630,7 +1630,7 @@ u8 CreateWindowFromRect(u8 x, u8 y, u8 width, u8 height) void sub_80E2A78(u8 windowId) { - sub_8198070(windowId, TRUE); + ClearStdWindowAndFrameToTransparent(windowId, TRUE); RemoveWindow(windowId); } diff --git a/src/secret_base.c b/src/secret_base.c index 74d9ac9b0..342a9960a 100644 --- a/src/secret_base.c +++ b/src/secret_base.c @@ -871,7 +871,7 @@ void sub_80E9C9C(u8 taskId) { data[1] = 0; data[2] = 0; - ClearWindowAndWideBorder(0, 0); + ClearDialogWindowAndFrame(0, 0); gUnknown_0203A020 = calloc(1, sizeof(struct SecretBaseListMenuBuffer)); data[6] = AddWindow(&gUnknown_0858D06C[0]); game_continue(taskId); @@ -963,7 +963,7 @@ void sub_80E9E90(u8 taskId) PlaySE(SE_SELECT); DestroyListMenuTask(data[5], NULL, NULL); RemoveScrollIndicatorArrowPair(data[8]); - ClearWindowAndBorder(data[6], 0); + ClearStdWindowAndFrame(data[6], 0); ClearWindowTilemap(data[6]); RemoveWindow(data[6]); schedule_bg_copy_tilemap_to_vram(0); @@ -1020,8 +1020,8 @@ void sub_80E9FFC(u8 taskId) s16 *data; data = gTasks[taskId].data; - ClearWindowAndBorder(data[6], FALSE); - ClearWindowAndBorder(data[7], FALSE); + ClearStdWindowAndFrame(data[6], FALSE); + ClearStdWindowAndFrame(data[7], FALSE); ClearWindowTilemap(data[6]); ClearWindowTilemap(data[7]); RemoveWindow(data[7]); @@ -1033,7 +1033,7 @@ void sub_80E9FFC(u8 taskId) void sub_80EA06C(u8 taskId) { - DisplayYesNoMenu(); + DisplayYesNoMenuWithDefault(); DoYesNoFuncWithChoice(taskId, &gUnknown_0858D058); } @@ -1042,7 +1042,7 @@ void sub_80EA08C(u8 taskId) s16 *data; data = gTasks[taskId].data; - ClearWindowAndWideBorder(0, 0); + ClearDialogWindowAndFrame(0, 0); DestroyListMenuTask(data[5], &data[2], &data[1]); gSaveBlock1Ptr->secretBases[data[4]].sbr_field_1_6 = 0; game_continue(taskId); @@ -1061,7 +1061,7 @@ void sub_80EA13C(u8 taskId) s16 *data; data = gTasks[taskId].data; - ClearWindowAndWideBorder(0, 0); + ClearDialogWindowAndFrame(0, 0); DestroyListMenuTask(data[5], &data[2], &data[1]); sub_80E9E00(taskId); gTasks[taskId].func = sub_80E9E90; @@ -1073,7 +1073,7 @@ void sub_80EA18C(u8 taskId) data = gTasks[taskId].data; sub_80E9E44(taskId); - ClearWindowAndBorder(data[7], 0); + ClearStdWindowAndFrame(data[7], 0); ClearWindowTilemap(data[7]); RemoveWindow(data[7]); schedule_bg_copy_tilemap_to_vram(0); diff --git a/src/shop.c b/src/shop.c index 8c530e0d3..55a7a20f7 100755 --- a/src/shop.c +++ b/src/shop.c @@ -366,7 +366,7 @@ void CB2_ExitSellMenu(void) static void Task_HandleShopMenuQuit(u8 taskId) { - sub_8198070(gMartInfo.windowId, 2); + ClearStdWindowAndFrameToTransparent(gMartInfo.windowId, 2); RemoveWindow(gMartInfo.windowId); SaveRecordedItemPurchasesForTVShow(); ScriptContext2_Disable(); @@ -981,12 +981,12 @@ static void Task_BuyHowManyDialogueInit(u8 taskId) u16 quantityInBag = CountTotalItemQuantityInBag(tItemId); u16 maxQuantity; - SetWindowBorderStyle(3, FALSE, 1, 13); + DrawStdFrameWithCustomTileAndPalette(3, FALSE, 1, 13); ConvertIntToDecimalStringN(gStringVar1, quantityInBag, STR_CONV_MODE_RIGHT_ALIGN, 4); StringExpandPlaceholders(gStringVar4, gText_InBagVar1); BuyMenuPrint(3, gStringVar4, 0, 1, 0, 0); tItemCount = 1; - SetWindowBorderStyle(4, FALSE, 1, 13); + DrawStdFrameWithCustomTileAndPalette(4, FALSE, 1, 13); BuyMenuPrintItemQuantityAndPrice(taskId); schedule_bg_copy_tilemap_to_vram(0); @@ -1018,8 +1018,8 @@ static void Task_BuyHowManyDialogueHandleInput(u8 taskId) if (gMain.newKeys & A_BUTTON) { PlaySE(SE_SELECT); - sub_8198070(4, 0); - sub_8198070(3, 0); + ClearStdWindowAndFrameToTransparent(4, 0); + ClearStdWindowAndFrameToTransparent(3, 0); ClearWindowTilemap(4); ClearWindowTilemap(3); PutWindowTilemap(1); @@ -1031,8 +1031,8 @@ static void Task_BuyHowManyDialogueHandleInput(u8 taskId) else if (gMain.newKeys & B_BUTTON) { PlaySE(SE_SELECT); - sub_8198070(4, 0); - sub_8198070(3, 0); + ClearStdWindowAndFrameToTransparent(4, 0); + ClearStdWindowAndFrameToTransparent(3, 0); ClearWindowTilemap(4); ClearWindowTilemap(3); BuyMenuReturnToItemList(taskId); @@ -1131,7 +1131,7 @@ static void BuyMenuReturnToItemList(u8 taskId) { s16 *data = gTasks[taskId].data; - sub_8197DF8(5, 0); + ClearDialogWindowAndFrameToTransparent(5, 0); BuyMenuPrintCursor(tListTaskId, 1); PutWindowTilemap(1); PutWindowTilemap(2); diff --git a/src/slot_machine.c b/src/slot_machine.c index f603f468c..189bca80f 100644 --- a/src/slot_machine.c +++ b/src/slot_machine.c @@ -1015,7 +1015,7 @@ void PlaySlotMachine(u8 arg0, MainCallback cb) /*static */bool8 sub_8101F44(struct Task *task) { - NewMenuHelpers_DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, 0); AddTextPrinterParameterized(0, 1, gText_YouDontHaveThreeCoins, 0, 1, 0, 0); CopyWindowToVram(0, 3); sSlotMachine->state = 7; @@ -1026,7 +1026,7 @@ void PlaySlotMachine(u8 arg0, MainCallback cb) { if (gMain.newKeys & (A_BUTTON | B_BUTTON)) { - ClearWindowAndWideBorder(0, TRUE); + ClearDialogWindowAndFrame(0, TRUE); sSlotMachine->state = 5; } return FALSE; @@ -1256,7 +1256,7 @@ void PlaySlotMachine(u8 arg0, MainCallback cb) /*static */bool8 sub_8102318(struct Task *task) { - NewMenuHelpers_DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, 0); AddTextPrinterParameterized(0, 1, gText_QuitTheGame, 0, 1, 0, 0); CopyWindowToVram(0, 3); CreateYesNoMenuParameterized(0x15, 7, 0x214, 0x180, 0xE, 0xF); @@ -1269,7 +1269,7 @@ void PlaySlotMachine(u8 arg0, MainCallback cb) s8 input = Menu_ProcessInputNoWrapClearOnChoose(); if (input == 0) { - ClearWindowAndWideBorder(0, TRUE); + ClearDialogWindowAndFrame(0, TRUE); sub_8103D8C(0); sub_8103D8C(1); sub_8103D8C(2); @@ -1278,7 +1278,7 @@ void PlaySlotMachine(u8 arg0, MainCallback cb) } else if (input == 1 || input == -1) { - ClearWindowAndWideBorder(0, TRUE); + ClearDialogWindowAndFrame(0, TRUE); sSlotMachine->state = 5; } return FALSE; @@ -1286,7 +1286,7 @@ void PlaySlotMachine(u8 arg0, MainCallback cb) /*static */bool8 sub_810239C(struct Task *task) { - NewMenuHelpers_DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, 0); AddTextPrinterParameterized(0, 1, gText_YouveGot9999Coins, 0, 1, 0, 0); CopyWindowToVram(0, 3); sSlotMachine->state = 24; @@ -1297,7 +1297,7 @@ void PlaySlotMachine(u8 arg0, MainCallback cb) { if (gMain.newKeys & (A_BUTTON | B_BUTTON)) { - ClearWindowAndWideBorder(0, TRUE); + ClearDialogWindowAndFrame(0, TRUE); sSlotMachine->state = 5; } return FALSE; @@ -1305,7 +1305,7 @@ void PlaySlotMachine(u8 arg0, MainCallback cb) /*static */bool8 sub_81023E0_(struct Task *task) { - NewMenuHelpers_DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, 0); AddTextPrinterParameterized(0, 1, gText_YouveRunOutOfCoins, 0, 1, 0, 0); CopyWindowToVram(0, 3); sSlotMachine->state = 26; @@ -1316,7 +1316,7 @@ void PlaySlotMachine(u8 arg0, MainCallback cb) { if (gMain.newKeys & (A_BUTTON | B_BUTTON)) { - ClearWindowAndWideBorder(0, TRUE); + ClearDialogWindowAndFrame(0, TRUE); sSlotMachine->state = 27; } return FALSE; diff --git a/src/start_menu.c b/src/start_menu.c index c61269c9c..f88630aee 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -123,7 +123,7 @@ static u8 SaveConfirmSaveCallback(void); static u8 SaveYesNoCallback(void); static u8 SaveConfirmInputCallback(void); static u8 SaveFileExistsCallback(void); -static u8 SaveConfirmOverwriteNoCallback(void); +static u8 SaveConfirmOverwriteDefaultNoCallback(void); static u8 SaveConfirmOverwriteCallback(void); static u8 SaveOverwriteInputCallback(void); static u8 SaveSavingMessageCallback(void); @@ -376,7 +376,7 @@ static void ShowSafariBallsWindow(void) { sSafariBallsWindowId = AddWindow(&sSafariBallsWindowTemplate); PutWindowTilemap(sSafariBallsWindowId); - NewMenuHelpers_DrawStdWindowFrame(sSafariBallsWindowId, FALSE); + DrawStdWindowFrame(sSafariBallsWindowId, FALSE); ConvertIntToDecimalStringN(gStringVar1, gNumSafariBalls, STR_CONV_MODE_RIGHT_ALIGN, 2); StringExpandPlaceholders(gStringVar4, gText_SafariBallStock); AddTextPrinterParameterized(sSafariBallsWindowId, 1, gStringVar4, 0, 1, 0xFF, NULL); @@ -391,7 +391,7 @@ static void ShowPyramidFloorWindow(void) sBattlePyramidFloorWindowId = AddWindow(&sPyramidFloorWindowTemplate_2); PutWindowTilemap(sBattlePyramidFloorWindowId); - NewMenuHelpers_DrawStdWindowFrame(sBattlePyramidFloorWindowId, FALSE); + DrawStdWindowFrame(sBattlePyramidFloorWindowId, FALSE); StringCopy(gStringVar1, sPyramindFloorNames[gSaveBlock2Ptr->frontier.curChallengeBattleNum]); StringExpandPlaceholders(gStringVar4, gText_BattlePyramidFloor); AddTextPrinterParameterized(sBattlePyramidFloorWindowId, 1, gStringVar4, 0, 1, 0xFF, NULL); @@ -402,13 +402,13 @@ static void RemoveExtraStartMenuWindows(void) { if (GetSafariZoneFlag()) { - sub_8198070(sSafariBallsWindowId, FALSE); + ClearStdWindowAndFrameToTransparent(sSafariBallsWindowId, FALSE); CopyWindowToVram(sSafariBallsWindowId, 2); RemoveWindow(sSafariBallsWindowId); } if (InBattlePyramid()) { - sub_8198070(sBattlePyramidFloorWindowId, FALSE); + ClearStdWindowAndFrameToTransparent(sBattlePyramidFloorWindowId, FALSE); RemoveWindow(sBattlePyramidFloorWindowId); } } @@ -459,7 +459,7 @@ static bool32 InitStartMenuStep(void) break; case 2: sub_81973A4(); - NewMenuHelpers_DrawStdWindowFrame(sub_81979C4(sNumStartMenuActions), FALSE); + DrawStdWindowFrame(sub_81979C4(sNumStartMenuActions), FALSE); sUnknown_02037619[1] = 0; sUnknown_02037619[0]++; break; @@ -751,7 +751,7 @@ static bool8 StartMenuBattlePyramidRetireCallback(void) void sub_809FDD4(void) { - sub_8197DF8(0, FALSE); + ClearDialogWindowAndFrameToTransparent(0, FALSE); ScriptUnfreezeEventObjects(); CreateStartMenuTask(sub_809FA34); ScriptContext2_Enable(); @@ -787,13 +787,13 @@ static bool8 SaveCallback(void) case SAVE_IN_PROGRESS: return FALSE; case SAVE_CANCELED: // Back to start menu - sub_8197DF8(0, FALSE); + ClearDialogWindowAndFrameToTransparent(0, FALSE); InitStartMenu(); gMenuCallback = HandleStartMenuInput; return FALSE; case SAVE_SUCCESS: case SAVE_ERROR: // Close start menu - sub_8197DF8(0, TRUE); + ClearDialogWindowAndFrameToTransparent(0, TRUE); ScriptUnfreezeEventObjects(); ScriptContext2_Disable(); SoftResetInBattlePyramid(); @@ -830,7 +830,7 @@ static bool8 BattlePyramidRetireCallback(void) case SAVE_IN_PROGRESS: return FALSE; case SAVE_CANCELED: // Yes (Retire from battle pyramid) - sub_8197DF8(0, TRUE); + ClearDialogWindowAndFrameToTransparent(0, TRUE); ScriptUnfreezeEventObjects(); ScriptContext2_Disable(); ScriptContext1_SetupScript(BattleFrontier_BattlePyramidEmptySquare_EventScript_252C88); @@ -897,7 +897,7 @@ static void SaveGameTask(u8 taskId) static void sub_80A0014(void) { - ClearWindowAndWideBorder(0, TRUE); + ClearDialogWindowAndFrame(0, TRUE); } static void HideSaveInfoWindow(void) @@ -943,7 +943,7 @@ static bool8 SaveErrorTimer(void) static u8 SaveConfirmSaveCallback(void) { - ClearWindowAndBorder(GetStartMenuWindowId(), FALSE); + ClearStdWindowAndFrame(GetStartMenuWindowId(), FALSE); RemoveStartMenuWindow(); ShowSaveInfoWindow(); @@ -961,7 +961,7 @@ static u8 SaveConfirmSaveCallback(void) static u8 SaveYesNoCallback(void) { - DisplayYesNoMenu(); // Show Yes/No menu + DisplayYesNoMenuWithDefault(); // Show Yes/No menu sSaveDialogCallback = SaveConfirmInputCallback; return SAVE_IN_PROGRESS; } @@ -1002,7 +1002,7 @@ static u8 SaveFileExistsCallback(void) { if (gDifferentSaveFile == TRUE) { - ShowSaveMessage(gText_DifferentSaveFile, SaveConfirmOverwriteNoCallback); + ShowSaveMessage(gText_DifferentSaveFile, SaveConfirmOverwriteDefaultNoCallback); } else { @@ -1012,16 +1012,16 @@ static u8 SaveFileExistsCallback(void) return SAVE_IN_PROGRESS; } -static u8 SaveConfirmOverwriteNoCallback(void) +static u8 SaveConfirmOverwriteDefaultNoCallback(void) { - sub_8197948(1); // Show Yes/No menu (No selected as default) + DisplayYesNoMenuWithDefaultDefaultNo(1); // Show Yes/No menu (No selected as default) sSaveDialogCallback = SaveOverwriteInputCallback; return SAVE_IN_PROGRESS; } static u8 SaveConfirmOverwriteCallback(void) { - DisplayYesNoMenu(); // Show Yes/No menu + DisplayYesNoMenuWithDefault(); // Show Yes/No menu sSaveDialogCallback = SaveOverwriteInputCallback; return SAVE_IN_PROGRESS; } @@ -1135,7 +1135,7 @@ static void InitBattlePyramidRetire(void) static u8 BattlePyramidConfirmRetireCallback(void) { - ClearWindowAndBorder(GetStartMenuWindowId(), FALSE); + ClearStdWindowAndFrame(GetStartMenuWindowId(), FALSE); RemoveStartMenuWindow(); ShowSaveMessage(gText_BattlePyramidConfirmRetire, BattlePyramidRetireYesNoCallback); @@ -1144,7 +1144,7 @@ static u8 BattlePyramidConfirmRetireCallback(void) static u8 BattlePyramidRetireYesNoCallback(void) { - sub_8197948(1); // Show Yes/No menu (No selected as default) + DisplayYesNoMenuWithDefaultDefaultNo(1); // Show Yes/No menu (No selected as default) sSaveDialogCallback = BattlePyramidRetireInputCallback; return SAVE_IN_PROGRESS; @@ -1313,7 +1313,7 @@ static void ShowSaveInfoWindow(void) } sSaveInfoWindowId = AddWindow(&saveInfoWindow); - NewMenuHelpers_DrawStdWindowFrame(sSaveInfoWindowId, FALSE); + DrawStdWindowFrame(sSaveInfoWindowId, FALSE); gender = gSaveBlock2Ptr->playerGender; color = TEXT_COLOR_RED; // Red when female, blue when male. @@ -1364,7 +1364,7 @@ static void ShowSaveInfoWindow(void) static void RemoveSaveInfoWindow(void) { - ClearWindowAndBorder(sSaveInfoWindowId, FALSE); + ClearStdWindowAndFrame(sSaveInfoWindowId, FALSE); RemoveWindow(sSaveInfoWindowId); } @@ -1386,7 +1386,7 @@ void sub_80A08CC(void) // Referenced in data/specials.inc and data/scripts/maps/ static void HideStartMenuWindow(void) { - ClearWindowAndBorder(GetStartMenuWindowId(), TRUE); + ClearStdWindowAndFrame(GetStartMenuWindowId(), TRUE); RemoveStartMenuWindow(); ScriptUnfreezeEventObjects(); ScriptContext2_Disable(); diff --git a/src/starter_choose.c b/src/starter_choose.c index 4e21c1845..3ffc8e286 100644 --- a/src/starter_choose.c +++ b/src/starter_choose.c @@ -469,7 +469,7 @@ static void MainCallback2_StarterChoose(void) static void Task_StarterChoose1(u8 taskId) { CreateStarterPokemonLabel(gTasks[taskId].tStarterSelection); - SetWindowBorderStyle(0, FALSE, 0x2A8, 0xD); + DrawStdFrameWithCustomTileAndPalette(0, FALSE, 0x2A8, 0xD); AddTextPrinterParameterized(0, 1, gText_BirchInTrouble, 0, 1, 0, NULL); PutWindowTilemap(0); schedule_bg_copy_tilemap_to_vram(0); diff --git a/src/trader.c b/src/trader.c index b5c159fb9..97bc4626f 100644 --- a/src/trader.c +++ b/src/trader.c @@ -73,7 +73,7 @@ void CreateAvailableDecorationsMenu(u8 taskId) } windowTemplate.width = convert_pixel_width_to_tile_width(windowWidth); data[3] = AddWindow(&windowTemplate); - SetWindowBorderStyle(data[3], FALSE, 0x214, 14); + DrawStdFrameWithCustomTileAndPalette(data[3], FALSE, 0x214, 14); for (i = 0; i < 4; i++) { if (trader->decorIds[i] > NUM_DECORATIONS) @@ -98,7 +98,7 @@ void sub_8133BE4(u8 taskId, u8 decorationId) gSpecialVar_0x8004 = decorationId; } - sub_8198070(data[3], FALSE); + ClearStdWindowAndFrameToTransparent(data[3], FALSE); ClearWindowTilemap(data[3]); RemoveWindow(data[3]); schedule_bg_copy_tilemap_to_vram(0); diff --git a/src/trainer_card.c b/src/trainer_card.c index c8f0df0db..1f9191632 100755 --- a/src/trainer_card.c +++ b/src/trainer_card.c @@ -469,7 +469,7 @@ static void sub_80C2760(u8 taskId) break; case 15: sub_800AC34(); - NewMenuHelpers_DrawDialogueFrame(0, 1); + DrawDialogueFrame(0, 1); AddTextPrinterParameterized(0, 1, gText_WaitingTrainerFinishReading, 0, 1, 255, 0); CopyWindowToVram(0, 3); sData->var_0 = 16; diff --git a/src/wallclock.c b/src/wallclock.c index 546750ba6..d3bbcf7a2 100644 --- a/src/wallclock.c +++ b/src/wallclock.c @@ -793,7 +793,7 @@ static void Task_SetClock2(u8 taskId) static void Task_SetClock3(u8 taskId) { - SetWindowBorderStyle(0, FALSE, 0x250, 0x0d); + DrawStdFrameWithCustomTileAndPalette(0, FALSE, 0x250, 0x0d); AddTextPrinterParameterized(0, 1, gText_IsThisTheCorrectTime, 0, 1, 0, NULL); PutWindowTilemap(0); schedule_bg_copy_tilemap_to_vram(0); @@ -812,7 +812,7 @@ static void Task_SetClock4(u8 taskId) case 1: //B button case -1: //NO PlaySE(SE_SELECT); - sub_8198070(0, FALSE); + ClearStdWindowAndFrameToTransparent(0, FALSE); ClearWindowTilemap(0); gTasks[taskId].func = Task_SetClock2; break; diff --git a/src/window.c b/src/window.c index 94e68cae5..fbce57743 100644 --- a/src/window.c +++ b/src/window.c @@ -6,6 +6,7 @@ u32 filler_03002F58; u32 filler_03002F5C; +// This global is set to 0 and never changed. u8 gTransparentTileNumber; u32 filler_03002F64; void *gUnknown_03002F70[4];