Made more use of nil_or_empty?, fixed incorrect default species body shape, fixed Illusion, fixed potential foreign Pokémon with blank names

This commit is contained in:
Maruno17
2021-05-03 17:34:19 +01:00
parent 8e6ee21c20
commit 474281712b
30 changed files with 71 additions and 73 deletions

View File

@@ -416,7 +416,7 @@ def pbTrainerTypeEditorNew(default_name)
# Choose a name
name = pbMessageFreeText(_INTL("Please enter the trainer type's name."),
(default_name) ? default_name.gsub(/_+/, " ") : "", false, 30)
if name == ""
if nil_or_empty?(name)
return nil if !default_name
name = default_name
end
@@ -585,7 +585,7 @@ def pbTrainerBattleEditor
end
next if !tr_type
tr_name = pbMessageFreeText(_INTL("Now enter the trainer's name."), "", false, 30)
next if tr_name == ""
next if nil_or_empty?(tr_name)
tr_version = pbGetFreeTrainerParty(tr_type, tr_name)
if tr_version < 0
pbMessage(_INTL("There is no room to create a trainer of that type and name."))
@@ -891,7 +891,7 @@ def pbItemEditorNew(default_name)
# Choose a name
name = pbMessageFreeText(_INTL("Please enter the item's name."),
(default_name) ? default_name.gsub(/_+/, " ") : "", false, 30)
if name == ""
if nil_or_empty?(name)
return if !default_name
name = default_name
end

View File

@@ -840,12 +840,12 @@ DebugMenuCommands.register("renameplayer", {
"description" => _INTL("Rename the player."),
"effect" => proc {
trname = pbEnterPlayerName("Your name?", 0, Settings::MAX_PLAYER_NAME_SIZE, $Trainer.name)
if trname == "" && pbConfirmMessage(_INTL("Give yourself a default name?"))
if nil_or_empty?(trname) && pbConfirmMessage(_INTL("Give yourself a default name?"))
trainertype = $Trainer.trainer_type
gender = pbGetTrainerTypeGender(trainertype)
trname = pbSuggestTrainerName(gender)
end
if trname == ""
if nil_or_empty?(trname)
pbMessage(_INTL("The player's name remained {1}.", $Trainer.name))
else
$Trainer.name = trname
@@ -865,11 +865,11 @@ DebugMenuCommands.register("randomid", {
})
#===============================================================================
# Information options
# Information editors
#===============================================================================
DebugMenuCommands.register("editorsmenu", {
"parent" => "main",
"name" => _INTL("Information options..."),
"name" => _INTL("Information editors..."),
"description" => _INTL("Edit information in the PBS files, terrain tags, battle animations, etc."),
"always_show" => true
})

View File

@@ -82,21 +82,21 @@ class SpriteWindow_DebugVariables < Window_DrawableCommand
name = $data_system.switches[index+1]
codeswitch = (name[/^s\:/])
val = (codeswitch) ? (eval($~.post_match) rescue nil) : $game_switches[index+1]
if val==nil
if val.nil?
status = "[-]"
colors = 0
codeswitch = true
elsif val
elsif val # true
status = "[ON]"
colors = 2
else
else # false
status = "[OFF]"
colors = 1
end
else
name = $data_system.variables[index+1]
status = $game_variables[index+1].to_s
status = "\"__\"" if !status || status==""
status = "\"__\"" if nil_or_empty?(status)
end
name = '' if name==nil
id_text = sprintf("%04d:",index+1)