Define player and rival names once, to be used in two places (#545)
Some checks are pending
CI / build (push) Waiting to run

This commit is contained in:
Rangi 2025-12-01 11:00:56 -05:00 committed by GitHub
parent 3a4382c605
commit 9a6bb3ed0c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 56 additions and 60 deletions

View File

@ -0,0 +1,21 @@
DEF NUM_PLAYER_NAMES EQU 3
IF DEF(_RED)
DEF PLAYERNAME1 EQUS "RED"
DEF PLAYERNAME2 EQUS "ASH"
DEF PLAYERNAME3 EQUS "JACK"
DEF RIVALNAME1 EQUS "BLUE"
DEF RIVALNAME2 EQUS "GARY"
DEF RIVALNAME3 EQUS "JOHN"
ENDC
IF DEF(_BLUE)
DEF PLAYERNAME1 EQUS "BLUE"
DEF PLAYERNAME2 EQUS "GARY"
DEF PLAYERNAME3 EQUS "JOHN"
DEF RIVALNAME1 EQUS "RED"
DEF RIVALNAME2 EQUS "ASH"
DEF RIVALNAME3 EQUS "JACK"
ENDC

15
data/player/names.asm Normal file
View File

@ -0,0 +1,15 @@
; see constants/player_constants.asm
DefaultNamesPlayer:
db "NEW NAME"
FOR n, 1, NUM_PLAYER_NAMES + 1
next #PLAYERNAME{d:n}
ENDR
db "@"
DefaultNamesRival:
db "NEW NAME"
FOR n, 1, NUM_PLAYER_NAMES + 1
next #RIVALNAME{d:n}
ENDR
db "@"

View File

@ -0,0 +1,17 @@
; see constants/player_constants.asm
DefaultNamesPlayerList:
db "NEW NAME@"
list_start
FOR n, 1, NUM_PLAYER_NAMES + 1
li #PLAYERNAME{d:n}
ENDR
assert_list_length NUM_PLAYER_NAMES
DefaultNamesRivalList:
db "NEW NAME@"
list_start
FOR n, 1, NUM_PLAYER_NAMES + 1
li #RIVALNAME{d:n}
ENDR
assert_list_length NUM_PLAYER_NAMES

View File

@ -1,31 +0,0 @@
IF DEF(_RED)
DefaultNamesPlayer:
db "NEW NAME"
next "RED"
next "ASH"
next "JACK"
db "@"
DefaultNamesRival:
db "NEW NAME"
next "BLUE"
next "GARY"
next "JOHN"
db "@"
ENDC
IF DEF(_BLUE)
DefaultNamesPlayer:
db "NEW NAME"
next "BLUE"
next "GARY"
next "JOHN"
db "@"
DefaultNamesRival:
db "NEW NAME"
next "RED"
next "ASH"
next "JACK"
db "@"
ENDC

View File

@ -1,27 +0,0 @@
IF DEF(_RED)
DefaultNamesPlayerList:
db "NEW NAME@"
db "RED@"
db "ASH@"
db "JACK@"
DefaultNamesRivalList:
db "NEW NAME@"
db "BLUE@"
db "GARY@"
db "JOHN@"
ENDC
IF DEF(_BLUE)
DefaultNamesPlayerList:
db "NEW NAME@"
db "BLUE@"
db "GARY@"
db "JOHN@"
DefaultNamesRivalList:
db "NEW NAME@"
db "RED@"
db "ASH@"
db "JACK@"
ENDC

View File

@ -187,7 +187,7 @@ DisplayIntroNameTextBox:
.namestring
db "NAME@"
INCLUDE "data/player_names.asm"
INCLUDE "data/player/names.asm"
GetDefaultName:
; a = name index
@ -213,7 +213,7 @@ GetDefaultName:
ld bc, NAME_BUFFER_LENGTH
jp CopyData
INCLUDE "data/player_names_list.asm"
INCLUDE "data/player/names_list.asm"
LinkMenuEmptyText:
text_end

View File

@ -31,6 +31,7 @@ INCLUDE "constants/item_constants.asm"
INCLUDE "constants/pokemon_constants.asm"
INCLUDE "constants/pokedex_constants.asm"
INCLUDE "constants/pokemon_data_constants.asm"
INCLUDE "constants/player_constants.asm"
INCLUDE "constants/trainer_constants.asm"
INCLUDE "constants/icon_constants.asm"
INCLUDE "constants/sprite_constants.asm"