Merge pull request #1730 from GriffinRichards/sync-naming-screen
Clean up naming screen graphics
This commit is contained in:
@@ -1400,17 +1400,31 @@ const u32 gStorageSystemPartyMenu_Tilemap[] = INCBIN_U32("graphics/pokemon_stora
|
||||
|
||||
// naming screen
|
||||
|
||||
const u16 gNamingScreenMenu_Pal[] = INCBIN_U16("graphics/naming_screen/menu.gbapal");
|
||||
const u32 gNamingScreenMenu_Gfx[] = INCBIN_U32("graphics/naming_screen/menu.4bpp.lz");
|
||||
const u8 gNamingScreenRWindow_Gfx[] = INCBIN_U8("graphics/naming_screen/rwindow.4bpp");
|
||||
const u8 gNamingScreenROptions_Gfx[] = INCBIN_U8("graphics/naming_screen/roptions.4bpp");
|
||||
const u8 gNamingScreenCursor_Gfx[] = INCBIN_U8("graphics/naming_screen/cursor.4bpp");
|
||||
const u8 gNamingScreenPageButton_Gfx[] = INCBIN_U8("graphics/naming_screen/page_button.4bpp");
|
||||
const u8 gNamingScreenInputArrow_Gfx[] = INCBIN_U8("graphics/naming_screen/input_arrow.4bpp");
|
||||
const u8 gNamingScreenUnderscore_Gfx[] = INCBIN_U8("graphics/naming_screen/underscore.4bpp");
|
||||
const u32 gNamingScreenBackground_Tilemap[] = INCBIN_U32("graphics/naming_screen/background.bin.lz");
|
||||
const u32 gNamingScreenKeyboardUpper_Tilemap[] = INCBIN_U32("graphics/naming_screen/keyboard_upper.bin.lz");
|
||||
const u32 gNamingScreenKeyboardLower_Tilemap[] = INCBIN_U32("graphics/naming_screen/keyboard_lower.bin.lz");
|
||||
const u16 gNamingScreenMenu_Pal[6][16] =
|
||||
{
|
||||
INCBIN_U16("graphics/naming_screen/menu.gbapal"),
|
||||
INCBIN_U16("graphics/naming_screen/page_swap_upper.gbapal"),
|
||||
INCBIN_U16("graphics/naming_screen/page_swap_lower.gbapal"),
|
||||
INCBIN_U16("graphics/naming_screen/page_swap_others.gbapal"),
|
||||
INCBIN_U16("graphics/naming_screen/buttons.gbapal"),
|
||||
INCBIN_U16("graphics/naming_screen/cursor.gbapal"),
|
||||
};
|
||||
const u32 gNamingScreenMenu_Gfx[] = INCBIN_U32("graphics/naming_screen/menu.4bpp.lz");
|
||||
const u32 gNamingScreenPageSwapFrame_Gfx[] = INCBIN_U32("graphics/naming_screen/page_swap_frame.4bpp");
|
||||
const u32 gNamingScreenBackButton_Gfx[] = INCBIN_U32("graphics/naming_screen/back_button.4bpp");
|
||||
const u32 gNamingScreenOKButton_Gfx[] = INCBIN_U32("graphics/naming_screen/ok_button.4bpp");
|
||||
const u32 gNamingScreenPageSwapUpper_Gfx[] = INCBIN_U32("graphics/naming_screen/page_swap_upper.4bpp");
|
||||
const u32 gNamingScreenPageSwapLower_Gfx[] = INCBIN_U32("graphics/naming_screen/page_swap_lower.4bpp");
|
||||
const u32 gNamingScreenPageSwapOthers_Gfx[] = INCBIN_U32("graphics/naming_screen/page_swap_others.4bpp");
|
||||
const u32 gNamingScreenCursor_Gfx[] = INCBIN_U32("graphics/naming_screen/cursor.4bpp");
|
||||
const u32 gNamingScreenCursorSquished_Gfx[] = INCBIN_U32("graphics/naming_screen/cursor_squished.4bpp");
|
||||
const u32 gNamingScreenCursorFilled_Gfx[] = INCBIN_U32("graphics/naming_screen/cursor_filled.4bpp");
|
||||
const u32 gNamingScreenPageSwapButton_Gfx[] = INCBIN_U32("graphics/naming_screen/page_swap_button.4bpp");
|
||||
const u32 gNamingScreenInputArrow_Gfx[] = INCBIN_U32("graphics/naming_screen/input_arrow.4bpp");
|
||||
const u32 gNamingScreenUnderscore_Gfx[] = INCBIN_U32("graphics/naming_screen/underscore.4bpp");
|
||||
const u32 gNamingScreenBackground_Tilemap[] = INCBIN_U32("graphics/naming_screen/background.bin.lz");
|
||||
const u32 gNamingScreenKeyboardUpper_Tilemap[] = INCBIN_U32("graphics/naming_screen/keyboard_upper.bin.lz");
|
||||
const u32 gNamingScreenKeyboardLower_Tilemap[] = INCBIN_U32("graphics/naming_screen/keyboard_lower.bin.lz");
|
||||
const u32 gNamingScreenKeyboardSymbols_Tilemap[] = INCBIN_U32("graphics/naming_screen/keyboard_symbols.bin.lz");
|
||||
|
||||
// union room chat
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "text_window.h"
|
||||
#include "overworld.h"
|
||||
#include "walda_phrase.h"
|
||||
#include "main.h"
|
||||
#include "constants/event_objects.h"
|
||||
#include "constants/rgb.h"
|
||||
|
||||
@@ -61,10 +62,10 @@ enum {
|
||||
};
|
||||
|
||||
enum {
|
||||
PALTAG_PC_ICON,
|
||||
PALTAG_MENU, // Also the PC icon
|
||||
PALTAG_PAGE_SWAP_UPPER,
|
||||
PALTAG_PAGE_SWAP_LOWER,
|
||||
PALTAG_PAGE_SWAP_OTHERS,
|
||||
PALTAG_PAGE_SWAP_OTHERS, // Also the input arrow/underscore
|
||||
PALTAG_PAGE_SWAP,
|
||||
PALTAG_CURSOR,
|
||||
PALTAG_BACK_BUTTON,
|
||||
@@ -180,21 +181,11 @@ struct NamingScreenData
|
||||
};
|
||||
|
||||
EWRAM_DATA static struct NamingScreenData *sNamingScreen = NULL;
|
||||
extern u16 gKeyRepeatStartDelay;
|
||||
|
||||
// extern text
|
||||
extern const u8 gText_MoveOkBack[];
|
||||
extern const u8 gText_YourName[];
|
||||
extern const u8 gText_BoxName[];
|
||||
extern const u8 gText_PkmnsNickname[];
|
||||
extern const u8 gText_TellHimTheWords[];
|
||||
|
||||
|
||||
// start of .rodata
|
||||
static const u8 sPCIconOff_Gfx[] = INCBIN_U8("graphics/naming_screen/pc_icon/off.4bpp");
|
||||
static const u8 sPCIconOn_Gfx[] = INCBIN_U8("graphics/naming_screen/pc_icon/on.4bpp");
|
||||
static const u8 sPCIconOff_Gfx[] = INCBIN_U8("graphics/naming_screen/pc_icon_off.4bpp");
|
||||
static const u8 sPCIconOn_Gfx[] = INCBIN_U8("graphics/naming_screen/pc_icon_on.4bpp");
|
||||
static const u16 sKeyboard_Pal[] = INCBIN_U16("graphics/naming_screen/keyboard.gbapal");
|
||||
static const u16 sUnused_Pal[] = INCBIN_U16("graphics/naming_screen/unused.gbapal");
|
||||
static const u16 sRival_Pal[] = INCBIN_U16("graphics/naming_screen/rival.gbapal"); // Unused, leftover from FRLG rival
|
||||
|
||||
static const u8 *const sTransferredToPCMessages[] =
|
||||
{
|
||||
@@ -312,13 +303,12 @@ static const u8 sPageColumnCounts[KBPAGE_COUNT] = {
|
||||
[KEYBOARD_LETTERS_UPPER] = KBCOL_COUNT,
|
||||
[KEYBOARD_SYMBOLS] = 6
|
||||
};
|
||||
static const u8 sPageColumnXPos[KBPAGE_COUNT * KBCOL_COUNT] = {
|
||||
0, 12, 24, 56, 68, 80, 92, 123, // KEYBOARD_LETTERS_LOWER
|
||||
0, 12, 24, 56, 68, 80, 92, 123, // KEYBOARD_LETTERS_UPPER
|
||||
0, 22, 44, 66, 88, 110 // KEYBOARD_SYMBOLS
|
||||
static const u8 sPageColumnXPos[KBPAGE_COUNT][KBCOL_COUNT] = {
|
||||
[KEYBOARD_LETTERS_LOWER] = {0, 12, 24, 56, 68, 80, 92, 123},
|
||||
[KEYBOARD_LETTERS_UPPER] = {0, 12, 24, 56, 68, 80, 92, 123},
|
||||
[KEYBOARD_SYMBOLS] = {0, 22, 44, 66, 88, 110}
|
||||
};
|
||||
|
||||
// forward declarations
|
||||
static const struct NamingScreenTemplate *const sNamingScreenTemplates[];
|
||||
static const struct SubspriteTable sSubspriteTable_PageSwapFrame[];
|
||||
static const struct SubspriteTable sSubspriteTable_PageSwapText[];
|
||||
@@ -1142,7 +1132,7 @@ static void SetCursorPos(s16 x, s16 y)
|
||||
struct Sprite *cursorSprite = &gSprites[sNamingScreen->cursorSpriteId];
|
||||
|
||||
if (x < sPageColumnCounts[CurrentPageToKeyboardId()])
|
||||
cursorSprite->x = sPageColumnXPos[x + CurrentPageToKeyboardId() * KBCOL_COUNT] + 38;
|
||||
cursorSprite->x = sPageColumnXPos[CurrentPageToKeyboardId()][x] + 38;
|
||||
else
|
||||
cursorSprite->x = 0;
|
||||
|
||||
@@ -1890,7 +1880,7 @@ static void CreateHelperTasks(void)
|
||||
|
||||
static void LoadPalettes(void)
|
||||
{
|
||||
LoadPalette(gNamingScreenMenu_Pal, 0, 0xC0);
|
||||
LoadPalette(gNamingScreenMenu_Pal, 0, sizeof(gNamingScreenMenu_Pal));
|
||||
LoadPalette(sKeyboard_Pal, 0xA0, sizeof(sKeyboard_Pal));
|
||||
LoadPalette(GetTextWindowPalette(2), 0xB0, 0x20);
|
||||
}
|
||||
@@ -2512,7 +2502,7 @@ static const struct SpriteTemplate sSpriteTemplate_Underscore =
|
||||
static const struct SpriteTemplate sSpriteTemplate_PCIcon =
|
||||
{
|
||||
.tileTag = TAG_NONE,
|
||||
.paletteTag = PALTAG_PC_ICON,
|
||||
.paletteTag = PALTAG_MENU,
|
||||
.oam = &sOam_8x8,
|
||||
.anims = sAnims_PCIcon,
|
||||
.images = sImageTable_PCIcon,
|
||||
@@ -2547,31 +2537,31 @@ static const u8 *const sNamingScreenKeyboardText[KBPAGE_COUNT][KBROW_COUNT] =
|
||||
|
||||
static const struct SpriteSheet sSpriteSheets[] =
|
||||
{
|
||||
{gNamingScreenRWindow_Gfx + 0x280, 0x1E0, GFXTAG_BACK_BUTTON},
|
||||
{gNamingScreenRWindow_Gfx + 0x460, 0x1E0, GFXTAG_OK_BUTTON},
|
||||
{gNamingScreenRWindow_Gfx, 0x280, GFXTAG_PAGE_SWAP_FRAME},
|
||||
{gNamingScreenPageButton_Gfx + 0x20, 0x100, GFXTAG_PAGE_SWAP_BUTTON},
|
||||
{gNamingScreenROptions_Gfx, 0x060, GFXTAG_PAGE_SWAP_UPPER},
|
||||
{gNamingScreenROptions_Gfx + 0xA0, 0x060, GFXTAG_PAGE_SWAP_LOWER},
|
||||
{gNamingScreenROptions_Gfx + 0x140, 0x060, GFXTAG_PAGE_SWAP_OTHERS},
|
||||
{gNamingScreenCursor_Gfx, 0x080, GFXTAG_CURSOR},
|
||||
{gNamingScreenCursor_Gfx + 0xA0, 0x080, GFXTAG_CURSOR_SQUISHED},
|
||||
{gNamingScreenCursor_Gfx + 0x140, 0x080, GFXTAG_CURSOR_FILLED},
|
||||
{gNamingScreenInputArrow_Gfx, 0x020, GFXTAG_INPUT_ARROW},
|
||||
{gNamingScreenUnderscore_Gfx, 0x020, GFXTAG_UNDERSCORE},
|
||||
{gNamingScreenBackButton_Gfx, 0x1E0, GFXTAG_BACK_BUTTON},
|
||||
{gNamingScreenOKButton_Gfx, 0x1E0, GFXTAG_OK_BUTTON},
|
||||
{gNamingScreenPageSwapFrame_Gfx, 0x280, GFXTAG_PAGE_SWAP_FRAME},
|
||||
{gNamingScreenPageSwapButton_Gfx, 0x100, GFXTAG_PAGE_SWAP_BUTTON},
|
||||
{gNamingScreenPageSwapUpper_Gfx, 0x060, GFXTAG_PAGE_SWAP_UPPER},
|
||||
{gNamingScreenPageSwapLower_Gfx, 0x060, GFXTAG_PAGE_SWAP_LOWER},
|
||||
{gNamingScreenPageSwapOthers_Gfx, 0x060, GFXTAG_PAGE_SWAP_OTHERS},
|
||||
{gNamingScreenCursor_Gfx, 0x080, GFXTAG_CURSOR},
|
||||
{gNamingScreenCursorSquished_Gfx, 0x080, GFXTAG_CURSOR_SQUISHED},
|
||||
{gNamingScreenCursorFilled_Gfx, 0x080, GFXTAG_CURSOR_FILLED},
|
||||
{gNamingScreenInputArrow_Gfx, 0x020, GFXTAG_INPUT_ARROW},
|
||||
{gNamingScreenUnderscore_Gfx, 0x020, GFXTAG_UNDERSCORE},
|
||||
{}
|
||||
};
|
||||
|
||||
static const struct SpritePalette sSpritePalettes[] =
|
||||
{
|
||||
{gNamingScreenMenu_Pal, PALTAG_PC_ICON},
|
||||
{gNamingScreenMenu_Pal + 0x10, PALTAG_PAGE_SWAP_UPPER},
|
||||
{gNamingScreenMenu_Pal + 0x20, PALTAG_PAGE_SWAP_LOWER},
|
||||
{gNamingScreenMenu_Pal + 0x30, PALTAG_PAGE_SWAP_OTHERS},
|
||||
{gNamingScreenMenu_Pal + 0x40, PALTAG_PAGE_SWAP},
|
||||
{gNamingScreenMenu_Pal + 0x50, PALTAG_CURSOR},
|
||||
{gNamingScreenMenu_Pal + 0x40, PALTAG_BACK_BUTTON},
|
||||
{gNamingScreenMenu_Pal + 0x40, PALTAG_OK_BUTTON},
|
||||
{gNamingScreenMenu_Pal[0], PALTAG_MENU},
|
||||
{gNamingScreenMenu_Pal[1], PALTAG_PAGE_SWAP_UPPER},
|
||||
{gNamingScreenMenu_Pal[2], PALTAG_PAGE_SWAP_LOWER},
|
||||
{gNamingScreenMenu_Pal[3], PALTAG_PAGE_SWAP_OTHERS},
|
||||
{gNamingScreenMenu_Pal[4], PALTAG_PAGE_SWAP},
|
||||
{gNamingScreenMenu_Pal[5], PALTAG_CURSOR},
|
||||
{gNamingScreenMenu_Pal[4], PALTAG_BACK_BUTTON},
|
||||
{gNamingScreenMenu_Pal[4], PALTAG_OK_BUTTON},
|
||||
{}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user