Naming screen constants

This commit is contained in:
Rangi
2018-09-16 16:02:58 -04:00
parent 60b09f291d
commit 38bf21ae35
10 changed files with 23 additions and 10 deletions

View File

@@ -93,3 +93,15 @@ HMENURETURN_ASM EQU %11111111
const PARTYMENUTEXT_REVIVE const PARTYMENUTEXT_REVIVE
const PARTYMENUTEXT_LEVEL_UP const PARTYMENUTEXT_LEVEL_UP
const PARTYMENUTEXT_HEAL_CONFUSION const PARTYMENUTEXT_HEAL_CONFUSION
; Naming types (see engine/menus/naming_screen.asm)
const_def
const NAME_MON
const NAME_PLAYER
const NAME_RIVAL
const NAME_MOM
const NAME_BOX
const NAME_FRIEND
const NAME_6 ; duplicate of NAME_MON
const NAME_7 ; duplicate of NAME_MON
NUM_NAME_TYPES EQU const_value

View File

@@ -32,7 +32,7 @@ _NameRater:
ld [wNamedObjectIndexBuffer], a ld [wNamedObjectIndexBuffer], a
ld [wCurSpecies], a ld [wCurSpecies], a
call GetBaseData call GetBaseData
ld b, 0 ld b, NAME_MON
ld de, wStringBuffer2 ld de, wStringBuffer2
farcall _NamingScreen farcall _NamingScreen
; If the new name is empty, treat it as unchanged. ; If the new name is empty, treat it as unchanged.

View File

@@ -84,7 +84,7 @@ FoundNone:
ret ret
NameRival: NameRival:
ld b, $2 ; rival ld b, NAME_RIVAL
ld de, wRivalName ld de, wRivalName
farcall _NamingScreen farcall _NamingScreen
; default to "SILVER" ; default to "SILVER"

View File

@@ -584,7 +584,7 @@ PokeBallEffect:
push de push de
xor a ; PARTYMON xor a ; PARTYMON
ld [wMonType], a ld [wMonType], a
ld b, 0 ld b, NAME_MON
farcall NamingScreen farcall NamingScreen
call RotateThreePalettesRight call RotateThreePalettesRight
@@ -637,7 +637,7 @@ PokeBallEffect:
ld a, BOXMON ld a, BOXMON
ld [wMonType], a ld [wMonType], a
ld de, wMonOrItemNameBuffer ld de, wMonOrItemNameBuffer
ld b, $0 ld b, NAME_MON
farcall NamingScreen farcall NamingScreen
ld a, BANK(sBoxMonNicknames) ld a, BANK(sBoxMonNicknames)

View File

@@ -747,7 +747,7 @@ NamePlayer:
ret ret
.NewName: .NewName:
ld b, 1 ld b, NAME_PLAYER
ld de, wPlayerName ld de, wPlayerName
farcall NamingScreen farcall NamingScreen

View File

@@ -61,7 +61,7 @@ NamingScreen:
.GetNamingScreenSetup: .GetNamingScreenSetup:
ld a, [wNamingScreenType] ld a, [wNamingScreenType]
and 7 maskbits NUM_NAME_TYPES
ld e, a ld e, a
ld d, 0 ld d, 0
ld hl, .Jumptable ld hl, .Jumptable
@@ -73,6 +73,7 @@ NamingScreen:
jp hl jp hl
.Jumptable: .Jumptable:
; entries correspond to NAME_* constants
dw .Pokemon dw .Pokemon
dw .Player dw .Player
dw .Rival dw .Rival

View File

@@ -2454,7 +2454,7 @@ BillsPC_ChangeBoxSubmenu:
ret ret
.Name: .Name:
ld b, $4 ; box ld b, NAME_BOX
ld de, wd002 ld de, wd002
farcall NamingScreen farcall NamingScreen
call ClearTileMap call ClearTileMap

View File

@@ -330,7 +330,7 @@ HatchEggs:
xor a xor a
ld [wMonType], a ld [wMonType], a
push de push de
ld b, $0 ld b, NAME_MON
farcall NamingScreen farcall NamingScreen
pop hl pop hl
ld de, wStringBuffer1 ld de, wStringBuffer1

View File

@@ -1809,7 +1809,7 @@ InitNickname:
call DisableSpriteUpdates call DisableSpriteUpdates
pop de pop de
push de push de
ld b, $0 ld b, NAME_MON
farcall NamingScreen farcall NamingScreen
pop hl pop hl
ld de, wStringBuffer1 ld de, wStringBuffer1

View File

@@ -3487,7 +3487,7 @@ Function8a765:
Function8a78c: Function8a78c:
call Function891fe call Function891fe
ld de, wd002 ld de, wd002
ld b, $5 ld b, NAME_FRIEND
farcall NamingScreen farcall NamingScreen
call OpenSRAMBank4 call OpenSRAMBank4
call Function8931b call Function8931b