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

@@ -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)