Decompile new_menu_helpers.s

This commit is contained in:
Diegoisawesome
2018-01-25 15:25:35 -06:00
parent 10037ac0e1
commit 7d8a2ae7f0
30 changed files with 534 additions and 1266 deletions

View File

@@ -2440,7 +2440,7 @@ void BattleHandleAddTextPrinter(const u8 *text, u8 arg1)
textSubPrinter.letterSpacing = r8[(12 * arg1) + 4];
textSubPrinter.lineSpacing = r8[(12 * arg1) + 5];
textSubPrinter.fontColor_l = 0;
textSubPrinter.fontColor_h = r8[(12 * arg1) + 7];
textSubPrinter.fgColor = r8[(12 * arg1) + 7];
textSubPrinter.bgColor = r8[(12 * arg1) + 8];
textSubPrinter.shadowColor = r8[(12 * arg1) + 9];

View File

@@ -6730,7 +6730,7 @@ static void PutLevelAndGenderOnLvlUpBox(void)
subPrinter.letterSpacing = 0;
subPrinter.lineSpacing = 0;
subPrinter.fontColor_l = TEXT_COLOR_TRANSPARENT;
subPrinter.fontColor_h = TEXT_COLOR_WHITE;
subPrinter.fgColor = TEXT_COLOR_WHITE;
subPrinter.bgColor = TEXT_COLOR_TRANSPARENT;
subPrinter.shadowColor = TEXT_COLOR_DARK_GREY;

View File

@@ -3489,7 +3489,7 @@ void ShowBerryBlenderRecordWindow(void)
winTemplate = sBlenderRecordWindowTemplate;
gResultsWindowId = AddWindow(&winTemplate);
sub_81973FC(gResultsWindowId, 0);
NewMenuHelpers_DrawStdWindowFrame(gResultsWindowId, 0);
FillWindowPixelBuffer(gResultsWindowId, 0x11);
xPos = GetStringCenterAlignXOffset(1, gText_BlenderMaxSpeedRecord, 0x90);

View File

@@ -43,7 +43,7 @@ extern u16 ItemIdToBattleMoveId(u16);
extern s32 ListMenuHandleInputGetItemId(u8);
extern void sub_81AE6C8(u8, u16*, u16*);
extern void sub_819746C(u8, bool8);
extern void sub_81973FC(u8, bool8);
extern void NewMenuHelpers_DrawStdWindowFrame(u8, bool8);
extern void sub_81B9328(void);
extern void sub_81AF078(u32, bool8, struct ListMenu *);
extern void c2_exit_to_overworld_2_switch(void);
@@ -1212,7 +1212,7 @@ static void DaycareAddTextPrinter(u8 windowId, const u8 *text, u32 x, u32 y)
gTextFlags.flag_1 = 0;
printer.letterSpacing = 0;
printer.lineSpacing = 1;
printer.fontColor_h = 2;
printer.fgColor = 2;
printer.bgColor = 1;
printer.shadowColor = 3;
@@ -1296,7 +1296,7 @@ void ShowDaycareLevelMenu(void)
u8 daycareMenuTaskId;
windowId = AddWindow(&sDaycareLevelMenuWindowTemplate);
sub_81973FC(windowId, FALSE);
NewMenuHelpers_DrawStdWindowFrame(windowId, FALSE);
menuTemplate = sDaycareListMenuLevelTemplate;
menuTemplate.unk_10 = windowId;

View File

@@ -727,7 +727,7 @@ void sub_81271CC(u8 taskId)
{
sub_8126A58(1);
sub_8126A88();
sub_81973C4(0, 0);
NewMenuHelpers_DrawDialogueFrame(0, 0);
sub_8126C08();
gTasks[taskId].func = sub_8126B80;
}
@@ -2712,7 +2712,7 @@ void sub_812A334(void)
u8 taskId;
pal_fill_black();
sub_81973C4(0, 1);
NewMenuHelpers_DrawDialogueFrame(0, 1);
sub_8126ABC();
taskId = CreateTask(sub_812A2C4, 8);
gTasks[taskId].data[2] = 0;

View File

@@ -81,7 +81,7 @@ extern const u8 gText_MainMenuTime[];
extern const u8 gContestConfetti_Gfx[];
extern const u8 gContestConfetti_Pal[];
extern void sub_81973C4(u8, u8);
extern void NewMenuHelpers_DrawDialogueFrame(u8, u8);
extern u16 AddTextPrinterParameterized(u8 windowId, u8 fontId, const u8 *str, u8 speed, void ( *callback)(u16, struct TextPrinter *), u8 fgColor, u8 bgColor, u8 shadowColor);
extern void sub_8175620(void);
extern u8 TrySavingData(u8);
@@ -539,7 +539,7 @@ static void Task_Hof_InitTeamSaveData(u8 taskId)
}
*lastSavedTeam = *sHofMonPtr;
sub_81973C4(0, 0);
NewMenuHelpers_DrawDialogueFrame(0, 0);
AddTextPrinterParameterized(0, 1, gText_SavingDontTurnOffPower, 0, NULL, 2, 1, 3);
CopyWindowToVram(0, 3);
gTasks[taskId].func = Task_Hof_TrySaveData;
@@ -746,7 +746,7 @@ static void Task_Hof_WaitAndPrintPlayerInfo(u8 taskId)
{
FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 0x20, 0x20);
HallOfFame_PrintPlayerInfo(1, 2);
sub_81973C4(0, 0);
NewMenuHelpers_DrawDialogueFrame(0, 0);
AddTextPrinterParameterized(0, 1, gText_LeagueChamp, 0, NULL, 2, 1, 3);
CopyWindowToVram(0, 3);
gTasks[taskId].func = Task_Hof_ExitOnKeyPressed;
@@ -1115,7 +1115,7 @@ static void Task_HofPC_HandleExit(u8 taskId)
static void Task_HofPC_PrintDataIsCorrupted(u8 taskId)
{
sub_8198180(gText_UnkCtrlF800Exit, 8, 1);
sub_81973C4(0, 0);
NewMenuHelpers_DrawDialogueFrame(0, 0);
AddTextPrinterParameterized(0, 1, gText_HOFCorrupted, 0, NULL, 2, 1, 3);
CopyWindowToVram(0, 3);
gTasks[taskId].func = Task_HofPC_ExitOnButtonPress;

View File

@@ -530,7 +530,7 @@ static void DisplaySentToPCMessage(void)
stringToDisplay++;
StringExpandPlaceholders(gStringVar4, gUnknown_0858BDB8[stringToDisplay]);
sub_81973C4(0, 0);
NewMenuHelpers_DrawDialogueFrame(0, 0);
gTextFlags.flag_0 = TRUE;
AddTextPrinterParameterized(0, 1, gStringVar4, GetPlayerTextSpeed(), 0, 2, 1, 3);
CopyWindowToVram(0, 3);

442
src/new_menu_helpers.c Normal file
View File

@@ -0,0 +1,442 @@
#include "global.h"
#include "bg.h"
#include "palette.h"
#include "window.h"
#include "text.h"
#include "new_menu_helpers.h"
#include "text_window.h"
#include "menu.h"
#include "menu_helpers.h"
#define STD_WINDOW_PALETTE_NUM 14
#define STD_WINDOW_BASE_TILE_NUM 0x214
#define DLG_WINDOW_PALETTE_NUM 15
#define DLG_WINDOW_BASE_TILE_NUM 0x200
extern EWRAM_DATA u8 gUnknown_0203CD8C;
extern EWRAM_DATA u8 gUnknown_0203CD8D;
extern const u8 gUnknown_0860EA6C[];
extern const u16 gUnknown_0860EA4C[];
extern const u16 gUnknown_0860F074[];
extern const u8 gUnknown_0860F094[];
extern const struct WindowTemplate gUnknown_0860F098[];
extern const struct WindowTemplate gUnknown_0860F0A8;
extern void sub_819645C(void);
// 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 sub_81977BC(u8, u8, u8, u8, u8, u8);
extern void sub_8197804(u8, u8, u8, u8, u8, u8);
void sub_8197184(u8 window, u32 destTile, u32 destPalette)
{
LoadBgTiles(GetWindowAttribute(window, WINDOW_PRIORITY), gUnknown_0860EA6C, 0x100, destTile);
LoadPalette(gUnknown_0860EA4C, destPalette * 16, 32);
}
void sub_81971C4(void)
{
sub_819645C();
}
void sub_81971D0(void)
{
InitWindows(gUnknown_0860F098);
gUnknown_0203CD8C = 0xFF;
gUnknown_0203CD8D = 0xFF;
}
void sub_81971F4(void)
{
FreeAllWindowBuffers();
}
void sub_8197200(void)
{
ChangeBgX(0, 0, 0);
ChangeBgY(0, 0, 0);
DeactivateAllTextPrinters();
sub_81973A4();
}
u16 sub_8197224(void)
{
RunTextPrinters();
return IsTextPrinterActive(0);
}
u16 AddTextPrinterParameterized(u8 windowId, u8 fontId, const u8 *str, u8 speed, void (*callback)(struct TextSubPrinter *, u16), u8 fgColor, u8 bgColor, u8 shadowColor)
{
struct TextSubPrinter printer;
printer.current_text_offset = str;
printer.windowId = windowId;
printer.fontId = fontId;
printer.x = 0;
printer.y = 1;
printer.currentX = 0;
printer.currentY = 1;
printer.letterSpacing = 0;
printer.lineSpacing = 0;
printer.fontColor_l = 0;
printer.fgColor = fgColor;
printer.bgColor = bgColor;
printer.shadowColor = shadowColor;
gTextFlags.flag_1 = 0;
return AddTextPrinter(&printer, speed, callback);
}
void AddTextPrinterForMessage(bool8 allowSkippingDelayWithButtonPress)
{
void (*callback)(struct TextSubPrinter *, u16) = NULL;
gTextFlags.flag_0 = allowSkippingDelayWithButtonPress;
AddTextPrinterParameterized(0, 1, gStringVar4, GetPlayerTextSpeed(), callback, 2, 1, 3);
}
void AddTextPrinterForMessage_2(bool8 allowSkippingDelayWithButtonPress)
{
gTextFlags.flag_0 = allowSkippingDelayWithButtonPress;
AddTextPrinterParameterized(0, 1, gStringVar4, GetPlayerTextSpeed(), NULL, 2, 1, 3);
}
void AddTextPrinterWithCustomSpeedForMessage(bool8 allowSkippingDelayWithButtonPress, u8 speed)
{
gTextFlags.flag_0 = allowSkippingDelayWithButtonPress;
AddTextPrinterParameterized(0, 1, gStringVar4, speed, NULL, 2, 1, 3);
}
void sub_81973A4(void)
{
copy_textbox_border_tile_patterns_to_vram(0, DLG_WINDOW_BASE_TILE_NUM, 0xF0);
sub_809882C(0, STD_WINDOW_BASE_TILE_NUM, 0xE0);
}
void NewMenuHelpers_DrawDialogueFrame(u8 windowId, bool8 copyToVram)
{
CallWindowFunction(windowId, DrawDialogueFrame);
FillWindowPixelBuffer(windowId, 0x11);
PutWindowTilemap(windowId);
if (copyToVram == TRUE)
CopyWindowToVram(windowId, 3);
}
void NewMenuHelpers_DrawStdWindowFrame(u8 windowId, bool8 copyToVram)
{
CallWindowFunction(windowId, DrawStandardFrame);
FillWindowPixelBuffer(windowId, 0x11);
PutWindowTilemap(windowId);
if (copyToVram == TRUE)
CopyWindowToVram(windowId, 3);
}
void sub_8197434(u8 windowId, bool8 copyToVram)
{
CallWindowFunction(windowId, sub_8197804);
FillWindowPixelBuffer(windowId, 0x11);
ClearWindowTilemap(windowId);
if (copyToVram == TRUE)
CopyWindowToVram(windowId, 3);
}
void sub_819746C(u8 windowId, bool8 copyToVram)
{
CallWindowFunction(windowId, sub_81977BC);
FillWindowPixelBuffer(windowId, 0x11);
ClearWindowTilemap(windowId);
if (copyToVram == TRUE)
CopyWindowToVram(windowId, 3);
}
void 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,
tilemapTop - 1,
1,
1,
STD_WINDOW_PALETTE_NUM);
FillBgTilemapBufferRect(bg,
STD_WINDOW_BASE_TILE_NUM + 1,
tilemapLeft,
tilemapTop - 1,
width,
1,
STD_WINDOW_PALETTE_NUM);
FillBgTilemapBufferRect(bg,
STD_WINDOW_BASE_TILE_NUM + 2,
tilemapLeft + width,
tilemapTop - 1,
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 + 6,
tilemapLeft - 1,
tilemapTop + height,
1,
1,
STD_WINDOW_PALETTE_NUM);
FillBgTilemapBufferRect(bg,
STD_WINDOW_BASE_TILE_NUM + 7,
tilemapLeft,
tilemapTop + height,
width,
1,
STD_WINDOW_PALETTE_NUM);
FillBgTilemapBufferRect(bg,
STD_WINDOW_BASE_TILE_NUM + 8,
tilemapLeft + width,
tilemapTop + height,
1,
1,
STD_WINDOW_PALETTE_NUM);
}
void DrawDialogueFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum)
{
FillBgTilemapBufferRect(bg,
DLG_WINDOW_BASE_TILE_NUM + 1,
tilemapLeft - 2,
tilemapTop - 1,
1,
1,
DLG_WINDOW_PALETTE_NUM);
FillBgTilemapBufferRect(bg,
DLG_WINDOW_BASE_TILE_NUM + 3,
tilemapLeft - 1,
tilemapTop - 1,
1,
1,
DLG_WINDOW_PALETTE_NUM);
FillBgTilemapBufferRect(bg,
DLG_WINDOW_BASE_TILE_NUM + 4,
tilemapLeft,
tilemapTop - 1,
width - 1,
1,
DLG_WINDOW_PALETTE_NUM);
FillBgTilemapBufferRect(bg,
DLG_WINDOW_BASE_TILE_NUM + 5,
tilemapLeft + width - 1,
tilemapTop - 1,
1,
1,
DLG_WINDOW_PALETTE_NUM);
FillBgTilemapBufferRect(bg,
DLG_WINDOW_BASE_TILE_NUM + 6,
tilemapLeft + width,
tilemapTop - 1,
1,
1,
DLG_WINDOW_PALETTE_NUM);
FillBgTilemapBufferRect(bg,
DLG_WINDOW_BASE_TILE_NUM + 7,
tilemapLeft - 2,
tilemapTop,
1,
5,
DLG_WINDOW_PALETTE_NUM);
FillBgTilemapBufferRect(bg,
DLG_WINDOW_BASE_TILE_NUM + 9,
tilemapLeft - 1,
tilemapTop,
width + 1,
5,
DLG_WINDOW_PALETTE_NUM);
FillBgTilemapBufferRect(bg,
DLG_WINDOW_BASE_TILE_NUM + 10,
tilemapLeft + width,
tilemapTop,
1,
5,
DLG_WINDOW_PALETTE_NUM);
FillBgTilemapBufferRect(bg,
BG_TILE_V_FLIP(DLG_WINDOW_BASE_TILE_NUM + 1),
tilemapLeft - 2,
tilemapTop + height,
1,
1,
DLG_WINDOW_PALETTE_NUM);
FillBgTilemapBufferRect(bg,
BG_TILE_V_FLIP(DLG_WINDOW_BASE_TILE_NUM + 3),
tilemapLeft - 1,
tilemapTop + height,
1,
1,
DLG_WINDOW_PALETTE_NUM);
FillBgTilemapBufferRect(bg,
BG_TILE_V_FLIP(DLG_WINDOW_BASE_TILE_NUM + 4),
tilemapLeft,
tilemapTop + height,
width - 1,
1,
DLG_WINDOW_PALETTE_NUM);
FillBgTilemapBufferRect(bg,
BG_TILE_V_FLIP(DLG_WINDOW_BASE_TILE_NUM + 5),
tilemapLeft + width - 1,
tilemapTop + height,
1,
1,
DLG_WINDOW_PALETTE_NUM);
FillBgTilemapBufferRect(bg,
BG_TILE_V_FLIP(DLG_WINDOW_BASE_TILE_NUM + 6),
tilemapLeft + width,
tilemapTop + height,
1,
1,
DLG_WINDOW_PALETTE_NUM);
}
void sub_81977BC(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);
}
void sub_8197804(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);
}
void sub_819786C(u8 windowId, bool8 copyToVram)
{
copy_textbox_border_tile_patterns_to_vram(windowId, DLG_WINDOW_BASE_TILE_NUM, 0xF0);
sub_8197B1C(windowId, copyToVram, DLG_WINDOW_BASE_TILE_NUM, 0xF);
}
void sub_819789C(void)
{
LoadPalette(gUnknown_0860F074, 0xE0, 0x14);
}
void sub_81978B0(u16 offset)
{
LoadPalette(gUnknown_0860F074, offset, 0x14);
}
const u16 *sub_81978C8(void)
{
return gUnknown_0860F074;
}
u16 sub_81978D0(u8 colorNum)
{
if (colorNum > 15)
colorNum = 0;
return gUnknown_0860F074[colorNum];
}
void DisplayItemMessageOnField(u8 taskId, const u8 *string, TaskFunc callback)
{
sub_81973A4();
DisplayMessageAndContinueTask(taskId, 0, DLG_WINDOW_BASE_TILE_NUM, DLG_WINDOW_PALETTE_NUM, 1, GetPlayerTextSpeed(), string, callback);
CopyWindowToVram(0, 3);
}
void sub_8197930(void)
{
CreateYesNoMenu(&gUnknown_0860F0A8, STD_WINDOW_BASE_TILE_NUM, STD_WINDOW_PALETTE_NUM, 0);
}
void sub_8197948(u8 initialCursorPos)
{
CreateYesNoMenu(&gUnknown_0860F0A8, STD_WINDOW_BASE_TILE_NUM, STD_WINDOW_PALETTE_NUM, initialCursorPos);
}
u32 sub_8197964(void)
{
if (gTextFlags.flag_3)
return 1;
return gSaveBlock2Ptr->optionsTextSpeed;
}
u8 GetPlayerTextSpeed(void)
{
u32 speed;
if (gSaveBlock2Ptr->optionsTextSpeed > 2)
gSaveBlock2Ptr->optionsTextSpeed = 1;
speed = sub_8197964();
return gUnknown_0860F094[speed];
}
u8 sub_81979C4(u8 a1)
{
if (gUnknown_0203CD8C == 0xFF)
gUnknown_0203CD8C = sub_8198AA4(0, 0x16, 1, 7, (a1 * 2) + 2, 0xF, 0x139);
return gUnknown_0203CD8C;
}
u8 GetStartMenuWindowId(void)
{
return gUnknown_0203CD8C;
}
void remove_start_menu_window_maybe(void)
{
if (gUnknown_0203CD8C != 0xFF)
{
RemoveWindow(gUnknown_0203CD8C);
gUnknown_0203CD8C = 0xFF;
}
}
u16 sub_8197A30(void)
{
return DLG_WINDOW_BASE_TILE_NUM;
}
u16 sub_8197A38(void)
{
return STD_WINDOW_BASE_TILE_NUM;
}
u8 AddMapNamePopUpWindow(void)
{
if (gUnknown_0203CD8D == 0xFF)
gUnknown_0203CD8D = sub_8198AA4(0, 1, 1, 10, 3, 14, 0x107);
return gUnknown_0203CD8D;
}
u8 GetMapNamePopUpWindowId(void)
{
return gUnknown_0203CD8D;
}
void RemoveMapNamePopUpWindow(void)
{
if (gUnknown_0203CD8D != 0xFF)
{
RemoveWindow(gUnknown_0203CD8D);
gUnknown_0203CD8D = 0xFF;
}
}

View File

@@ -1313,7 +1313,7 @@ bool8 ScrCmd_cmdDB(struct ScriptContext *ctx)
if (msg == NULL)
msg = (const u8 *)ctx->data[0];
sub_81973A4();
sub_81973C4(0, 1);
NewMenuHelpers_DrawDialogueFrame(0, 1);
PrintTextOnWindow(0, 1, msg, 0, 1, 0, 0);
return FALSE;
}
@@ -1530,7 +1530,7 @@ bool8 ScrCmd_braillemessage(struct ScriptContext *ctx)
template2 = template1;
gUnknown_03000F30 = AddWindow(&template2);
sub_809882C(gUnknown_03000F30, 0x214, 0xE0);
sub_81973FC(gUnknown_03000F30, 0);
NewMenuHelpers_DrawStdWindowFrame(gUnknown_03000F30, 0);
PutWindowTilemap(gUnknown_03000F30);
FillWindowPixelBuffer(gUnknown_03000F30, 0x11);
PrintTextOnWindow(gUnknown_03000F30, 6, gStringVar4, temp1, temp2, 0xFF, 0x0);
@@ -1651,7 +1651,7 @@ _0809AEC6:\n\
bl sub_809882C\n\
ldrb r0, [r5]\n\
mov r1, #0\n\
bl sub_81973FC\n\
bl NewMenuHelpers_DrawStdWindowFrame\n\
ldrb r0, [r5]\n\
bl PutWindowTilemap\n\
ldrb r0, [r5]\n\

View File

@@ -32,7 +32,7 @@ extern bool32 InUnionRoom(void);
extern bool8 InBattlePike(void);
extern bool8 InBattlePyramid(void);
extern bool8 InMultiBattleRoom(void);
extern void sub_81973FC(u8 windowId, u8 a1);
extern void NewMenuHelpers_DrawStdWindowFrame(u8 windowId, u8 a1);
extern void sub_8198070(u8 windowId, u8 a1);
// this file's functions
@@ -224,7 +224,7 @@ void DisplaySafariBallsWindow(void)
{
sSafariBallsWindowId = AddWindow(&gSafariBallsWindowTemplate);
PutWindowTilemap(sSafariBallsWindowId);
sub_81973FC(sSafariBallsWindowId, 0);
NewMenuHelpers_DrawStdWindowFrame(sSafariBallsWindowId, 0);
ConvertIntToDecimalStringN(gStringVar1, gNumSafariBalls, STR_CONV_MODE_RIGHT_ALIGN, 2);
StringExpandPlaceholders(gStringVar4, gText_SafariBallStock);
PrintTextOnWindow(sSafariBallsWindowId, 1, gStringVar4, 0, 1, 0xFF, NULL);
@@ -239,7 +239,7 @@ void DisplayPyramidFloorWindow(void)
else
sBattlePyramidFloorWindowId = AddWindow(&gPyramidFloorWindowTemplate_2);
PutWindowTilemap(sBattlePyramidFloorWindowId);
sub_81973FC(sBattlePyramidFloorWindowId, 0);
NewMenuHelpers_DrawStdWindowFrame(sBattlePyramidFloorWindowId, 0);
StringCopy(gStringVar1, sPyramindFloorNames[gSaveBlock2Ptr->field_CAA[4]]);
StringExpandPlaceholders(gStringVar4, gText_BattlePyramidFloor);
PrintTextOnWindow(sBattlePyramidFloorWindowId, 1, gStringVar4, 0, 1, 0xFF, NULL);

View File

@@ -159,7 +159,7 @@ u16 PrintTextOnWindow(u8 windowId, u8 fontId, const u8 *str, u8 x, u8 y, u8 spee
subPrinter.letterSpacing = gFonts[fontId].letterSpacing;
subPrinter.lineSpacing = gFonts[fontId].lineSpacing;
subPrinter.fontColor_l = gFonts[fontId].fontColor_l;
subPrinter.fontColor_h = gFonts[fontId].fontColor_h;
subPrinter.fgColor = gFonts[fontId].fgColor;
subPrinter.bgColor = gFonts[fontId].bgColor;
subPrinter.shadowColor = gFonts[fontId].shadowColor;
return AddTextPrinter(&subPrinter, speed, callback);
@@ -189,7 +189,7 @@ bool16 AddTextPrinter(struct TextSubPrinter *textSubPrinter, u8 speed, void (*ca
gTempTextPrinter.minLetterSpacing = 0;
gTempTextPrinter.japanese = 0;
GenerateFontHalfRowLookupTable(textSubPrinter->fontColor_h, textSubPrinter->bgColor, textSubPrinter->shadowColor);
GenerateFontHalfRowLookupTable(textSubPrinter->fgColor, textSubPrinter->bgColor, textSubPrinter->shadowColor);
if (speed != TEXT_SPEED_FF && speed != 0x0)
{
--gTempTextPrinter.text_speed;
@@ -3218,7 +3218,7 @@ u8 GetFontAttribute(u8 fontId, u8 attributeId)
result = gFontInfos[fontId].fontColor_l;
break;
case 5:
result = gFontInfos[fontId].fontColor_h;
result = gFontInfos[fontId].fgColor;
break;
case 6:
result = gFontInfos[fontId].bgColor;

View File

@@ -57,24 +57,24 @@ u16 Font6Func(struct TextPrinter *textPrinter)
switch (char_)
{
case 1:
textPrinter->subPrinter.fontColor_h = *textPrinter->subPrinter.current_text_offset ++;
GenerateFontHalfRowLookupTable(textPrinter->subPrinter.fontColor_h, textPrinter->subPrinter.bgColor, textPrinter->subPrinter.shadowColor);
textPrinter->subPrinter.fgColor = *textPrinter->subPrinter.current_text_offset ++;
GenerateFontHalfRowLookupTable(textPrinter->subPrinter.fgColor, textPrinter->subPrinter.bgColor, textPrinter->subPrinter.shadowColor);
return 2;
case 2:
textPrinter->subPrinter.bgColor = *textPrinter->subPrinter.current_text_offset ++;
GenerateFontHalfRowLookupTable(textPrinter->subPrinter.fontColor_h, textPrinter->subPrinter.bgColor, textPrinter->subPrinter.shadowColor);
GenerateFontHalfRowLookupTable(textPrinter->subPrinter.fgColor, textPrinter->subPrinter.bgColor, textPrinter->subPrinter.shadowColor);
return 2;
case 3:
textPrinter->subPrinter.shadowColor = *textPrinter->subPrinter.current_text_offset ++;
GenerateFontHalfRowLookupTable(textPrinter->subPrinter.fontColor_h, textPrinter->subPrinter.bgColor, textPrinter->subPrinter.shadowColor);
GenerateFontHalfRowLookupTable(textPrinter->subPrinter.fgColor, textPrinter->subPrinter.bgColor, textPrinter->subPrinter.shadowColor);
return 2;
case 4:
textPrinter->subPrinter.fontColor_h = *textPrinter->subPrinter.current_text_offset;
textPrinter->subPrinter.fgColor = *textPrinter->subPrinter.current_text_offset;
textPrinter->subPrinter.bgColor = *++ textPrinter->subPrinter.current_text_offset;
textPrinter->subPrinter.shadowColor = *++ textPrinter->subPrinter.current_text_offset;
textPrinter->subPrinter.current_text_offset ++;
GenerateFontHalfRowLookupTable(textPrinter->subPrinter.fontColor_h, textPrinter->subPrinter.bgColor, textPrinter->subPrinter.shadowColor);
GenerateFontHalfRowLookupTable(textPrinter->subPrinter.fgColor, textPrinter->subPrinter.bgColor, textPrinter->subPrinter.shadowColor);
return 2;
case 5:
textPrinter->subPrinter.current_text_offset ++;