From bfdbbad4689332e8a6cdb04cb890c8c748d6ea62 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 8 Aug 2022 13:14:07 -0400 Subject: [PATCH] Split naming screen palettes/graphics, use correct image palettes, clean up --- graphics/naming_screen/back_button.png | Bin 0 -> 285 bytes graphics/naming_screen/buttons.pal | 19 ++++ graphics/naming_screen/cursor.pal | 19 ++++ graphics/naming_screen/cursor.png | Bin 223 -> 159 bytes graphics/naming_screen/cursor_filled.png | Bin 0 -> 166 bytes graphics/naming_screen/cursor_squished.png | Bin 0 -> 164 bytes graphics/naming_screen/input_arrow.png | Bin 95 -> 153 bytes graphics/naming_screen/menu.pal | 82 +----------------- graphics/naming_screen/ok_button.png | Bin 0 -> 271 bytes graphics/naming_screen/page_button.png | Bin 89 -> 0 bytes graphics/naming_screen/page_swap_button.png | Bin 0 -> 145 bytes graphics/naming_screen/page_swap_frame.png | Bin 0 -> 253 bytes graphics/naming_screen/page_swap_lower.pal | 19 ++++ graphics/naming_screen/page_swap_lower.png | Bin 0 -> 186 bytes graphics/naming_screen/page_swap_others.pal | 19 ++++ graphics/naming_screen/page_swap_others.png | Bin 0 -> 192 bytes graphics/naming_screen/page_swap_upper.pal | 19 ++++ graphics/naming_screen/page_swap_upper.png | Bin 0 -> 194 bytes .../{pc_icon/off.png => pc_icon_off.png} | Bin .../{pc_icon/on.png => pc_icon_on.png} | Bin .../naming_screen/{unused.pal => rival.pal} | 0 graphics/naming_screen/roptions.png | Bin 309 -> 0 bytes graphics/naming_screen/rwindow.png | Bin 480 -> 0 bytes graphics/naming_screen/underscore.png | Bin 81 -> 137 bytes graphics_file_rules.mk | 10 +++ include/graphics.h | 20 +++-- include/strings.h | 7 ++ src/graphics.c | 36 +++++--- src/naming_screen.c | 76 +++++++--------- 29 files changed, 184 insertions(+), 142 deletions(-) create mode 100644 graphics/naming_screen/back_button.png create mode 100644 graphics/naming_screen/buttons.pal create mode 100644 graphics/naming_screen/cursor.pal create mode 100644 graphics/naming_screen/cursor_filled.png create mode 100644 graphics/naming_screen/cursor_squished.png create mode 100644 graphics/naming_screen/ok_button.png delete mode 100644 graphics/naming_screen/page_button.png create mode 100644 graphics/naming_screen/page_swap_button.png create mode 100644 graphics/naming_screen/page_swap_frame.png create mode 100644 graphics/naming_screen/page_swap_lower.pal create mode 100644 graphics/naming_screen/page_swap_lower.png create mode 100644 graphics/naming_screen/page_swap_others.pal create mode 100644 graphics/naming_screen/page_swap_others.png create mode 100644 graphics/naming_screen/page_swap_upper.pal create mode 100644 graphics/naming_screen/page_swap_upper.png rename graphics/naming_screen/{pc_icon/off.png => pc_icon_off.png} (100%) rename graphics/naming_screen/{pc_icon/on.png => pc_icon_on.png} (100%) rename graphics/naming_screen/{unused.pal => rival.pal} (100%) delete mode 100644 graphics/naming_screen/roptions.png delete mode 100644 graphics/naming_screen/rwindow.png diff --git a/graphics/naming_screen/back_button.png b/graphics/naming_screen/back_button.png new file mode 100644 index 0000000000000000000000000000000000000000..bf7730024d425d2cd9b71a9239051358ae181602 GIT binary patch literal 285 zcmV+&0pk9NP)y`&)K-dZ_1IXO8wCMx8h0001} zNklIL)E>irR>x;3W31mEqpxxV9c$P zF{ioHmErT-=sy1#K5V0p!uJ^wUup~pmkc9VhiX6w1tM&A4Ge6du_{*{!G%~Stvx1( zJ-IwUJ6-nV4YA&H_@m+9I|)pQT}j|V(@LI*te)gEq?Hlhl011|l9RwiARUql)1LHF j%y8?Or!RWS^ueBgGsFRSDzM!Y00000NkvXXu0mjfzfyUX literal 0 HcmV?d00001 diff --git a/graphics/naming_screen/buttons.pal b/graphics/naming_screen/buttons.pal new file mode 100644 index 0000000000..fdf80bdb06 --- /dev/null +++ b/graphics/naming_screen/buttons.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +106 156 213 +255 255 255 +57 57 57 +139 139 131 +197 189 180 +230 222 213 +74 115 139 +123 172 197 +172 115 74 +213 156 115 +98 156 57 +148 189 106 +189 164 32 +230 222 90 +57 57 57 +57 57 57 diff --git a/graphics/naming_screen/cursor.pal b/graphics/naming_screen/cursor.pal new file mode 100644 index 0000000000..8950f9b34b --- /dev/null +++ b/graphics/naming_screen/cursor.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +106 156 213 +255 8 8 +222 57 74 +180 65 82 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +230 222 213 +0 0 0 +230 222 213 +0 0 0 diff --git a/graphics/naming_screen/cursor.png b/graphics/naming_screen/cursor.png index 3d92ef6f49717486d8ff0f648413d930d1809810..e0f5022bede18df5971a850950cb4cfc6923da65 100644 GIT binary patch delta 84 zcmcc5IG=HXIF|$qGXnzyV_$;(L`8dhEl(H65RRG22?+u$Ol%4XEQTx%JOT$fgqXO6 n6B3w`N)E1Vh~_G1D`jA)_hedm(f{dBpl$|FS3j3^P6fr)*opj}jT$(m2MHL62iGw)E2AQ&A_+s+!g5*Xt z;A_N8MX?*7mMY`xotunV>TXQ`0qJ_fNms5|@B9Gk>K0KLTC80F0000%6DBM$6c9*|Xl68O kmWVCTelYFOTt`_32FV(p`8#g9t_0cO>FVdQ&MBb@0K$ML1^@s6 literal 0 HcmV?d00001 diff --git a/graphics/naming_screen/cursor_squished.png b/graphics/naming_screen/cursor_squished.png new file mode 100644 index 0000000000000000000000000000000000000000..5126fcccaebd6dca631ef6d85ed28ded7c2207b0 GIT binary patch literal 164 zcmeAS@N?(olHy`uVBq!ia0vp^0zfRm!VDxC`x5MdltF+`h-=oItN%GT?pb(Rvq2Ww} i_d(IaTMzRtv1DNQ#=y>o|%Dx!Ax=S4j^R^;1lASHRtO8|Nkv5EsKkbfnqT5pMe32lIB=euL+v6 zH|yxLIalB9-9EMB5m1qer;B3<$IRq}prnL^grFb>L9YZSMi&VN&QyWx4ULUAXEZW0 Y=v-%tIs41E1!SnFtDnm{rv%0(02W{_E&u=k delta 76 zcmbQq7(YSMjR6Q$rtpLTDK$?Q#}JO0$v>*U|F3V`U;e(iV|T(MyABI}m3Iw0p8q%g dWBK{NJwu?lY}@`lD(^r#Jzf1=);T3K0RTW89!dZJ diff --git a/graphics/naming_screen/menu.pal b/graphics/naming_screen/menu.pal index 0da3b93f2f..2f5c86a568 100644 --- a/graphics/naming_screen/menu.pal +++ b/graphics/naming_screen/menu.pal @@ -1,6 +1,6 @@ JASC-PAL 0100 -96 +16 106 156 213 255 255 255 115 115 115 @@ -17,83 +17,3 @@ JASC-PAL 230 222 90 238 230 139 246 238 197 -106 156 213 -255 255 255 -57 57 57 -115 115 115 -0 0 0 -0 0 0 -0 0 0 -0 0 255 -0 0 255 -0 0 255 -0 0 255 -74 115 139 -98 139 164 -123 172 197 -156 205 230 -180 222 246 -106 156 213 -255 255 255 -57 57 57 -115 115 115 -0 0 0 -0 0 0 -0 0 0 -0 0 255 -0 0 255 -0 0 255 -0 0 255 -172 115 74 -189 131 90 -213 156 115 -246 205 164 -255 230 197 -106 156 213 -255 255 255 -57 57 57 -115 115 115 -0 0 0 -0 0 0 -0 0 0 -0 0 255 -0 0 255 -0 0 255 -0 0 255 -98 156 57 -123 172 82 -148 189 106 -197 230 156 -213 238 189 -106 156 213 -255 255 255 -57 57 57 -139 139 131 -197 189 180 -230 222 213 -74 115 139 -123 172 197 -172 115 74 -213 156 115 -98 156 57 -148 189 106 -189 164 32 -230 222 90 -57 57 57 -57 57 57 -106 156 213 -255 8 8 -222 57 74 -180 65 82 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -230 222 213 -0 0 0 -230 222 213 -0 0 0 diff --git a/graphics/naming_screen/ok_button.png b/graphics/naming_screen/ok_button.png new file mode 100644 index 0000000000000000000000000000000000000000..3850f462a43691a0ab2332fe6946633b9d037184 GIT binary patch literal 271 zcmV+q0r38bP)y`&)K-dZ_1IXO8wCMx8h0001* zNkl2ZGpQVO0fjv*3LlYjK{YAkH{&%?a% mh47{sc5L$*XZw{n*t#?oR4nQoZKroU_li-23K!Yg-9Wk&LH{V~E7m|PX54G^elJy`(M+u`Zr7@{%p>?B*h z1_d6sk8DMZ)vUsEV^hBWTU=-^wEKGheikM_y?ty_a=fi9OZOG}i%wXU)Dm;P>1ND? zZas@VcYg12H)n|~``4Otck|Ch&u(ka5n=cCky&z;V_VdOn?X~W63n?1`-4>-lX6;E zTaDMQ|2kD|^%uoko~L%X`@FihWBHXm^^^E*9w%M(K6i-WBhXC@p00i_>zopr04XMD AJOBUy literal 0 HcmV?d00001 diff --git a/graphics/naming_screen/page_swap_lower.pal b/graphics/naming_screen/page_swap_lower.pal new file mode 100644 index 0000000000..0fac7e3752 --- /dev/null +++ b/graphics/naming_screen/page_swap_lower.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +106 156 213 +255 255 255 +57 57 57 +115 115 115 +0 0 0 +0 0 0 +0 0 0 +0 0 255 +0 0 255 +0 0 255 +0 0 255 +172 115 74 +189 131 90 +213 156 115 +246 205 164 +255 230 197 diff --git a/graphics/naming_screen/page_swap_lower.png b/graphics/naming_screen/page_swap_lower.png new file mode 100644 index 0000000000000000000000000000000000000000..5747c6265d651fb00fbb1255c26f9cb74534770d GIT binary patch literal 186 zcmeAS@N?(olHy`uVBq!ia0vp^8bHj!!VDxUYZhbxDT4r?5ZA0ZSO5S2Z)s`S-Q9e2 z@0Mrxu6h-BSFbs`rr7K1oZ_T8mQ(g-?Omeq>|PX54G^elJy`(M>+0#^7{W2L^o$|j z0RtYVi!leKuctO&oLzg{%z5^bp#MKwBwp4@``b&fP4K8vY?bVkeJ&taQZIN)R&@;jK4Q&CI8fCQUV&t;OXk;vd$@?2>>FIMUMag literal 0 HcmV?d00001 diff --git a/graphics/naming_screen/page_swap_others.pal b/graphics/naming_screen/page_swap_others.pal new file mode 100644 index 0000000000..0bb9d4f719 --- /dev/null +++ b/graphics/naming_screen/page_swap_others.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +106 156 213 +255 255 255 +57 57 57 +115 115 115 +0 0 0 +0 0 0 +0 0 0 +0 0 255 +0 0 255 +0 0 255 +0 0 255 +98 156 57 +123 172 82 +148 189 106 +197 230 156 +213 238 189 diff --git a/graphics/naming_screen/page_swap_others.png b/graphics/naming_screen/page_swap_others.png new file mode 100644 index 0000000000000000000000000000000000000000..1c878a7532b7b805c317817e8b730199d6a0144b GIT binary patch literal 192 zcmeAS@N?(olHy`uVBq!ia0vp^8bHj!!VDxUYZhbxDT4r?5ZA0ZSO5S2Z)s`S-Q9e2 z@0Mrxu6h-BSFbs`rr7K1oZ_T8mQ(g-?Omeq>|PX54G^elJy`(M>+R{{7{W0#wcC*E zfC0~uPps>I{ayR~WcHt(YE#TEoch7m=%)W-_QwmcKPS7c(e`>Y)uV0e17&Yc!A+l( p3!mETys*w$QholsZ~wl`j=vnLpT!|PX54G^elJy`(M>+9*_7{W0#wbzjE zfB_HFXIA|^>vasOJNL(zXH3!HQJBlZqjI>hr|;wHg$zNm)+Tn|_YEoz1uS^IF!^$T q)lVId3$3rdzs<y`&)K-dZ_1IXO8wCMx8h0002M zNklpcCPt2~@m$aSv zhmedhi&;YI7@}zj!Hn208i0_tJDRwR7$NEt;c|0LF|Au#V;u0%(DBWHwLGvA=&Dpj z=tL69L^_Fb$0~&gK(dq@Qm$q1bs=eOkOIBF=RN1POFru#hv0W9$`YiI00000NkvXX Hu0mjfSs;q> diff --git a/graphics/naming_screen/rwindow.png b/graphics/naming_screen/rwindow.png deleted file mode 100644 index 9571abb805b971600754b099f256070b9d06bf33..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 480 zcmV<60U!Q}P)y`&)K-dZ_1IXO8wCMx8h0004N zNkl?Z9m zUwmhu>#M8F^z|?ZP!GBTeEHbuQGWtHsg2$&Fe8(G&IE>zR9doPF<9YVQ=s z#Ot%&Mo)PnL)Ygi&PbfQP`F8_!fwh8Xu=`wnNarxQ-Rn>5EG|IM2qu~ph+<7oEh@! zr1Uai8?!_=xh>J?zICuJ`wpU-D9{MA@pq>*<`7-V^TKLs zvsTjZ0u?E`e@<7UVuOSOfS|y5zB&WLhm*vpd@|%QsXF7%* W7Sj2R!hq8N0000N7STHTc24sk*tDnm{ Hr-UW|AS@@} delta 62 zcmeBV44fco!2kp*Q+UFFl!T{?V+hC03T-G@yGywoW5fqdF diff --git a/graphics_file_rules.mk b/graphics_file_rules.mk index 9e5c191930..42b1e6d74a 100644 --- a/graphics_file_rules.mk +++ b/graphics_file_rules.mk @@ -20,6 +20,7 @@ MISCGFXDIR := graphics/misc JPCONTESTGFXDIR := graphics/contest/japanese POKEDEXGFXDIR := graphics/pokedex STARTERGFXDIR := graphics/starter_choose +NAMINGGFXDIR := graphics/naming_screen types := normal fight flying poison ground rock bug ghost steel mystery fire water grass electric psychic ice dragon dark contest_types := cool beauty cute smart tough @@ -710,3 +711,12 @@ $(POKEDEXGFXDIR)/region_map_affine.8bpp: %.8bpp: %.png $(STARTERGFXDIR)/birch_help.4bpp: $(STARTERGFXDIR)/birch_bag.4bpp $(STARTERGFXDIR)/birch_grass.4bpp @cat $^ >$@ + +$(NAMINGGFXDIR)/cursor.4bpp: %.4bpp: %.png + $(GFX) $< $@ -num_tiles 5 + +$(NAMINGGFXDIR)/cursor_squished.4bpp: %.4bpp: %.png + $(GFX) $< $@ -num_tiles 5 + +$(NAMINGGFXDIR)/cursor_filled.4bpp: %.4bpp: %.png + $(GFX) $< $@ -num_tiles 5 diff --git a/include/graphics.h b/include/graphics.h index 0972743c5f..08a2a1c421 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -4063,18 +4063,24 @@ extern const u16 gBattleInterface_BallStatusBarPal[]; extern const u16 gBattleInterface_BallDisplayPal[]; extern const u8 gHealthboxElementsGfxTable[][32]; -extern const u16 gNamingScreenMenu_Pal[]; +extern const u16 gNamingScreenMenu_Pal[6][16]; extern const u32 gNamingScreenMenu_Gfx[]; extern const u32 gNamingScreenBackground_Tilemap[]; extern const u8 gNamingScreenKeyboardUpper_Tilemap[]; extern const u8 gNamingScreenKeyboardLower_Tilemap[]; extern const u8 gNamingScreenKeyboardSymbols_Tilemap[]; -extern const u8 gNamingScreenRWindow_Gfx[]; -extern const u8 gNamingScreenPageButton_Gfx[]; -extern const u8 gNamingScreenROptions_Gfx[]; -extern const u8 gNamingScreenCursor_Gfx[]; -extern const u8 gNamingScreenInputArrow_Gfx[]; -extern const u8 gNamingScreenUnderscore_Gfx[]; +extern const u32 gNamingScreenPageSwapFrame_Gfx[]; +extern const u32 gNamingScreenBackButton_Gfx[]; +extern const u32 gNamingScreenOKButton_Gfx[]; +extern const u32 gNamingScreenPageSwapButton_Gfx[]; +extern const u32 gNamingScreenPageSwapUpper_Gfx[]; +extern const u32 gNamingScreenPageSwapLower_Gfx[]; +extern const u32 gNamingScreenPageSwapOthers_Gfx[]; +extern const u32 gNamingScreenCursor_Gfx[]; +extern const u32 gNamingScreenCursorSquished_Gfx[]; +extern const u32 gNamingScreenCursorFilled_Gfx[]; +extern const u32 gNamingScreenInputArrow_Gfx[]; +extern const u32 gNamingScreenUnderscore_Gfx[]; extern const u32 gPokeblockFeedBg_Tilemap[]; diff --git a/include/strings.h b/include/strings.h index a22aa307bb..26bdb2153f 100644 --- a/include/strings.h +++ b/include/strings.h @@ -3021,4 +3021,11 @@ extern const u8 gText_PkmnForSwap[]; extern const u8 gText_SamePkmnInPartyAlready[]; extern const u8 gText_Cancel3[]; +// Naming Screen +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[]; + #endif // GUARD_STRINGS_H diff --git a/src/graphics.c b/src/graphics.c index 9f708f18b4..eb798433df 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -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 diff --git a/src/naming_screen.c b/src/naming_screen.c index 6139280303..3dbc0aaac0 100644 --- a/src/naming_screen.c +++ b/src/naming_screen.c @@ -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}, {} };