Rename MAX_POKEMON_NAME_SIZE to MAX_NAME_SIZE

in Pokemon
This commit is contained in:
Joni Savolainen
2020-09-20 21:25:39 +03:00
parent 61ad59afa6
commit 1b7ec64d98
9 changed files with 18 additions and 13 deletions

View File

@@ -450,7 +450,7 @@ class PokeBattle_Scene
# Opens the nicknaming screen for a newly caught Pokémon
#=============================================================================
def pbNameEntry(helpText,pkmn)
return pbEnterPokemonName(helpText, 0, Pokemon::MAX_POKEMON_NAME_SIZE, "", pkmn)
return pbEnterPokemonName(helpText, 0, Pokemon::MAX_NAME_SIZE, "", pkmn)
end
#=============================================================================

View File

@@ -115,7 +115,7 @@ class Pokemon
# Max EVs that a single stat can have
EV_STAT_LIMIT = 252
# Maximum length a Pokémon's nickname can be
MAX_POKEMON_NAME_SIZE = 10
MAX_NAME_SIZE = 10
#=============================================================================
# Ownership, obtained information

View File

@@ -54,7 +54,7 @@ def pbPurify(pokemon,scene)
speciesname = PBSpecies.getName(pokemon.species)
if scene.pbConfirm(_INTL("Would you like to give a nickname to {1}?",speciesname))
newname = pbEnterPokemonName(_INTL("{1}'s nickname?",speciesname),
0, Pokemon::MAX_POKEMON_NAME_SIZE, "", pokemon)
0, Pokemon::MAX_NAME_SIZE, "", pokemon)
pokemon.name = newname if newname!=""
end
end

View File

@@ -8,6 +8,11 @@ class PokeBattle_Pokemon; end
PokeBattle_Pokemon = Pokemon
class Pokemon
# @deprecated Use {MAX_NAME_SIZE} instead. This alias is slated to be removed in vXX.
MAX_POKEMON_NAME_SIZE = MAX_NAME_SIZE
end
# (see Pokemon#initialize)
# @deprecated Use +Pokemon.new+ instead. This method and its aliases are
# slated to be removed in vXX.

View File

@@ -109,7 +109,7 @@ class PokemonEggHatch_Scene
if pbConfirmMessage(
_INTL("Would you like to nickname the newly hatched {1}?",@pokemon.name)) { update }
nickname=pbEnterPokemonName(_INTL("{1}'s nickname?",@pokemon.name),
0, Pokemon::MAX_POKEMON_NAME_SIZE, "", @pokemon, true)
0, Pokemon::MAX_NAME_SIZE, "", @pokemon, true)
@pokemon.name=nickname if nickname!=""
@nicknamed=true
end
@@ -209,7 +209,7 @@ def pbHatch(pokemon)
pbMessage(_INTL("{1} hatched from the Egg!",speciesname))
if pbConfirmMessage(_INTL("Would you like to nickname the newly hatched {1}?",speciesname))
nickname = pbEnterPokemonName(_INTL("{1}'s nickname?",speciesname),
0, Pokemon::MAX_POKEMON_NAME_SIZE, "", pokemon)
0, Pokemon::MAX_NAME_SIZE, "", pokemon)
pokemon.name = nickname if nickname!=""
end
end

View File

@@ -9,7 +9,7 @@ def pbNickname(pokemon)
speciesname = PBSpecies.getName(pokemon.species)
if pbConfirmMessage(_INTL("Would you like to give a nickname to {1}?",speciesname))
helptext = _INTL("{1}'s nickname?",speciesname)
newname = pbEnterPokemonName(helptext, 0, Pokemon::MAX_POKEMON_NAME_SIZE, "", pokemon)
newname = pbEnterPokemonName(helptext, 0, Pokemon::MAX_NAME_SIZE, "", pokemon)
pokemon.name = newname if newname!=""
end
end
@@ -146,7 +146,7 @@ def pbAddForeignPokemon(pokemon,level=nil,ownerName=nil,nickname=nil,ownerGender
pokemon.otgender = ownerGender
end
# Set nickname
pokemon.name = nickname[0, Pokemon::MAX_POKEMON_NAME_SIZE] if nickname && nickname!=""
pokemon.name = nickname[0, Pokemon::MAX_NAME_SIZE] if nickname && nickname!=""
# Recalculate stats
pokemon.calcStats
if ownerName

View File

@@ -601,7 +601,7 @@ module PokemonDebugMixin
when 0 # Rename
oldname = (pkmn.name && pkmn.name!=speciesname) ? pkmn.name : ""
newname = pbEnterPokemonName(_INTL("{1}'s nickname?",speciesname),
0, Pokemon::MAX_POKEMON_NAME_SIZE, oldname, pkmn)
0, Pokemon::MAX_NAME_SIZE, oldname, pkmn)
if newname && newname!=""
pkmn.name = newname
pbRefreshSingle(pkmnid)

View File

@@ -741,7 +741,7 @@ def pbPokemonEditor
metrics = pbLoadSpeciesMetrics
selection = 0
species = [
[_INTL("Name"), LimitStringProperty.new(Pokemon::MAX_POKEMON_NAME_SIZE), _INTL("Name of the Pokémon.")],
[_INTL("Name"), LimitStringProperty.new(Pokemon::MAX_NAME_SIZE), _INTL("Name of the Pokémon.")],
[_INTL("InternalName"),ReadOnlyProperty,_INTL("Internal name of the Pokémon.")],
[_INTL("Type1"),TypeProperty,_INTL("Pokémon's type. If same as Type2, this Pokémon has a single type.")],
[_INTL("Type2"),TypeProperty,_INTL("Pokémon's type. If same as Type1, this Pokémon has a single type.")],

View File

@@ -1465,8 +1465,8 @@ def pbCompileTrainers
raise _INTL("Bad happiness: {1} (must be 0-255)\r\n{2}",record,FileLineData.linereport)
end
when "Name"
if record.length>Pokemon::MAX_POKEMON_NAME_SIZE
raise _INTL("Bad nickname: {1} (must be 1-{2} characters)\r\n{3}", record, Pokemon::MAX_POKEMON_NAME_SIZE, FileLineData.linereport)
if record.length>Pokemon::MAX_NAME_SIZE
raise _INTL("Bad nickname: {1} (must be 1-{2} characters)\r\n{3}", record, Pokemon::MAX_NAME_SIZE, FileLineData.linereport)
end
end
# Record XXX=YYY setting
@@ -1555,8 +1555,8 @@ def pbCompileTrainers
raise _INTL("Bad happiness: {1} (must be 0-255)\r\n{2}",record[i],FileLineData.linereport)
end
when TPNAME+3
if record[i].length>Pokemon::MAX_POKEMON_NAME_SIZE
raise _INTL("Bad nickname: {1} (must be 1-{2} characters)\r\n{3}", record[i], Pokemon::MAX_POKEMON_NAME_SIZE, FileLineData.linereport)
if record[i].length>Pokemon::MAX_NAME_SIZE
raise _INTL("Bad nickname: {1} (must be 1-{2} characters)\r\n{3}", record[i], Pokemon::MAX_NAME_SIZE, FileLineData.linereport)
end
end
end