diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/decoration.c | 4 | ||||
-rwxr-xr-x | src/item_menu.c | 10 | ||||
-rw-r--r-- | src/menu.c | 60 | ||||
-rwxr-xr-x | src/party_menu.c | 85 | ||||
-rw-r--r-- | src/union_room.c | 8 |
5 files changed, 85 insertions, 82 deletions
diff --git a/src/decoration.c b/src/decoration.c index 87b3d651d..74dbacdf9 100644 --- a/src/decoration.c +++ b/src/decoration.c @@ -917,9 +917,9 @@ static void DecorationItemsMenu_PrintDecorationInUse(u8 windowId, s32 itemIndex, if (itemIndex != -2) { if (IsDecorationIndexInSecretBase(itemIndex + 1) == TRUE) - blit_move_info_icon(windowId, 0x18, 0x5c, y + 2); + BlitMenuInfoIcon(windowId, MENU_INFO_ICON_BALL_RED, 92, y + 2); else if (IsDecorationIndexInPlayersRoom(itemIndex + 1) == TRUE) - blit_move_info_icon(windowId, 0x19, 0x5c, y + 2); + BlitMenuInfoIcon(windowId, MENU_INFO_ICON_BALL_BLUE, 92, y + 2); } } diff --git a/src/item_menu.c b/src/item_menu.c index 9e0a8d5a7..80035b945 100755 --- a/src/item_menu.c +++ b/src/item_menu.c @@ -2457,10 +2457,10 @@ static void RemoveMoneyWindow(void) void BagMenu_PrepareTMHMMoveWindow(void) { FillWindowPixelBuffer(3, PIXEL_FILL(0)); - blit_move_info_icon(3, 19, 0, 0); - blit_move_info_icon(3, 20, 0, 12); - blit_move_info_icon(3, 21, 0, 24); - blit_move_info_icon(3, 22, 0, 36); + BlitMenuInfoIcon(3, MENU_INFO_ICON_TYPE, 0, 0); + BlitMenuInfoIcon(3, MENU_INFO_ICON_POWER, 0, 12); + BlitMenuInfoIcon(3, MENU_INFO_ICON_ACCURACY, 0, 24); + BlitMenuInfoIcon(3, MENU_INFO_ICON_PP, 0, 36); CopyWindowToVram(3, 2); } @@ -2480,7 +2480,7 @@ void PrintTMHMMoveData(u16 itemId) else { moveId = ItemIdToBattleMoveId(itemId); - blit_move_info_icon(4, gBattleMoves[moveId].type + 1, 0, 0); + BlitMenuInfoIcon(4, gBattleMoves[moveId].type + 1, 0, 0); if (gBattleMoves[moveId].power <= 1) { text = gText_ThreeDashes; diff --git a/src/menu.c b/src/menu.c index 339106bfd..dca8adc2d 100644 --- a/src/menu.c +++ b/src/menu.c @@ -25,7 +25,7 @@ #define STD_WINDOW_PALETTE_NUM 14 #define STD_WINDOW_BASE_TILE_NUM 0x214 -struct MoveMenuInfoIcon +struct MenuInfoIcon { u8 width; u8 height; @@ -98,34 +98,34 @@ const u16 gUnknown_0860F0B0[] = INCBIN_U16("graphics/interface/860F0B0.gbapal"); const u8 sTextColors[] = { TEXT_DYNAMIC_COLOR_6, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GREY }; // Table of move info icon offsets in graphics/interface_fr/menu.png -const struct MoveMenuInfoIcon gMoveMenuInfoIcons[] = +static const struct MenuInfoIcon sMenuInfoIcons[] = { // { width, height, offset } - { 12, 12, 0x00 }, // Unused - { 32, 12, 0x20 }, // Normal icon - { 32, 12, 0x64 }, // Fight icon - { 32, 12, 0x60 }, // Flying icon - { 32, 12, 0x80 }, // Poison icon - { 32, 12, 0x48 }, // Ground icon - { 32, 12, 0x44 }, // Rock icon - { 32, 12, 0x6C }, // Bug icon - { 32, 12, 0x68 }, // Ghost icon - { 32, 12, 0x88 }, // Steel icon - { 32, 12, 0xA4 }, // ??? (Mystery) icon - { 32, 12, 0x24 }, // Fire icon - { 32, 12, 0x28 }, // Water icon - { 32, 12, 0x2C }, // Grass icon - { 32, 12, 0x40 }, // Electric icon - { 32, 12, 0x84 }, // Psychic icon - { 32, 12, 0x4C }, // Ice icon - { 32, 12, 0xA0 }, // Dragon icon - { 32, 12, 0x8C }, // Dark icon - { 42, 12, 0xA8 }, // -Type- icon - { 42, 12, 0xC0 }, // -Power- icon - { 42, 12, 0xC8 }, // -Accuracy- icon - { 42, 12, 0xE0 }, // -PP- icon - { 42, 12, 0xE8 }, // -Effect- icon - { 8, 8, 0xAE }, // Unused (Small white pokeball) - { 8, 8, 0xAF }, // Unused (Small dark pokeball) + { 12, 12, 0x00 }, // Unused + [TYPE_NORMAL + 1] = { 32, 12, 0x20 }, + [TYPE_FIGHTING + 1] = { 32, 12, 0x64 }, + [TYPE_FLYING + 1] = { 32, 12, 0x60 }, + [TYPE_POISON + 1] = { 32, 12, 0x80 }, + [TYPE_GROUND + 1] = { 32, 12, 0x48 }, + [TYPE_ROCK + 1] = { 32, 12, 0x44 }, + [TYPE_BUG + 1] = { 32, 12, 0x6C }, + [TYPE_GHOST + 1] = { 32, 12, 0x68 }, + [TYPE_STEEL + 1] = { 32, 12, 0x88 }, + [TYPE_MYSTERY + 1] = { 32, 12, 0xA4 }, + [TYPE_FIRE + 1] = { 32, 12, 0x24 }, + [TYPE_WATER + 1] = { 32, 12, 0x28 }, + [TYPE_GRASS + 1] = { 32, 12, 0x2C }, + [TYPE_ELECTRIC + 1] = { 32, 12, 0x40 }, + [TYPE_PSYCHIC + 1] = { 32, 12, 0x84 }, + [TYPE_ICE + 1] = { 32, 12, 0x4C }, + [TYPE_DRAGON + 1] = { 32, 12, 0xA0 }, + [TYPE_DARK + 1] = { 32, 12, 0x8C }, + [MENU_INFO_ICON_TYPE] = { 42, 12, 0xA8 }, + [MENU_INFO_ICON_POWER] = { 42, 12, 0xC0 }, + [MENU_INFO_ICON_ACCURACY] = { 42, 12, 0xC8 }, + [MENU_INFO_ICON_PP] = { 42, 12, 0xE0 }, + [MENU_INFO_ICON_EFFECT] = { 42, 12, 0xE8 }, // Unused + [MENU_INFO_ICON_BALL_RED] = { 8, 8, 0xAE }, // For placed decorations in Secret Base + [MENU_INFO_ICON_BALL_BLUE] = { 8, 8, 0xAF }, // For placed decorations in player's room }; @@ -2119,9 +2119,9 @@ void ListMenuLoadStdPalAt(u8 palOffset, u8 palId) LoadPalette(palette, palOffset, 0x20); } -void blit_move_info_icon(u8 windowId, u8 iconId, u16 x, u16 y) +void BlitMenuInfoIcon(u8 windowId, u8 iconId, u16 x, u16 y) { - BlitBitmapRectToWindow(windowId, gFireRedMenuElements_Gfx + gMoveMenuInfoIcons[iconId].offset * 32, 0, 0, 128, 128, x, y, gMoveMenuInfoIcons[iconId].width, gMoveMenuInfoIcons[iconId].height); + BlitBitmapRectToWindow(windowId, gFireRedMenuElements_Gfx + sMenuInfoIcons[iconId].offset * 32, 0, 0, 128, 128, x, y, sMenuInfoIcons[iconId].width, sMenuInfoIcons[iconId].height); } void BufferSaveMenuText(u8 textId, u8 *dest, u8 color) diff --git a/src/party_menu.c b/src/party_menu.c index cc69b1fcd..da0783d23 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -4325,9 +4325,13 @@ void ItemUseCB_Medicine(u8 taskId, TaskFunc task) u16 hp = 0; struct Pokemon *mon = &gPlayerParty[gPartyMenu.slotId]; u16 item = gSpecialVar_ItemId; - bool8 canHeal; + bool8 canHeal, cannotUse; - if (NotUsingHPEVItemOnShedinja(mon, item)) + if (NotUsingHPEVItemOnShedinja(mon, item) == FALSE) + { + cannotUse = TRUE; + } + else { canHeal = IsHPRecoveryItem(item); if (canHeal == TRUE) @@ -4336,50 +4340,49 @@ void ItemUseCB_Medicine(u8 taskId, TaskFunc task) if (hp == GetMonData(mon, MON_DATA_MAX_HP)) canHeal = FALSE; } - if (ExecuteTableBasedItemEffect_(gPartyMenu.slotId, item, 0)) - { - iTriedHonestlyIDid: - gPartyMenuUseExitCallback = FALSE; - PlaySE(SE_SELECT); - DisplayPartyMenuMessage(gText_WontHaveEffect, TRUE); - ScheduleBgCopyTilemapToVram(2); - gTasks[taskId].func = task; - return; - } - } - else - { - goto iTriedHonestlyIDid; //TODO: resolve this goto + cannotUse = ExecuteTableBasedItemEffect_(gPartyMenu.slotId, item, 0); } - gPartyMenuUseExitCallback = TRUE; - if (!IsItemFlute(item)) - { - PlaySE(SE_USE_ITEM); - if (gPartyMenu.action != PARTY_ACTION_REUSABLE_ITEM) - RemoveBagItem(item, 1); - } - else - { - PlaySE(SE_GLASS_FLUTE); - } - SetPartyMonAilmentGfx(mon, &sPartyMenuBoxes[gPartyMenu.slotId]); - if (gSprites[sPartyMenuBoxes[gPartyMenu.slotId].statusSpriteId].invisible) - DisplayPartyPokemonLevelCheck(mon, &sPartyMenuBoxes[gPartyMenu.slotId], 1); - if (canHeal == TRUE) + + if (cannotUse != FALSE) { - if (hp == 0) - AnimatePartySlot(gPartyMenu.slotId, 1); - PartyMenuModifyHP(taskId, gPartyMenu.slotId, 1, GetMonData(mon, MON_DATA_HP) - hp, Task_DisplayHPRestoredMessage); - ResetHPTaskData(taskId, 0, hp); - return; + gPartyMenuUseExitCallback = FALSE; + PlaySE(SE_SELECT); + DisplayPartyMenuMessage(gText_WontHaveEffect, TRUE); + ScheduleBgCopyTilemapToVram(2); + gTasks[taskId].func = task; } else { - GetMonNickname(mon, gStringVar1); - GetMedicineItemEffectMessage(item); - DisplayPartyMenuMessage(gStringVar4, TRUE); - ScheduleBgCopyTilemapToVram(2); - gTasks[taskId].func = task; + gPartyMenuUseExitCallback = TRUE; + if (!IsItemFlute(item)) + { + PlaySE(SE_USE_ITEM); + if (gPartyMenu.action != PARTY_ACTION_REUSABLE_ITEM) + RemoveBagItem(item, 1); + } + else + { + PlaySE(SE_GLASS_FLUTE); + } + SetPartyMonAilmentGfx(mon, &sPartyMenuBoxes[gPartyMenu.slotId]); + if (gSprites[sPartyMenuBoxes[gPartyMenu.slotId].statusSpriteId].invisible) + DisplayPartyPokemonLevelCheck(mon, &sPartyMenuBoxes[gPartyMenu.slotId], 1); + if (canHeal == TRUE) + { + if (hp == 0) + AnimatePartySlot(gPartyMenu.slotId, 1); + PartyMenuModifyHP(taskId, gPartyMenu.slotId, 1, GetMonData(mon, MON_DATA_HP) - hp, Task_DisplayHPRestoredMessage); + ResetHPTaskData(taskId, 0, hp); + return; + } + else + { + GetMonNickname(mon, gStringVar1); + GetMedicineItemEffectMessage(item); + DisplayPartyMenuMessage(gStringVar4, TRUE); + ScheduleBgCopyTilemapToVram(2); + gTasks[taskId].func = task; + } } } diff --git a/src/union_room.c b/src/union_room.c index 960580544..3e80ffe37 100644 --- a/src/union_room.c +++ b/src/union_room.c @@ -4076,14 +4076,14 @@ static void TradeBoardPrintItemInfo(u8 windowId, u8 y, struct GFtgtGname * gname UR_AddTextPrinterParameterized(windowId, 1, uname, 8, y, colorIdx); if (species == SPECIES_EGG) { - UR_AddTextPrinterParameterized(windowId, 1, sText_EggTrade, 0x44, y, colorIdx); + UR_AddTextPrinterParameterized(windowId, 1, sText_EggTrade, 68, y, colorIdx); } else { - blit_move_info_icon(windowId, type + 1, 0x44, y); - UR_AddTextPrinterParameterized(windowId, 1, gSpeciesNames[species], 0x76, y, colorIdx); + BlitMenuInfoIcon(windowId, type + 1, 68, y); + UR_AddTextPrinterParameterized(windowId, 1, gSpeciesNames[species], 118, y, colorIdx); ConvertIntToDecimalStringN(levelStr, level, STR_CONV_MODE_RIGHT_ALIGN, 3); - UR_AddTextPrinterParameterized(windowId, 1, levelStr, 0xC6, y, colorIdx); + UR_AddTextPrinterParameterized(windowId, 1, levelStr, 198, y, colorIdx); } } |