Merge branch 'master' of https://github.com/pret/pokefirered into doc-ql
This commit is contained in:
+29
-29
@@ -476,7 +476,7 @@ static void CB2_InitPartyMenu(void)
|
||||
{
|
||||
while (TRUE)
|
||||
{
|
||||
if (sub_80BF748() == TRUE || ShowPartyMenu() == TRUE || MenuHelpers_LinkSomething() == TRUE)
|
||||
if (MenuHelpers_ShouldWaitForLinkRecv() == TRUE || ShowPartyMenu() == TRUE || MenuHelpers_IsLinkActive() == TRUE)
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -509,7 +509,7 @@ static bool8 ShowPartyMenu(void)
|
||||
++gMain.state;
|
||||
break;
|
||||
case 5:
|
||||
if (!MenuHelpers_LinkSomething())
|
||||
if (!MenuHelpers_IsLinkActive())
|
||||
ResetTasks();
|
||||
++gMain.state;
|
||||
break;
|
||||
@@ -1118,7 +1118,7 @@ u8 GetPartyMenuType(void)
|
||||
|
||||
void Task_HandleChooseMonInput(u8 taskId)
|
||||
{
|
||||
if (!gPaletteFade.active && sub_80BF748() != TRUE)
|
||||
if (!gPaletteFade.active && MenuHelpers_ShouldWaitForLinkRecv() != TRUE)
|
||||
{
|
||||
s8 *slotPtr = GetCurrentPartySlotPtr();
|
||||
|
||||
@@ -1248,7 +1248,7 @@ static void HandleChooseMonCancel(u8 taskId, s8 *slotPtr)
|
||||
DisplayCancelChooseMonYesNo(taskId);
|
||||
else
|
||||
{
|
||||
if (!MenuHelpers_LinkSomething())
|
||||
if (!MenuHelpers_IsLinkActive())
|
||||
gSpecialVar_0x8004 = SLOT_CANCEL;
|
||||
gPartyMenuUseExitCallback = FALSE;
|
||||
*slotPtr = SLOT_CANCEL;
|
||||
@@ -1548,7 +1548,7 @@ bool8 IsPartyMenuTextPrinterActive(void)
|
||||
|
||||
static void Task_WaitForLinkAndReturnToChooseMon(u8 taskId)
|
||||
{
|
||||
if (sub_80BF748() != TRUE)
|
||||
if (MenuHelpers_ShouldWaitForLinkRecv() != TRUE)
|
||||
{
|
||||
DisplayPartyMenuStdMessage(PARTY_MSG_CHOOSE_MON);
|
||||
gTasks[taskId].func = Task_HandleChooseMonInput;
|
||||
@@ -1561,7 +1561,7 @@ static void Task_ReturnToChooseMonAfterText(u8 taskId)
|
||||
{
|
||||
ClearStdWindowAndFrameToTransparent(6, FALSE);
|
||||
ClearWindowTilemap(6);
|
||||
if (MenuHelpers_LinkSomething() == TRUE)
|
||||
if (MenuHelpers_IsLinkActive() == TRUE)
|
||||
{
|
||||
gTasks[taskId].func = Task_WaitForLinkAndReturnToChooseMon;
|
||||
}
|
||||
@@ -2135,7 +2135,7 @@ static void CreateCancelConfirmWindows(bool8 chooseMultiple)
|
||||
{
|
||||
confirmWindowId = AddWindow(&sConfirmButtonWindowTemplate);
|
||||
FillWindowPixelBuffer(confirmWindowId, PIXEL_FILL(0));
|
||||
AddTextPrinterParameterized4(confirmWindowId, FONT_0, (48 - GetStringWidth(FONT_0, gText_PartyMenu_OK, 0)) / 2u, 1, 0, 0, sFontColorTable[0], -1, gText_PartyMenu_OK);
|
||||
AddTextPrinterParameterized4(confirmWindowId, FONT_SMALL, (48 - GetStringWidth(FONT_SMALL, gText_PartyMenu_OK, 0)) / 2u, 1, 0, 0, sFontColorTable[0], -1, gText_PartyMenu_OK);
|
||||
PutWindowTilemap(confirmWindowId);
|
||||
CopyWindowToVram(confirmWindowId, COPYWIN_GFX);
|
||||
cancelWindowId = AddWindow(&sMultiCancelButtonWindowTemplate);
|
||||
@@ -2150,13 +2150,13 @@ static void CreateCancelConfirmWindows(bool8 chooseMultiple)
|
||||
// Branches are functionally identical. Second branch is never reached, Spin Trade wasnt fully implemented
|
||||
if (gPartyMenu.menuType != PARTY_MENU_TYPE_SPIN_TRADE)
|
||||
{
|
||||
offset += (48 - GetStringWidth(FONT_0, gFameCheckerText_Cancel, 0)) / 2;
|
||||
AddTextPrinterParameterized3(cancelWindowId, FONT_0, offset, 1, sFontColorTable[0], -1, gFameCheckerText_Cancel);
|
||||
offset += (48 - GetStringWidth(FONT_SMALL, gFameCheckerText_Cancel, 0)) / 2;
|
||||
AddTextPrinterParameterized3(cancelWindowId, FONT_SMALL, offset, 1, sFontColorTable[0], -1, gFameCheckerText_Cancel);
|
||||
}
|
||||
else
|
||||
{
|
||||
offset += (48 - GetStringWidth(FONT_0, gOtherText_Exit, 0)) / 2;
|
||||
AddTextPrinterParameterized3(cancelWindowId, FONT_0, offset, 1, sFontColorTable[0], -1, gOtherText_Exit);
|
||||
offset += (48 - GetStringWidth(FONT_SMALL, gOtherText_Exit, 0)) / 2;
|
||||
AddTextPrinterParameterized3(cancelWindowId, FONT_SMALL, offset, 1, sFontColorTable[0], -1, gOtherText_Exit);
|
||||
}
|
||||
PutWindowTilemap(cancelWindowId);
|
||||
CopyWindowToVram(cancelWindowId, COPYWIN_GFX);
|
||||
@@ -2297,7 +2297,7 @@ static void LoadPartyBoxPalette(struct PartyMenuBox *menuBox, u8 palFlags)
|
||||
|
||||
static void DisplayPartyPokemonBarDetail(u8 windowId, const u8 *str, u8 color, const u8 *dimensions)
|
||||
{
|
||||
AddTextPrinterParameterized3(windowId, FONT_0, dimensions[0], dimensions[1], sFontColorTable[color], 0, str);
|
||||
AddTextPrinterParameterized3(windowId, FONT_SMALL, dimensions[0], dimensions[1], sFontColorTable[color], 0, str);
|
||||
}
|
||||
|
||||
static void DisplayPartyPokemonNickname(struct Pokemon *mon, struct PartyMenuBox *menuBox, u8 drawMenuBoxOrText)
|
||||
@@ -2453,7 +2453,7 @@ static void DisplayPartyPokemonDescriptionText(u8 stringId, struct PartyMenuBox
|
||||
if (drawMenuBoxOrText != DRAW_TEXT_ONLY)
|
||||
menuBox->infoRects->blitFunc(menuBox->windowId, menuBox->infoRects->descTextLeft / 8, menuBox->infoRects->descTextTop / 8, menuBox->infoRects->descTextWidth / 8, menuBox->infoRects->descTextHeight / 8, TRUE);
|
||||
if (drawMenuBoxOrText != DRAW_MENU_BOX_ONLY)
|
||||
AddTextPrinterParameterized3(menuBox->windowId, FONT_1, menuBox->infoRects->descTextLeft, menuBox->infoRects->descTextTop, sFontColorTable[0], 0, sDescriptionStringTable[stringId]);
|
||||
AddTextPrinterParameterized3(menuBox->windowId, FONT_NORMAL_COPY_1, menuBox->infoRects->descTextLeft, menuBox->infoRects->descTextTop, sFontColorTable[0], 0, sDescriptionStringTable[stringId]);
|
||||
}
|
||||
|
||||
static void PartyMenuRemoveWindow(u8 *windowId)
|
||||
@@ -2505,7 +2505,7 @@ void DisplayPartyMenuStdMessage(u32 stringId)
|
||||
}
|
||||
DrawStdFrameWithCustomTileAndPalette(*windowPtr, FALSE, 0x58, 0xF);
|
||||
StringExpandPlaceholders(gStringVar4, sActionStringTable[stringId]);
|
||||
AddTextPrinterParameterized(*windowPtr, FONT_2, gStringVar4, 0, 2, 0, 0);
|
||||
AddTextPrinterParameterized(*windowPtr, FONT_NORMAL, gStringVar4, 0, 2, 0, 0);
|
||||
ScheduleBgCopyTilemapToVram(2);
|
||||
}
|
||||
}
|
||||
@@ -2554,15 +2554,15 @@ static u8 DisplaySelectionWindow(u8 windowType)
|
||||
DrawStdFrameWithCustomTileAndPalette(sPartyMenuInternal->windowId[0], FALSE, 0x4F, 13);
|
||||
if (windowType == SELECTWINDOW_MOVES)
|
||||
return sPartyMenuInternal->windowId[0];
|
||||
cursorDimension = GetMenuCursorDimensionByFont(FONT_2, 0);
|
||||
fontAttribute = GetFontAttribute(FONT_2, FONTATTR_LETTER_SPACING);
|
||||
cursorDimension = GetMenuCursorDimensionByFont(FONT_NORMAL, 0);
|
||||
fontAttribute = GetFontAttribute(FONT_NORMAL, FONTATTR_LETTER_SPACING);
|
||||
for (i = 0; i < sPartyMenuInternal->numActions; ++i)
|
||||
{
|
||||
u8 fontColorsId = (sPartyMenuInternal->actions[i] >= CURSOR_OPTION_FIELD_MOVES) ? 4 : 3;
|
||||
|
||||
AddTextPrinterParameterized4(sPartyMenuInternal->windowId[0], FONT_2, cursorDimension, (i * 16) + 2, fontAttribute, 0, sFontColorTable[fontColorsId], 0, sCursorOptions[sPartyMenuInternal->actions[i]].text);
|
||||
AddTextPrinterParameterized4(sPartyMenuInternal->windowId[0], FONT_NORMAL, cursorDimension, (i * 16) + 2, fontAttribute, 0, sFontColorTable[fontColorsId], 0, sCursorOptions[sPartyMenuInternal->actions[i]].text);
|
||||
}
|
||||
Menu_InitCursorInternal(sPartyMenuInternal->windowId[0], FONT_2, 0, 2, 16, sPartyMenuInternal->numActions, 0, 1);
|
||||
Menu_InitCursorInternal(sPartyMenuInternal->windowId[0], FONT_NORMAL, 0, 2, 16, sPartyMenuInternal->numActions, 0, 1);
|
||||
ScheduleBgCopyTilemapToVram(2);
|
||||
return sPartyMenuInternal->windowId[0];
|
||||
}
|
||||
@@ -2571,12 +2571,12 @@ static void PartyMenuPrintText(const u8 *text)
|
||||
{
|
||||
DrawStdFrameWithCustomTileAndPalette(6, FALSE, 0x4F, 13);
|
||||
gTextFlags.canABSpeedUpPrint = TRUE;
|
||||
AddTextPrinterParameterized2(6, FONT_2, text, GetTextSpeedSetting(), 0, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GRAY);
|
||||
AddTextPrinterParameterized2(6, FONT_NORMAL, text, GetTextSpeedSetting(), 0, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GRAY);
|
||||
}
|
||||
|
||||
static void PartyMenuDisplayYesNoMenu(void)
|
||||
{
|
||||
CreateYesNoMenu(&sPartyMenuYesNoWindowTemplate, FONT_2, 0, 2, 0x4F, 13, 0);
|
||||
CreateYesNoMenu(&sPartyMenuYesNoWindowTemplate, FONT_NORMAL, 0, 2, 0x4F, 13, 0);
|
||||
}
|
||||
|
||||
static u8 CreateLevelUpStatsWindow(void)
|
||||
@@ -2596,7 +2596,7 @@ static void PartyMenu_Oak_PrintText(u8 windowId, const u8 *str)
|
||||
{
|
||||
StringExpandPlaceholders(gStringVar4, str);
|
||||
gTextFlags.canABSpeedUpPrint = TRUE;
|
||||
AddTextPrinterParameterized2(windowId, FONT_4, gStringVar4, GetTextSpeedSetting(), NULL, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GRAY);
|
||||
AddTextPrinterParameterized2(windowId, FONT_MALE, gStringVar4, GetTextSpeedSetting(), NULL, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GRAY);
|
||||
}
|
||||
|
||||
static bool8 FirstBattleEnterParty_CreateWindowAndMsg1Printer(void)
|
||||
@@ -2637,8 +2637,8 @@ static void ToggleFieldMoveDescriptionWindow(u8 action)
|
||||
if (ptr->windowId[2] == WINDOW_NONE)
|
||||
ptr->windowId[2] = AddWindow(&sFieldMoveDescriptionWindowTemplate);
|
||||
DrawHelpMessageWindowTilesById(ptr->windowId[2]);
|
||||
letterSpacing = GetFontAttribute(FONT_2, FONTATTR_LETTER_SPACING);
|
||||
AddTextPrinterParameterized4(ptr->windowId[2], FONT_2, 3, 6, letterSpacing, 0, sFontColorTable[5], 0, sFieldMoveDescriptionTable[action - CURSOR_OPTION_FIELD_MOVES]);
|
||||
letterSpacing = GetFontAttribute(FONT_NORMAL, FONTATTR_LETTER_SPACING);
|
||||
AddTextPrinterParameterized4(ptr->windowId[2], FONT_NORMAL, 3, 6, letterSpacing, 0, sFontColorTable[5], 0, sFieldMoveDescriptionTable[action - CURSOR_OPTION_FIELD_MOVES]);
|
||||
PutWindowTilemap(ptr->windowId[2]);
|
||||
ScheduleBgCopyTilemapToVram(2);
|
||||
}
|
||||
@@ -3061,7 +3061,7 @@ static void Task_TryCreateSelectionWindow(u8 taskId)
|
||||
|
||||
static void Task_HandleSelectionMenuInput(u8 taskId)
|
||||
{
|
||||
if (!gPaletteFade.active && sub_80BF748() != TRUE)
|
||||
if (!gPaletteFade.active && MenuHelpers_ShouldWaitForLinkRecv() != TRUE)
|
||||
{
|
||||
s8 input;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
@@ -3851,7 +3851,7 @@ static void CursorCB_Register(u8 taskId)
|
||||
u16 species = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES);
|
||||
u8 isEventLegal = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_EVENT_LEGAL);
|
||||
|
||||
switch (CanRegisterMonForTradingBoard(*(struct GFtgtGnameSub *)GetHostRFUtgtGname(), species2, species, isEventLegal))
|
||||
switch (CanRegisterMonForTradingBoard(*(struct RfuGameCompatibilityData *)GetHostRfuGameData(), species2, species, isEventLegal))
|
||||
{
|
||||
case CANT_REGISTER_MON:
|
||||
StringExpandPlaceholders(gStringVar4, gText_PkmnCantBeTradedNow);
|
||||
@@ -3877,7 +3877,7 @@ static void CursorCB_Trade1(u8 taskId)
|
||||
u16 species2 = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES2);
|
||||
u16 species = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES);
|
||||
u8 isEventLegal = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_EVENT_LEGAL);
|
||||
u32 stringId = GetUnionRoomTradeMessageId(*(struct GFtgtGnameSub *)GetHostRFUtgtGname(), gPartnerTgtGnameSub, species2, gUnionRoomOfferedSpecies, gUnionRoomRequestedMonType, species, isEventLegal);
|
||||
u32 stringId = GetUnionRoomTradeMessageId(*(struct RfuGameCompatibilityData *)GetHostRfuGameData(), gRfuPartnerCompatibilityData, species2, gUnionRoomOfferedSpecies, gUnionRoomRequestedMonType, species, isEventLegal);
|
||||
|
||||
if (stringId != UR_TRADE_MSG_NONE)
|
||||
{
|
||||
@@ -3912,7 +3912,7 @@ static void CursorCB_FieldMove(u8 taskId)
|
||||
return;
|
||||
PartyMenuRemoveWindow(&sPartyMenuInternal->windowId[0]);
|
||||
PartyMenuRemoveWindow(&sPartyMenuInternal->windowId[1]);
|
||||
if (MenuHelpers_LinkSomething() == TRUE || InUnionRoom() == TRUE)
|
||||
if (MenuHelpers_IsLinkActive() == TRUE || InUnionRoom() == TRUE)
|
||||
{
|
||||
if (fieldMove == FIELD_MOVE_MILK_DRINK || fieldMove == FIELD_MOVE_SOFT_BOILED)
|
||||
DisplayPartyMenuStdMessage(PARTY_MSG_CANT_USE_HERE);
|
||||
@@ -4252,7 +4252,7 @@ static void CB2_ReturnToBagMenu(void)
|
||||
|
||||
static void CB2_ReturnToTMCaseMenu(void)
|
||||
{
|
||||
InitTMCase(TMCASE_NA, NULL, 0xFF);
|
||||
InitTMCase(TMCASE_REOPENING, NULL, TMCASE_KEEP_PREV);
|
||||
}
|
||||
|
||||
static void CB2_ReturnToBerryPouchMenu(void)
|
||||
@@ -4549,7 +4549,7 @@ static void ShowMoveSelectWindow(u8 slot)
|
||||
{
|
||||
u8 i;
|
||||
u8 moveCount = 0;
|
||||
u8 fontId = FONT_2;
|
||||
u8 fontId = FONT_NORMAL;
|
||||
u8 windowId = DisplaySelectionWindow(SELECTWINDOW_MOVES);
|
||||
u16 move;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user