Minor clean up in menu.c (#8060)

This commit is contained in:
Estellar 2025-10-30 13:15:15 -03:00 committed by GitHub
parent 733512f677
commit fd84adc421
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 16 additions and 31 deletions

View File

@ -106,7 +106,6 @@ void DrawStdWindowFrame(u8 windowId, bool8 copyToVram);
u8 AddStartMenuWindow(u8 numActions);
u8 InitMenuNormal(u8 windowId, u8 fontId, u8 left, u8 top, u8 cursorHeight, u8 numChoices, u8 initialCursorPos);
void LoadMessageBoxAndFrameGfx(u8 windowId, bool8 copyToVram);
void AddTextPrinterForMessage_2(bool8 allowSkippingDelayWithButtonPress);
void RemoveStartMenuWindow(void);
void DisplayYesNoMenuWithDefault(u8 initialCursorPos);
void BufferSaveMenuText(u8 textId, u8 *dest, u8 color);

View File

@ -197,13 +197,6 @@ u16 AddTextPrinterParameterized2(u8 windowId, u8 fontId, const u8 *str, u8 speed
}
void AddTextPrinterForMessage(bool8 allowSkippingDelayWithButtonPress)
{
void (*callback)(struct TextPrinterTemplate *, u16) = NULL;
gTextFlags.canABSpeedUpPrint = allowSkippingDelayWithButtonPress;
AddTextPrinterParameterized2(0, FONT_NORMAL, gStringVar4, GetPlayerTextSpeedDelay(), callback, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GRAY);
}
void AddTextPrinterForMessage_2(bool8 allowSkippingDelayWithButtonPress)
{
gTextFlags.canABSpeedUpPrint = allowSkippingDelayWithButtonPress;
AddTextPrinterParameterized2(0, FONT_NORMAL, gStringVar4, GetPlayerTextSpeedDelay(), NULL, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GRAY);
@ -420,8 +413,6 @@ void ClearStdWindowAndFrame(u8 windowId, bool8 copyToVram)
static void WindowFunc_DrawStandardFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum)
{
int i;
FillBgTilemapBufferRect(bg,
STD_WINDOW_BASE_TILE_NUM + 0,
tilemapLeft - 1,
@ -443,25 +434,20 @@ static void WindowFunc_DrawStandardFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u
1,
1,
STD_WINDOW_PALETTE_NUM);
for (i = tilemapTop; i < tilemapTop + height; i++)
{
FillBgTilemapBufferRect(bg,
STD_WINDOW_BASE_TILE_NUM + 3,
tilemapLeft - 1,
i,
1,
1,
STD_WINDOW_PALETTE_NUM);
FillBgTilemapBufferRect(bg,
STD_WINDOW_BASE_TILE_NUM + 5,
tilemapLeft + width,
i,
1,
1,
STD_WINDOW_PALETTE_NUM);
}
FillBgTilemapBufferRect(bg,
STD_WINDOW_BASE_TILE_NUM + 3,
tilemapLeft - 1,
tilemapTop,
1,
height,
STD_WINDOW_PALETTE_NUM);
FillBgTilemapBufferRect(bg,
STD_WINDOW_BASE_TILE_NUM + 5,
tilemapLeft + width,
tilemapTop,
1,
height,
STD_WINDOW_PALETTE_NUM);
FillBgTilemapBufferRect(bg,
STD_WINDOW_BASE_TILE_NUM + 6,
tilemapLeft - 1,

View File

@ -957,7 +957,7 @@ static void ShowSaveMessage(const u8 *message, u8 (*saveCallback)(void))
{
StringExpandPlaceholders(gStringVar4, message);
LoadMessageBoxAndFrameGfx(0, TRUE);
AddTextPrinterForMessage_2(TRUE);
AddTextPrinterForMessage(TRUE);
sSavingComplete = TRUE;
sSaveDialogCallback = saveCallback;
}

View File

@ -3612,7 +3612,7 @@ static bool8 PrintOnTextbox(u8 *textState, const u8 *str)
LoadMessageBoxAndBorderGfx();
DrawDialogueFrame(0, TRUE);
StringExpandPlaceholders(gStringVar4, str);
AddTextPrinterForMessage_2(TRUE);
AddTextPrinterForMessage(TRUE);
(*textState)++;
break;
case 1: