mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Rename MAX_POKEMON_NAME_SIZE to MAX_NAME_SIZE
in Pokemon
This commit is contained in:
@@ -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
|
||||
|
||||
#=============================================================================
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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.")],
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user