Use window constants in party_menu
This commit is contained in:
@@ -161,14 +161,18 @@ enum {
|
||||
#define MENU_DIR_RIGHT 2
|
||||
#define MENU_DIR_LEFT -2
|
||||
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
CAN_LEARN_MOVE,
|
||||
CANNOT_LEARN_MOVE,
|
||||
ALREADY_KNOWS_MOVE,
|
||||
CANNOT_LEARN_MOVE_IS_EGG
|
||||
};
|
||||
|
||||
enum {
|
||||
// Window ids 0-5 are implicitly assigned to each party pokemon in InitPartyMenuBoxes
|
||||
WIN_MSG = PARTY_SIZE,
|
||||
};
|
||||
|
||||
struct PartyMenuBoxInfoRects
|
||||
{
|
||||
void (*blitFunc)(u8, u8, u8, u8, u8, bool8);
|
||||
@@ -320,7 +324,7 @@ static void UpdateCurrentPartySelection(s8 *, s8);
|
||||
static void UpdatePartySelectionSingleLayout(s8 *, s8);
|
||||
static void UpdatePartySelectionDoubleLayout(s8 *, s8);
|
||||
static s8 GetNewSlotDoubleLayout(s8, s8);
|
||||
static void PartyMenuPrintText(const u8 *);
|
||||
static void PrintMessage(const u8 *);
|
||||
static void Task_PrintAndWaitForText(u8);
|
||||
static bool16 IsMonAllowedInPokemonJump(struct Pokemon *);
|
||||
static bool16 IsMonAllowedInDodrioBerryPicking(struct Pokemon *);
|
||||
@@ -1703,7 +1707,7 @@ u8 DisplayPartyMenuMessage(const u8 *str, bool8 keepOpen)
|
||||
{
|
||||
u8 taskId;
|
||||
|
||||
PartyMenuPrintText(str);
|
||||
PrintMessage(str);
|
||||
taskId = CreateTask(Task_PrintAndWaitForText, 1);
|
||||
gTasks[taskId].tKeepOpen = keepOpen;
|
||||
return taskId;
|
||||
@@ -1711,12 +1715,12 @@ u8 DisplayPartyMenuMessage(const u8 *str, bool8 keepOpen)
|
||||
|
||||
static void Task_PrintAndWaitForText(u8 taskId)
|
||||
{
|
||||
if (RunTextPrintersRetIsActive(6) != TRUE)
|
||||
if (RunTextPrintersRetIsActive(WIN_MSG) != TRUE)
|
||||
{
|
||||
if (gTasks[taskId].tKeepOpen == FALSE)
|
||||
{
|
||||
ClearStdWindowAndFrameToTransparent(6, FALSE);
|
||||
ClearWindowTilemap(6);
|
||||
ClearStdWindowAndFrameToTransparent(WIN_MSG, FALSE);
|
||||
ClearWindowTilemap(WIN_MSG);
|
||||
}
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
@@ -1742,8 +1746,8 @@ static void Task_ReturnToChooseMonAfterText(u8 taskId)
|
||||
{
|
||||
if (IsPartyMenuTextPrinterActive() != TRUE)
|
||||
{
|
||||
ClearStdWindowAndFrameToTransparent(6, FALSE);
|
||||
ClearWindowTilemap(6);
|
||||
ClearStdWindowAndFrameToTransparent(WIN_MSG, FALSE);
|
||||
ClearWindowTilemap(WIN_MSG);
|
||||
if (MenuHelpers_IsLinkActive() == TRUE)
|
||||
{
|
||||
gTasks[taskId].func = Task_WaitForLinkAndReturnToChooseMon;
|
||||
@@ -2559,11 +2563,11 @@ static u8 DisplaySelectionWindow(u8 windowType)
|
||||
return sPartyMenuInternal->windowId[0];
|
||||
}
|
||||
|
||||
static void PartyMenuPrintText(const u8 *text)
|
||||
static void PrintMessage(const u8 *text)
|
||||
{
|
||||
DrawStdFrameWithCustomTileAndPalette(6, FALSE, 0x4F, 13);
|
||||
DrawStdFrameWithCustomTileAndPalette(WIN_MSG, FALSE, 0x4F, 13);
|
||||
gTextFlags.canABSpeedUpPrint = TRUE;
|
||||
AddTextPrinterParameterized2(6, FONT_NORMAL, text, GetPlayerTextSpeedDelay(), 0, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GRAY);
|
||||
AddTextPrinterParameterized2(WIN_MSG, FONT_NORMAL, text, GetPlayerTextSpeedDelay(), 0, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GRAY);
|
||||
}
|
||||
|
||||
static void PartyMenuDisplayYesNoMenu(void)
|
||||
|
||||
Reference in New Issue
Block a user