Colorize menu icon graphics, document sMenuInfoIcons

This commit is contained in:
GriffinR
2023-06-01 14:33:32 -04:00
parent f52d3b6ce4
commit 86c21b8e79
11 changed files with 67 additions and 60 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

+3 -3
View File
@@ -2745,9 +2745,9 @@ extern const u32 gTrainerPalette_RuinManiac[];
extern const u32 gTrainerPalette_Lady[]; extern const u32 gTrainerPalette_Lady[];
extern const u32 gTrainerPalette_Painter[]; extern const u32 gTrainerPalette_Painter[];
extern const u8 gFireRedMenuElements_Gfx[]; extern const u8 gMenuInfoElements_Gfx[];
extern const u16 gFireRedMenuElements1_Pal[]; extern const u16 gMenuInfoElements1_Pal[];
extern const u16 gFireRedMenuElements2_Pal[]; extern const u16 gMenuInfoElements2_Pal[];
extern const u32 gItemIcon_QuestionMark[]; extern const u32 gItemIcon_QuestionMark[];
extern const u32 gItemIconPalette_QuestionMark[]; extern const u32 gItemIconPalette_QuestionMark[];
+8 -1
View File
@@ -8,6 +8,13 @@
#define MENU_NOTHING_CHOSEN -2 #define MENU_NOTHING_CHOSEN -2
#define MENU_B_PRESSED -1 #define MENU_B_PRESSED -1
#define MENU_INFO_ICON_CAUGHT 0
#define MENU_INFO_ICON_TYPE (NUMBER_OF_MON_TYPES + 1)
#define MENU_INFO_ICON_POWER (NUMBER_OF_MON_TYPES + 2)
#define MENU_INFO_ICON_ACCURACY (NUMBER_OF_MON_TYPES + 3)
#define MENU_INFO_ICON_PP (NUMBER_OF_MON_TYPES + 4)
#define MENU_INFO_ICON_EFFECT (NUMBER_OF_MON_TYPES + 5)
struct MenuAction struct MenuAction
{ {
const u8 *text; const u8 *text;
@@ -31,7 +38,7 @@ s8 Menu2_GetMonSpriteAnchorCoordMinusx20(u16 species, u32 personality, u8 a2);
void ListMenu_LoadMonIconPalette(u8 palOffset, u16 speciesId); void ListMenu_LoadMonIconPalette(u8 palOffset, u16 speciesId);
void ListMenu_DrawMonIconGraphics(u8 windowId, u16 speciesId, u32 personality, u16 x, u16 y); void ListMenu_DrawMonIconGraphics(u8 windowId, u16 speciesId, u32 personality, u16 x, u16 y);
void ListMenuLoadStdPalAt(u8 palOffset, u8 palId); void ListMenuLoadStdPalAt(u8 palOffset, u8 palId);
void BlitMoveInfoIcon(u8 windowId, u8 iconId, u16 x, u16 y); void BlitMenuInfoIcon(u8 windowId, u8 iconId, u16 x, u16 y);
// menu // menu
s8 Menu_ProcessInputGridLayout(void); s8 Menu_ProcessInputGridLayout(void);
+3 -3
View File
@@ -1137,9 +1137,9 @@ const u32 gGhostFrontPic[] = INCBIN_U32("graphics/pokemon/ghost/front.4bpp.lz");
#include "data/graphics/mail.h" #include "data/graphics/mail.h"
const u16 gFireRedMenuElements1_Pal[] = INCBIN_U16("graphics/interface/dex_caught_pokeball.gbapal"); const u16 gMenuInfoElements1_Pal[] = INCBIN_U16("graphics/interface/dex_caught_pokeball.gbapal");
const u16 gFireRedMenuElements2_Pal[] = INCBIN_U16("graphics/interface/pokemon_types.gbapal"); const u16 gMenuInfoElements2_Pal[] = INCBIN_U16("graphics/interface/pokemon_types.gbapal");
const u8 gFireRedMenuElements_Gfx[] = INCBIN_U8("graphics/interface/dex_caught_pokeball_and_pokemon_types.4bpp"); const u8 gMenuInfoElements_Gfx[] = INCBIN_U8("graphics/interface/menu_info.4bpp");
const u16 gMoveRelearner_Pal[] = INCBIN_U16("graphics/interface/learn_move.gbapal"); const u16 gMoveRelearner_Pal[] = INCBIN_U16("graphics/interface/learn_move.gbapal");
const u32 gMoveRelearner_Gfx[] = INCBIN_U32("graphics/interface/learn_move.4bpp.lz"); const u32 gMoveRelearner_Gfx[] = INCBIN_U32("graphics/interface/learn_move.4bpp.lz");
+6 -6
View File
@@ -816,7 +816,7 @@ static void MoveLearnerInitListMenu(void)
static void PrintMoveInfo(u16 move) static void PrintMoveInfo(u16 move)
{ {
u8 buffer[50]; u8 buffer[50];
BlitMoveInfoIcon(2, gBattleMoves[move].type + 1, 1, 4); BlitMenuInfoIcon(2, gBattleMoves[move].type + 1, 1, 4);
if (gBattleMoves[move].power < 2) if (gBattleMoves[move].power < 2)
{ {
@@ -844,11 +844,11 @@ static void PrintMoveInfo(u16 move)
static void LoadMoveInfoUI(void) static void LoadMoveInfoUI(void)
{ {
BlitMoveInfoIcon(0, 19, 1, 4); BlitMenuInfoIcon(0, MENU_INFO_ICON_TYPE, 1, 4);
BlitMoveInfoIcon(1, 20, 0, 4); BlitMenuInfoIcon(1, MENU_INFO_ICON_POWER, 0, 4);
BlitMoveInfoIcon(1, 21, 0, 19); BlitMenuInfoIcon(1, MENU_INFO_ICON_ACCURACY, 0, 19);
BlitMoveInfoIcon(0, 22, 1, 19); BlitMenuInfoIcon(0, MENU_INFO_ICON_PP, 1, 19);
BlitMoveInfoIcon(0, 23, 1, 34); BlitMenuInfoIcon(0, MENU_INFO_ICON_EFFECT, 1, 34);
PutWindowTilemap(0); PutWindowTilemap(0);
PutWindowTilemap(1); PutWindowTilemap(1);
PutWindowTilemap(4); PutWindowTilemap(4);
+30 -30
View File
@@ -49,32 +49,32 @@ static void ListMenuDrawCursor(struct ListMenu *list);
static void ListMenuCallSelectionChangedCallback(struct ListMenu *list, u8 onInit); static void ListMenuCallSelectionChangedCallback(struct ListMenu *list, u8 onInit);
static u8 ListMenuAddCursorObject(struct ListMenu *list, u32 cursorKind); static u8 ListMenuAddCursorObject(struct ListMenu *list, u32 cursorKind);
const struct MoveMenuInfoIcon gMoveMenuInfoIcons[] = static const struct MoveMenuInfoIcon sMenuInfoIcons[] =
{ { // { width, height, offset }
{ 12, 12, 0x00 }, // Unused [MENU_INFO_ICON_CAUGHT] = { 12, 12, 0x00 },
{ 32, 12, 0x20 }, // Normal icon [TYPE_NORMAL + 1] = { 32, 12, 0x20 },
{ 32, 12, 0x64 }, // Fight icon [TYPE_FIGHTING + 1] = { 32, 12, 0x64 },
{ 32, 12, 0x60 }, // Flying icon [TYPE_FLYING + 1] = { 32, 12, 0x60 },
{ 32, 12, 0x80 }, // Poison icon [TYPE_POISON + 1] = { 32, 12, 0x80 },
{ 32, 12, 0x48 }, // Ground icon [TYPE_GROUND + 1] = { 32, 12, 0x48 },
{ 32, 12, 0x44 }, // Rock icon [TYPE_ROCK + 1] = { 32, 12, 0x44 },
{ 32, 12, 0x6C }, // Bug icon [TYPE_BUG + 1] = { 32, 12, 0x6C },
{ 32, 12, 0x68 }, // Ghost icon [TYPE_GHOST + 1] = { 32, 12, 0x68 },
{ 32, 12, 0x88 }, // Steel icon [TYPE_STEEL + 1] = { 32, 12, 0x88 },
{ 32, 12, 0xA4 }, // ??? (Mystery) icon [TYPE_MYSTERY + 1] = { 32, 12, 0xA4 },
{ 32, 12, 0x24 }, // Fire icon [TYPE_FIRE + 1] = { 32, 12, 0x24 },
{ 32, 12, 0x28 }, // Water icon [TYPE_WATER + 1] = { 32, 12, 0x28 },
{ 32, 12, 0x2C }, // Grass icon [TYPE_GRASS + 1] = { 32, 12, 0x2C },
{ 32, 12, 0x40 }, // Electric icon [TYPE_ELECTRIC + 1] = { 32, 12, 0x40 },
{ 32, 12, 0x84 }, // Psychic icon [TYPE_PSYCHIC + 1] = { 32, 12, 0x84 },
{ 32, 12, 0x4C }, // Ice icon [TYPE_ICE + 1] = { 32, 12, 0x4C },
{ 32, 12, 0xA0 }, // Dragon icon [TYPE_DRAGON + 1] = { 32, 12, 0xA0 },
{ 32, 12, 0x8C }, // Dark icon [TYPE_DARK + 1] = { 32, 12, 0x8C },
{ 40, 12, 0xA8 }, // -Type- icon [MENU_INFO_ICON_TYPE] = { 40, 12, 0xA8 },
{ 40, 12, 0xC0 }, // -Power- icon [MENU_INFO_ICON_POWER] = { 40, 12, 0xC0 },
{ 40, 12, 0xC8 }, // -Accuracy- icon [MENU_INFO_ICON_ACCURACY] = { 40, 12, 0xC8 },
{ 40, 12, 0xE0 }, // -PP- icon [MENU_INFO_ICON_PP] = { 40, 12, 0xE0 },
{ 40, 12, 0xE8 }, // -Effect- icon [MENU_INFO_ICON_EFFECT] = { 40, 12, 0xE8 },
}; };
static void ListMenuDummyTask(u8 taskId) static void ListMenuDummyTask(u8 taskId)
@@ -743,16 +743,16 @@ void ListMenuLoadStdPalAt(u8 palOffset, u8 palId)
{ {
case 0: case 0:
default: default:
palette = gFireRedMenuElements1_Pal; palette = gMenuInfoElements1_Pal;
break; break;
case 1: case 1:
palette = gFireRedMenuElements2_Pal; palette = gMenuInfoElements2_Pal;
break; break;
} }
LoadPalette(palette, palOffset, PLTT_SIZE_4BPP); LoadPalette(palette, palOffset, PLTT_SIZE_4BPP);
} }
void BlitMoveInfoIcon(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, &gMenuInfoElements_Gfx[sMenuInfoIcons[iconId].offset * TILE_SIZE_4BPP], 0, 0, 128, 128, x, y, sMenuInfoIcons[iconId].width, sMenuInfoIcons[iconId].height);
} }
+5 -5
View File
@@ -1554,11 +1554,11 @@ static void ItemPrintFunc_OrderedListMenu(u8 windowId, u32 itemId, u8 y)
DexScreen_PrintMonDexNo(sPokedexScreenData->numericalOrderWindowId, FONT_SMALL, species, 12, y); DexScreen_PrintMonDexNo(sPokedexScreenData->numericalOrderWindowId, FONT_SMALL, species, 12, y);
if (caught) if (caught)
{ {
BlitMoveInfoIcon(sPokedexScreenData->numericalOrderWindowId, 0, 0x28, y); BlitMenuInfoIcon(sPokedexScreenData->numericalOrderWindowId, MENU_INFO_ICON_CAUGHT, 0x28, y);
type1 = gSpeciesInfo[species].types[0]; type1 = gSpeciesInfo[species].types[0];
BlitMoveInfoIcon(sPokedexScreenData->numericalOrderWindowId, type1 + 1, 0x78, y); BlitMenuInfoIcon(sPokedexScreenData->numericalOrderWindowId, type1 + 1, 0x78, y);
if (type1 != gSpeciesInfo[species].types[1]) if (type1 != gSpeciesInfo[species].types[1])
BlitMoveInfoIcon(sPokedexScreenData->numericalOrderWindowId, gSpeciesInfo[species].types[1] + 1, 0x98, y); BlitMenuInfoIcon(sPokedexScreenData->numericalOrderWindowId, gSpeciesInfo[species].types[1] + 1, 0x98, y);
} }
} }
@@ -3091,9 +3091,9 @@ u8 DexScreen_DrawMonAreaPage(void)
if (monIsCaught) if (monIsCaught)
{ {
BlitMoveInfoIcon(sPokedexScreenData->windowIds[12], 1 + gSpeciesInfo[species].types[0], 0, 1); BlitMenuInfoIcon(sPokedexScreenData->windowIds[12], 1 + gSpeciesInfo[species].types[0], 0, 1);
if (gSpeciesInfo[species].types[0] != gSpeciesInfo[species].types[1]) if (gSpeciesInfo[species].types[0] != gSpeciesInfo[species].types[1])
BlitMoveInfoIcon(sPokedexScreenData->windowIds[12], 1 + gSpeciesInfo[species].types[1], 32, 1); BlitMenuInfoIcon(sPokedexScreenData->windowIds[12], 1 + gSpeciesInfo[species].types[1], 32, 1);
} }
PutWindowTilemap(sPokedexScreenData->windowIds[12]); PutWindowTilemap(sPokedexScreenData->windowIds[12]);
CopyWindowToVram(sPokedexScreenData->windowIds[12], COPYWIN_GFX); CopyWindowToVram(sPokedexScreenData->windowIds[12], COPYWIN_GFX);
+6 -6
View File
@@ -2919,11 +2919,11 @@ static void PokeSum_DrawMoveTypeIcons(void)
if (sMonSummaryScreen->moveIds[i] == MOVE_NONE) if (sMonSummaryScreen->moveIds[i] == MOVE_NONE)
continue; continue;
BlitMoveInfoIcon(sMonSummaryScreen->windowIds[5], sMonSummaryScreen->moveTypes[i] + 1, 3, GetMoveNamePrinterYpos(i)); BlitMenuInfoIcon(sMonSummaryScreen->windowIds[5], sMonSummaryScreen->moveTypes[i] + 1, 3, GetMoveNamePrinterYpos(i));
} }
if (sMonSummaryScreen->mode == PSS_MODE_SELECT_MOVE) if (sMonSummaryScreen->mode == PSS_MODE_SELECT_MOVE)
BlitMoveInfoIcon(sMonSummaryScreen->windowIds[5], sMonSummaryScreen->moveTypes[4] + 1, 3, GetMoveNamePrinterYpos(4)); BlitMenuInfoIcon(sMonSummaryScreen->windowIds[5], sMonSummaryScreen->moveTypes[4] + 1, 3, GetMoveNamePrinterYpos(4));
} }
static void PokeSum_PrintPageHeaderText(u8 curPageIndex) static void PokeSum_PrintPageHeaderText(u8 curPageIndex)
@@ -3362,10 +3362,10 @@ static void PokeSum_PrintMonTypeIcons(void)
case PSS_PAGE_INFO: case PSS_PAGE_INFO:
if (!sMonSummaryScreen->isEgg) if (!sMonSummaryScreen->isEgg)
{ {
BlitMoveInfoIcon(sMonSummaryScreen->windowIds[POKESUM_WIN_RIGHT_PANE], sMonSummaryScreen->monTypes[0] + 1, 47, 35); BlitMenuInfoIcon(sMonSummaryScreen->windowIds[POKESUM_WIN_RIGHT_PANE], sMonSummaryScreen->monTypes[0] + 1, 47, 35);
if (sMonSummaryScreen->monTypes[0] != sMonSummaryScreen->monTypes[1]) if (sMonSummaryScreen->monTypes[0] != sMonSummaryScreen->monTypes[1])
BlitMoveInfoIcon(sMonSummaryScreen->windowIds[POKESUM_WIN_RIGHT_PANE], sMonSummaryScreen->monTypes[1] + 1, 83, 35); BlitMenuInfoIcon(sMonSummaryScreen->windowIds[POKESUM_WIN_RIGHT_PANE], sMonSummaryScreen->monTypes[1] + 1, 83, 35);
} }
break; break;
case PSS_PAGE_SKILLS: case PSS_PAGE_SKILLS:
@@ -3374,10 +3374,10 @@ static void PokeSum_PrintMonTypeIcons(void)
break; break;
case PSS_PAGE_MOVES_INFO: case PSS_PAGE_MOVES_INFO:
FillWindowPixelBuffer(sMonSummaryScreen->windowIds[6], 0); FillWindowPixelBuffer(sMonSummaryScreen->windowIds[6], 0);
BlitMoveInfoIcon(sMonSummaryScreen->windowIds[6], sMonSummaryScreen->monTypes[0] + 1, 0, 3); BlitMenuInfoIcon(sMonSummaryScreen->windowIds[6], sMonSummaryScreen->monTypes[0] + 1, 0, 3);
if (sMonSummaryScreen->monTypes[0] != sMonSummaryScreen->monTypes[1]) if (sMonSummaryScreen->monTypes[0] != sMonSummaryScreen->monTypes[1])
BlitMoveInfoIcon(sMonSummaryScreen->windowIds[6], sMonSummaryScreen->monTypes[1] + 1, 36, 3); BlitMenuInfoIcon(sMonSummaryScreen->windowIds[6], sMonSummaryScreen->monTypes[1] + 1, 36, 3);
PutWindowTilemap(sMonSummaryScreen->windowIds[6]); PutWindowTilemap(sMonSummaryScreen->windowIds[6]);
break; break;
+5 -5
View File
@@ -1529,10 +1529,10 @@ static void PrintTitle(void)
static void DrawMoveInfoLabels(void) static void DrawMoveInfoLabels(void)
{ {
BlitMoveInfoIcon(WIN_MOVE_INFO_LABELS, 19, 0, 0); BlitMenuInfoIcon(WIN_MOVE_INFO_LABELS, MENU_INFO_ICON_TYPE, 0, 0);
BlitMoveInfoIcon(WIN_MOVE_INFO_LABELS, 20, 0, 12); BlitMenuInfoIcon(WIN_MOVE_INFO_LABELS, MENU_INFO_ICON_POWER, 0, 12);
BlitMoveInfoIcon(WIN_MOVE_INFO_LABELS, 21, 0, 24); BlitMenuInfoIcon(WIN_MOVE_INFO_LABELS, MENU_INFO_ICON_ACCURACY, 0, 24);
BlitMoveInfoIcon(WIN_MOVE_INFO_LABELS, 22, 0, 36); BlitMenuInfoIcon(WIN_MOVE_INFO_LABELS, MENU_INFO_ICON_PP, 0, 36);
CopyWindowToVram(WIN_MOVE_INFO_LABELS, COPYWIN_GFX); CopyWindowToVram(WIN_MOVE_INFO_LABELS, COPYWIN_GFX);
} }
@@ -1553,7 +1553,7 @@ static void PrintMoveInfo(u16 itemId)
{ {
// Draw type icon // Draw type icon
move = ItemIdToBattleMoveId(itemId); move = ItemIdToBattleMoveId(itemId);
BlitMoveInfoIcon(WIN_MOVE_INFO, gBattleMoves[move].type + 1, 0, 0); BlitMenuInfoIcon(WIN_MOVE_INFO, gBattleMoves[move].type + 1, 0, 0);
// Print power // Print power
if (gBattleMoves[move].power < 2) if (gBattleMoves[move].power < 2)
+1 -1
View File
@@ -3934,7 +3934,7 @@ static void TradeBoardPrintItemInfo(u8 windowId, u8 y, struct RfuGameData * data
} }
else else
{ {
BlitMoveInfoIcon(windowId, type + 1, 68, y); BlitMenuInfoIcon(windowId, type + 1, 68, y);
PrintUnionRoomText(windowId, FONT_NORMAL, gSpeciesNames[species], 118, y, colorIdx); PrintUnionRoomText(windowId, FONT_NORMAL, gSpeciesNames[species], 118, y, colorIdx);
ConvertIntToDecimalStringN(levelStr, level, STR_CONV_MODE_LEFT_ALIGN, 3); ConvertIntToDecimalStringN(levelStr, level, STR_CONV_MODE_LEFT_ALIGN, 3);
PrintUnionRoomText(windowId, FONT_NORMAL, levelStr, GetStringRightAlignXOffset(2, levelStr, 218), y, colorIdx); PrintUnionRoomText(windowId, FONT_NORMAL, levelStr, GetStringRightAlignXOffset(2, levelStr, 218), y, colorIdx);