aboutsummaryrefslogtreecommitdiffstats
path: root/engine/menus/naming_screen.asm
diff options
context:
space:
mode:
authordannye <33dannye@gmail.com>2026-01-17 22:38:33 -0600
committerdannye <33dannye@gmail.com>2026-01-17 22:38:33 -0600
commitbc2354dd6626ce28bb9561547ed2107cfa56c18e (patch)
tree5902d4c3389253c76b7c3351e0d7dfecb551c28d /engine/menus/naming_screen.asm
parentIdentify characters in `_OakSpeechText2B` and `Printer_GetMonStats.IDNo` (#144) (diff)
parentUse macros for `WildMonEncounterSlotChances` (#562) (diff)
downloadpokeyellow-bc2354dd6626ce28bb9561547ed2107cfa56c18e.tar.gz
pokeyellow-bc2354dd6626ce28bb9561547ed2107cfa56c18e.tar.xz
pokeyellow-bc2354dd6626ce28bb9561547ed2107cfa56c18e.zip
Merge branch 'master' of https://github.com/pret/pokered
Diffstat (limited to 'engine/menus/naming_screen.asm')
-rw-r--r--engine/menus/naming_screen.asm40
1 files changed, 21 insertions, 19 deletions
diff --git a/engine/menus/naming_screen.asm b/engine/menus/naming_screen.asm
index 38da8afe..5b4b2415 100644
--- a/engine/menus/naming_screen.asm
+++ b/engine/menus/naming_screen.asm
@@ -239,11 +239,11 @@ DisplayNamingScreen:
cp NAME_MON_SCREEN
jr nc, .checkMonNameLength
ld a, [wNamingScreenNameLength]
- cp $7 ; max length of player/rival names
+ cp PLAYER_NAME_LENGTH - 1
jr .checkNameLength
.checkMonNameLength
ld a, [wNamingScreenNameLength]
- cp $a ; max length of pokemon nicknames
+ cp NAME_LENGTH - 1
.checkNameLength
jr c, .addLetter
ret
@@ -394,12 +394,13 @@ PrintNicknameAndUnderscores:
hlcoord 10, 3
ld a, [wNamingScreenType]
cp NAME_MON_SCREEN
- jr nc, .pokemon1
- ld b, 7 ; player or rival max name length
- jr .playerOrRival1
-.pokemon1
- ld b, 10 ; pokemon max name length
-.playerOrRival1
+ jr nc, .pokemon
+; player or rival
+ ld b, PLAYER_NAME_LENGTH - 1
+ jr .gotUnderscoreCount
+.pokemon
+ ld b, NAME_LENGTH - 1
+.gotUnderscoreCount
ld a, $76 ; underscore tile id
.placeUnderscoreLoop
ld [hli], a
@@ -409,13 +410,15 @@ PrintNicknameAndUnderscores:
cp NAME_MON_SCREEN
ld a, [wNamingScreenNameLength]
jr nc, .pokemon2
- cp 7 ; player or rival max name length
- jr .playerOrRival2
+; player or rival
+ cp PLAYER_NAME_LENGTH - 1
+ jr .checkEmptySpaces
.pokemon2
- cp 10 ; pokemon max name length
-.playerOrRival2
- jr nz, .emptySpacesRemaining
- ; when all spaces are filled, force the cursor onto the ED tile
+ cp NAME_LENGTH - 1
+.checkEmptySpaces
+ jr nz, .placeRaisedUnderscore ; jump if empty spaces remain
+ ; when all spaces are filled, force the cursor onto the ED tile,
+ ; and keep the last underscore raised
call EraseMenuCursor
ld a, $11 ; "ED" x coord
ld [wTopMenuItemX], a
@@ -423,11 +426,10 @@ PrintNicknameAndUnderscores:
ld [wCurrentMenuItem], a
ld a, [wNamingScreenType]
cp NAME_MON_SCREEN
- ld a, 9 ; keep the last underscore raised
- jr nc, .pokemon3
- ld a, 6 ; keep the last underscore raised
-.pokemon3
-.emptySpacesRemaining
+ ld a, NAME_LENGTH - 2
+ jr nc, .placeRaisedUnderscore
+ ld a, PLAYER_NAME_LENGTH - 2
+.placeRaisedUnderscore
ld c, a
ld b, $0
hlcoord 10, 3