Rewrote party screen debug code, misc code changes

This commit is contained in:
Maruno17
2024-10-01 19:10:34 +01:00
parent fc538a09f7
commit 61b6bb5aeb
14 changed files with 731 additions and 854 deletions

View File

@@ -159,7 +159,7 @@ module PokemonDebugMixin
# Main loop
command = 0
loop do
command = pbShowCommands(_INTL("Do what with {1}?", pkmn.name), commands.list, command)
command = show_menu(_INTL("Do what with {1}?", pkmn.name), commands.list, command)
if command < 0
parent = commands.getParent
break if !parent
@@ -422,8 +422,41 @@ end
#===============================================================================
#
#===============================================================================
class PokemonDebugPartyScreen
class UI::PartyDebugVisuals < UI::BaseVisuals
def initialize_background; end
def initialize_overlay; end
def choose_number(help_text, maximum, init_value = 1)
old_letter_by_letter = @sprites[:speech_box].letterbyletter
@sprites[:speech_box].letterbyletter = false
ret = super
@sprites[:speech_box].letterbyletter = old_letter_by_letter
return ret
end
end
class UI::PartyDebug < UI::BaseScreen
include PokemonDebugMixin
def initialize_visuals
@visuals = UI::PartyDebugVisuals.new
end
def choose_move(pkmn, message, index = 0)
# TODO: The move names can get rather wide, making the message box rather
# thin. It's just about acceptable, but maybe the choice window needs
# to be displayed above the message box instead of to the right of it.
move_names = []
pkmn.moves.each do |move|
next if !move || !move.id
if move.total_pp <= 0
move_names.push(_INTL("{1} (PP: ---)", move.name))
else
move_names.push(_INTL("{1} (PP: {2}/{3})", move.name, move.pp, move.total_pp))
end
end
return show_menu(message, move_names, index)
end
end
#===============================================================================