From 1b7ec64d98dc82763eedda8f2a2de485adf32fae Mon Sep 17 00:00:00 2001 From: Joni Savolainen Date: Sun, 20 Sep 2020 21:25:39 +0300 Subject: [PATCH] Rename MAX_POKEMON_NAME_SIZE to MAX_NAME_SIZE in Pokemon --- .../012_Battle/005_Battle scene/008_Scene_Commands.rb | 2 +- Data/Scripts/016_Pokemon/001_Pokemon.rb | 2 +- Data/Scripts/016_Pokemon/004_Pokemon_ShadowPokemon.rb | 2 +- Data/Scripts/016_Pokemon/009_Pokemon_Deprecated.rb | 5 +++++ Data/Scripts/017_UI/020_PScreen_EggHatching.rb | 4 ++-- .../004_PSystem_PokemonUtilities.rb | 4 ++-- Data/Scripts/021_Debug/003_Debug_Pokemon.rb | 2 +- Data/Scripts/021_Debug/004_Editor_Screens.rb | 2 +- Data/Scripts/022_Compiler/002_Compiler_PBS.rb | 8 ++++---- 9 files changed, 18 insertions(+), 13 deletions(-) diff --git a/Data/Scripts/012_Battle/005_Battle scene/008_Scene_Commands.rb b/Data/Scripts/012_Battle/005_Battle scene/008_Scene_Commands.rb index 14ec36425..7b702cfc3 100644 --- a/Data/Scripts/012_Battle/005_Battle scene/008_Scene_Commands.rb +++ b/Data/Scripts/012_Battle/005_Battle scene/008_Scene_Commands.rb @@ -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 #============================================================================= diff --git a/Data/Scripts/016_Pokemon/001_Pokemon.rb b/Data/Scripts/016_Pokemon/001_Pokemon.rb index 73eb0b4b3..337e341a2 100644 --- a/Data/Scripts/016_Pokemon/001_Pokemon.rb +++ b/Data/Scripts/016_Pokemon/001_Pokemon.rb @@ -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 diff --git a/Data/Scripts/016_Pokemon/004_Pokemon_ShadowPokemon.rb b/Data/Scripts/016_Pokemon/004_Pokemon_ShadowPokemon.rb index 13bd3433d..fcc8146bb 100644 --- a/Data/Scripts/016_Pokemon/004_Pokemon_ShadowPokemon.rb +++ b/Data/Scripts/016_Pokemon/004_Pokemon_ShadowPokemon.rb @@ -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 diff --git a/Data/Scripts/016_Pokemon/009_Pokemon_Deprecated.rb b/Data/Scripts/016_Pokemon/009_Pokemon_Deprecated.rb index fd97aeabe..2ae486a12 100644 --- a/Data/Scripts/016_Pokemon/009_Pokemon_Deprecated.rb +++ b/Data/Scripts/016_Pokemon/009_Pokemon_Deprecated.rb @@ -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. diff --git a/Data/Scripts/017_UI/020_PScreen_EggHatching.rb b/Data/Scripts/017_UI/020_PScreen_EggHatching.rb index ebfea00d9..9cc898fbb 100644 --- a/Data/Scripts/017_UI/020_PScreen_EggHatching.rb +++ b/Data/Scripts/017_UI/020_PScreen_EggHatching.rb @@ -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 diff --git a/Data/Scripts/020_System and utilities/004_PSystem_PokemonUtilities.rb b/Data/Scripts/020_System and utilities/004_PSystem_PokemonUtilities.rb index 377bcb1ab..cfd170a71 100644 --- a/Data/Scripts/020_System and utilities/004_PSystem_PokemonUtilities.rb +++ b/Data/Scripts/020_System and utilities/004_PSystem_PokemonUtilities.rb @@ -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 diff --git a/Data/Scripts/021_Debug/003_Debug_Pokemon.rb b/Data/Scripts/021_Debug/003_Debug_Pokemon.rb index 52579bbe7..2ec78f7e0 100644 --- a/Data/Scripts/021_Debug/003_Debug_Pokemon.rb +++ b/Data/Scripts/021_Debug/003_Debug_Pokemon.rb @@ -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) diff --git a/Data/Scripts/021_Debug/004_Editor_Screens.rb b/Data/Scripts/021_Debug/004_Editor_Screens.rb index 23ef33eb8..5a87d1665 100644 --- a/Data/Scripts/021_Debug/004_Editor_Screens.rb +++ b/Data/Scripts/021_Debug/004_Editor_Screens.rb @@ -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.")], diff --git a/Data/Scripts/022_Compiler/002_Compiler_PBS.rb b/Data/Scripts/022_Compiler/002_Compiler_PBS.rb index 02f957bf3..100c20cfd 100644 --- a/Data/Scripts/022_Compiler/002_Compiler_PBS.rb +++ b/Data/Scripts/022_Compiler/002_Compiler_PBS.rb @@ -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