Begin cleaning text.c
This commit is contained in:
@@ -2938,7 +2938,7 @@ void BattlePutTextOnWindow(const u8 *text, u8 windowId)
|
||||
{
|
||||
const struct BattleWindowText *textInfo = sBattleTextOnWindowsInfo[gBattleScripting.windowsType];
|
||||
bool32 copyToVram;
|
||||
struct TextSubPrinter textSubPrinter;
|
||||
struct TextPrinterTemplate printerTemplate;
|
||||
u8 speed;
|
||||
|
||||
if (windowId & 0x80)
|
||||
@@ -2952,25 +2952,25 @@ void BattlePutTextOnWindow(const u8 *text, u8 windowId)
|
||||
copyToVram = TRUE;
|
||||
}
|
||||
|
||||
textSubPrinter.current_text_offset = text;
|
||||
textSubPrinter.windowId = windowId;
|
||||
textSubPrinter.fontId = textInfo[windowId].fontId;
|
||||
textSubPrinter.x = textInfo[windowId].x;
|
||||
textSubPrinter.y = textInfo[windowId].y;
|
||||
textSubPrinter.currentX = textSubPrinter.x;
|
||||
textSubPrinter.currentY = textSubPrinter.y;
|
||||
textSubPrinter.letterSpacing = textInfo[windowId].letterSpacing;
|
||||
textSubPrinter.lineSpacing = textInfo[windowId].lineSpacing;
|
||||
textSubPrinter.fontColor_l = 0;
|
||||
textSubPrinter.fgColor = textInfo[windowId].fgColor;
|
||||
textSubPrinter.bgColor = textInfo[windowId].bgColor;
|
||||
textSubPrinter.shadowColor = textInfo[windowId].shadowColor;
|
||||
printerTemplate.currentChar = text;
|
||||
printerTemplate.windowId = windowId;
|
||||
printerTemplate.fontId = textInfo[windowId].fontId;
|
||||
printerTemplate.x = textInfo[windowId].x;
|
||||
printerTemplate.y = textInfo[windowId].y;
|
||||
printerTemplate.currentX = printerTemplate.x;
|
||||
printerTemplate.currentY = printerTemplate.y;
|
||||
printerTemplate.letterSpacing = textInfo[windowId].letterSpacing;
|
||||
printerTemplate.lineSpacing = textInfo[windowId].lineSpacing;
|
||||
printerTemplate.fontColor_l = 0;
|
||||
printerTemplate.fgColor = textInfo[windowId].fgColor;
|
||||
printerTemplate.bgColor = textInfo[windowId].bgColor;
|
||||
printerTemplate.shadowColor = textInfo[windowId].shadowColor;
|
||||
|
||||
if (textSubPrinter.x == 0xFF)
|
||||
if (printerTemplate.x == 0xFF)
|
||||
{
|
||||
u32 width = sub_80397C4(gBattleScripting.windowsType, windowId);
|
||||
s32 alignX = GetStringCenterAlignXOffsetWithLetterSpacing(textSubPrinter.fontId, textSubPrinter.current_text_offset, width, textSubPrinter.letterSpacing);
|
||||
textSubPrinter.x = textSubPrinter.currentX = alignX;
|
||||
s32 alignX = GetStringCenterAlignXOffsetWithLetterSpacing(printerTemplate.fontId, printerTemplate.currentChar, width, printerTemplate.letterSpacing);
|
||||
printerTemplate.x = printerTemplate.currentX = alignX;
|
||||
}
|
||||
|
||||
if (windowId == 0x16)
|
||||
@@ -2992,15 +2992,15 @@ void BattlePutTextOnWindow(const u8 *text, u8 windowId)
|
||||
else
|
||||
speed = GetPlayerTextSpeed();
|
||||
|
||||
gTextFlags.flag_0 = 1;
|
||||
gTextFlags.canABSpeedUpPrint = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
speed = textInfo[windowId].speed;
|
||||
gTextFlags.flag_0 = 0;
|
||||
gTextFlags.canABSpeedUpPrint = 0;
|
||||
}
|
||||
|
||||
AddTextPrinter(&textSubPrinter, speed, NULL);
|
||||
AddTextPrinter(&printerTemplate, speed, NULL);
|
||||
|
||||
if (copyToVram)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user