class PokemonStorageScreen
alias nickname_pbStartScreen pbStartScreen
def pbStartScreen(command)
@heldpkmn = nil
### MOVE #######################################################################
if command == 0
@scene.pbStartBox(self,command)
loop do
selected = @scene.pbSelectBox(@storage.party)
if selected == nil
if pbHeldPokemon
pbDisplay(_INTL("You're holding a Pok?mon!"))
next
end
next if pbConfirm(_INTL("Continue Box operations?"))
break
elsif selected[0] == -3 # Close box
if pbHeldPokemon
pbDisplay(_INTL("You're holding a Pok?mon!"))
next
end
break if pbConfirm(_INTL("Exit from the Box?"))
next
elsif selected[0] == -4 # Box name
pbBoxCommands
else
pokemon = @storage[selected[0],selected[1]]
heldpoke = pbHeldPokemon
next if !pokemon && !heldpoke
if @scene.quickswap
if @heldpkmn
(pokemon) ? pbSwap(selected) : pbPlace(selected)
else
pbHold(selected)
end
else
commands = []
cmdMove = -1
cmdSummary = -1
cmdWithdraw = -1
cmdItem = -1
cmdMark = -1
cmdRelease = -1
cmdNickname = -1
cmdDebug = -1
cmdCancel = -1
if heldpoke
helptext = _INTL("{1} is selected.",heldpoke.name)
commands[cmdMove = commands.length] = (pokemon) ? _INTL("Shift") : _INTL("Place")
elsif pokemon
helptext = _INTL("{1} is selected.",pokemon.name)
commands[cmdMove = commands.length] = _INTL("Move")
end
commands[cmdSummary = commands.length] = _INTL("Summary")
commands[cmdWithdraw = commands.length] = (selected[0] == -1) ? _INTL("Store") : _INTL("Withdraw")
commands[cmdItem = commands.length] = _INTL("Item")
commands[cmdMark = commands.length] = _INTL("Mark")
commands[cmdRelease = commands.length] = _INTL("Release")
commands[cmdNickname = commands.length] = _INTL("Nickname")
commands[cmdDebug = commands.length] = _INTL("Debug") if $DEBUG
commands[cmdCancel = commands.length] = _INTL("Cancel")
command = pbShowCommands(helptext,commands)
if cmdMove >= 0 && command == cmdMove # Move/Shift/Place
if @heldpkmn
(pokemon) ? pbSwap(selected) : pbPlace(selected)
else
pbHold(selected)
end
elsif cmdSummary >= 0 && command == cmdSummary # Summary
pbSummary(selected, @heldpkmn)
elsif cmdWithdraw >= 0 && command == cmdWithdraw # Withdraw/Store
(selected[0] == -1) ? pbStore(selected, @heldpkmn) : pbWithdraw(selected, @heldpkmn)
elsif cmdItem >= 0 && command == cmdItem # Item
pbItem(selected, @heldpkmn)
elsif cmdMark >= 0 && command == cmdMark # Mark
pbMark(selected,@heldpkmn)
elsif cmdRelease >= 0 && command == cmdRelease # Release
pbRelease(selected, @heldpkmn)
elsif cmdNickname >= 0 && command == cmdNickname
p = @heldpkmn || pokemon
Kernel.pbMessage(_INTL("Choose a nickname for #{p.name}."))
name = pbEnterPokemonName("", 0, PokeBattle_Pokemon::NAMELIMIT,
p.name, p)
if name != p.name && name.size > 0
p.name = name
pbHardRefresh
end
elsif cmdDebug >= 0 && command == cmdDebug # Debug
pbPokemonDebug((@heldpkmn) ? @heldpkmn : pokemon, selected, heldpoke)
end
end
end
end
@scene.pbCloseBox
else
nickname_pbStartScreen(command)
end
end
end