def pbStartPokemonMenu
@scene.pbStartScene
endscene=true
pbSetViableDexes
commands=[]
cmdPokedex=-1
cmdPokemon=-1
cmdBag=-1
cmdTrainer=-1
cmdSave=-1
cmdOption=-1
cmdPokegear=-1
cmdDebug=-1
cmdQuit=-1
if !$Trainer
if $DEBUG
Kernel.pbMessage(_INTL("The player trainer was not defined, so the menu can't be displayed."))
Kernel.pbMessage(_INTL("Please see the documentation to learn how to set up the trainer player."))
end
return
end
commands[cmdPokedex=commands.length]=_INTL("Pokédex") if $Trainer.pokedex && $PokemonGlobal.pokedexViable.length>0
commands[cmdPokemon=commands.length]=_INTL("Pokémon") if $Trainer.party.length>0
commands[cmdBag=commands.length]=_INTL("Bag") if !pbInBugContest?
commands[cmdPokegear=commands.length]=_INTL("Pokégear") if $Trainer.pokegear
commands[cmdTrainer=commands.length]=$Trainer.name
if pbInSafari?
if SAFARISTEPS<=0
@scene.pbShowInfo(_INTL("Balls: {1}",pbSafariState.ballcount))
else
@scene.pbShowInfo(_INTL("Steps: {1}/{2}\nBalls: {3}",pbSafariState.steps,SAFARISTEPS,pbSafariState.ballcount))
end
commands[cmdQuit=commands.length]=_INTL("Quit")
elsif pbInBugContest?
if pbBugContestState.lastPokemon
@scene.pbShowInfo(_INTL("Caught: {1}\nLevel: {2}\nBalls: {3}",
PBSpecies.getName(pbBugContestState.lastPokemon.species),
pbBugContestState.lastPokemon.level,
pbBugContestState.ballcount))
else
@scene.pbShowInfo(_INTL("Caught: None\nBalls: {1}",pbBugContestState.ballcount))
end
commands[cmdQuit=commands.length]=_INTL("Quit")
else
commands[cmdSave=commands.length]=_INTL("Save") if !$game_system || !$game_system.save_disabled
end
commands[cmdOption=commands.length]=_INTL("Options")
cmdControls=-1
commands[cmdControls=commands.length]=_INTL("Controls")
commands[cmdDebug=commands.length]=_INTL("Debug") if $DEBUG
commands[commands.length]=_INTL("Exit")
loop do
[email protected](commands)
if cmdPokedex>=0 && command==cmdPokedex
if DEXDEPENDSONLOCATION
pbFadeOutIn(99999) {
scene=PokemonPokedexScene.new
screen=PokemonPokedex.new(scene)
screen.pbStartScreen
@scene.pbRefresh
}
else
if $PokemonGlobal.pokedexViable.length==1
$PokemonGlobal.pokedexDex=$PokemonGlobal.pokedexViable[0]
$PokemonGlobal.pokedexDex=-1 if $PokemonGlobal.pokedexDex==$PokemonGlobal.pokedexUnlocked.length-1
pbFadeOutIn(99999) {
scene=PokemonPokedexScene.new
screen=PokemonPokedex.new(scene)
screen.pbStartScreen
@scene.pbRefresh
}
else
pbLoadRpgxpScene(Scene_PokedexMenu.new)
end
end
elsif cmdPokegear>=0 && command==cmdPokegear
pbLoadRpgxpScene(Scene_Pokegear.new)
elsif cmdPokemon>=0 && command==cmdPokemon
sscene=PokemonScreen_Scene.new
sscreen=PokemonScreen.new(sscene,$Trainer.party)
hiddenmove=nil
pbFadeOutIn(99999) {
hiddenmove=sscreen.pbPokemonScreen
if hiddenmove
@scene.pbEndScene
else
@scene.pbRefresh
end
}
if hiddenmove
Kernel.pbUseHiddenMove(hiddenmove[0],hiddenmove[1])
return
end
elsif cmdBag>=0 && command==cmdBag
item=0
scene=PokemonBag_Scene.new
screen=PokemonBagScreen.new(scene,$PokemonBag)
pbFadeOutIn(99999) {
item=screen.pbStartScreen
if item>0
@scene.pbEndScene
else
@scene.pbRefresh
end
}
if item>0
Kernel.pbUseKeyItemInField(item)
return
end
elsif cmdTrainer>=0 && command==cmdTrainer
PBDebug.logonerr {
scene=PokemonTrainerCardScene.new
screen=PokemonTrainerCard.new(scene)
pbFadeOutIn(99999) {
screen.pbStartScreen
@scene.pbRefresh
}
}
elsif cmdQuit>=0 && command==cmdQuit
@scene.pbHideMenu
if pbInSafari?
if Kernel.pbConfirmMessage(_INTL("Would you like to leave the Safari Game right now?"))
@scene.pbEndScene
pbSafariState.decision=1
pbSafariState.pbGoToStart
return
else
pbShowMenu
end
else
if Kernel.pbConfirmMessage(_INTL("Would you like to end the Contest now?"))
@scene.pbEndScene
pbBugContestState.pbStartJudging
return
else
pbShowMenu
end
end
elsif cmdSave>=0 && command==cmdSave
@scene.pbHideMenu
scene=PokemonSaveScene.new
screen=PokemonSave.new(scene)
if screen.pbSaveScreen
@scene.pbEndScene
endscene=false
break
else
pbShowMenu
end
elsif cmdDebug>=0 && command==cmdDebug
pbFadeOutIn(99999) {
pbDebugMenu
@scene.pbRefresh
}
elsif cmdControls>=0 && command==cmdControls
scene=PokemonControlsScene.new
screen=PokemonControls.new(scene)
pbFadeOutIn(99999) {
screen.pbStartScreen
}
elsif cmdOption>=0 && command==cmdOption
scene=PokemonOptionScene.new
screen=PokemonOption.new(scene)
pbFadeOutIn(99999) {
screen.pbStartScreen
pbUpdateSceneMap
@scene.pbRefresh
}
else
break
end
end
@scene.pbEndScene if endscene
end