From 941e238606415cbb44359cc8fcb63f854980343e Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Sun, 12 Mar 2023 12:07:01 +0000 Subject: [PATCH] Rearranged the Debug menu --- .../003_Debug menus/002_Debug_MenuCommands.rb | 871 +++++++++--------- 1 file changed, 440 insertions(+), 431 deletions(-) diff --git a/Data/Scripts/020_Debug/003_Debug menus/002_Debug_MenuCommands.rb b/Data/Scripts/020_Debug/003_Debug menus/002_Debug_MenuCommands.rb index b1ac11b81..59fb549f6 100644 --- a/Data/Scripts/020_Debug/003_Debug menus/002_Debug_MenuCommands.rb +++ b/Data/Scripts/020_Debug/003_Debug menus/002_Debug_MenuCommands.rb @@ -38,13 +38,12 @@ MenuHandlers.add(:debug_menu, :warp, { } }) -MenuHandlers.add(:debug_menu, :refresh_map, { - "name" => _INTL("Refresh Map"), +MenuHandlers.add(:debug_menu, :use_pc, { + "name" => _INTL("Use PC"), "parent" => :field_menu, - "description" => _INTL("Make all events on this map, and common events, refresh themselves."), + "description" => _INTL("Use a PC to access Pokémon storage and player's PC."), "effect" => proc { - $game_map.need_refresh = true - pbMessage(_INTL("The map will refresh.")) + pbPokeCenterPC } }) @@ -66,12 +65,40 @@ MenuHandlers.add(:debug_menu, :variables, { } }) -MenuHandlers.add(:debug_menu, :use_pc, { - "name" => _INTL("Use PC"), +MenuHandlers.add(:debug_menu, :refresh_map, { + "name" => _INTL("Refresh Map"), "parent" => :field_menu, - "description" => _INTL("Use a PC to access Pokémon storage and player's PC."), + "description" => _INTL("Make all events on this map, and common events, refresh themselves."), "effect" => proc { - pbPokeCenterPC + $game_map.need_refresh = true + pbMessage(_INTL("The map will refresh.")) + } +}) + +MenuHandlers.add(:debug_menu, :day_care, { + "name" => _INTL("Day Care"), + "parent" => :field_menu, + "description" => _INTL("View Pokémon in the Day Care and edit them."), + "effect" => proc { + pbDebugDayCare + } +}) + +MenuHandlers.add(:debug_menu, :relic_stone, { + "name" => _INTL("Use Relic Stone"), + "parent" => :field_menu, + "description" => _INTL("Shadow Pokémon. Choose a Pokémon to show to the Relic Stone for purification."), + "effect" => proc { + pbRelicStone + } +}) + +MenuHandlers.add(:debug_menu, :purify_chamber, { + "name" => _INTL("Use Purify Chamber"), + "parent" => :field_menu, + "description" => _INTL("Shadow Pokémon. Open the Purify Chamber for purification."), + "effect" => proc { + pbPurifyChamber } }) @@ -113,15 +140,6 @@ MenuHandlers.add(:debug_menu, :storage_wallpapers, { } }) -MenuHandlers.add(:debug_menu, :day_care, { - "name" => _INTL("Day Care"), - "parent" => :field_menu, - "description" => _INTL("View Pokémon in the Day Care and edit them."), - "effect" => proc { - pbDebugDayCare - } -}) - MenuHandlers.add(:debug_menu, :skip_credits, { "name" => _INTL("Skip Credits"), "parent" => :field_menu, @@ -133,24 +151,6 @@ MenuHandlers.add(:debug_menu, :skip_credits, { } }) -MenuHandlers.add(:debug_menu, :relic_stone, { - "name" => _INTL("Use Relic Stone"), - "parent" => :field_menu, - "description" => _INTL("Shadow Pokémon. Choose a Pokémon to show to the Relic Stone for purification."), - "effect" => proc { - pbRelicStone - } -}) - -MenuHandlers.add(:debug_menu, :purify_chamber, { - "name" => _INTL("Use Purify Chamber"), - "parent" => :field_menu, - "description" => _INTL("Shadow Pokémon. Open the Purify Chamber for purification."), - "effect" => proc { - pbPurifyChamber - } -}) - #=============================================================================== # Battle options #=============================================================================== @@ -357,34 +357,26 @@ MenuHandlers.add(:debug_menu, :test_trainer_battle_advanced, { } }) -MenuHandlers.add(:debug_menu, :toggle_logging, { - "name" => _INTL("Toggle Battle Logging"), +MenuHandlers.add(:debug_menu, :encounter_version, { + "name" => _INTL("Set Encounters Version"), "parent" => :battle_menu, - "description" => _INTL("Record debug logs for battles in Data/debuglog.txt."), + "description" => _INTL("Choose which version of wild encounters should be used."), "effect" => proc { - $INTERNAL = !$INTERNAL - pbMessage(_INTL("Debug logs for battles will be made in the Data folder.")) if $INTERNAL - pbMessage(_INTL("Debug logs for battles will not be made.")) if !$INTERNAL + params = ChooseNumberParams.new + params.setRange(0, 99) + params.setInitialValue($PokemonGlobal.encounter_version) + params.setCancelValue(-1) + value = pbMessageChooseNumber(_INTL("Set encounters version to which value?"), params) + $PokemonGlobal.encounter_version = value if value >= 0 } }) -MenuHandlers.add(:debug_menu, :reset_trainers, { - "name" => _INTL("Reset Map's Trainers"), +MenuHandlers.add(:debug_menu, :roamers, { + "name" => _INTL("Roaming Pokémon"), "parent" => :battle_menu, - "description" => _INTL("Turn off Self Switches A and B for all events with \"Trainer\" in their name."), + "description" => _INTL("Toggle and edit all roaming Pokémon."), "effect" => proc { - if $game_map - $game_map.events.each_value do |event| - if event.name[/trainer/i] - $game_self_switches[[$game_map.map_id, event.id, "A"]] = false - $game_self_switches[[$game_map.map_id, event.id, "B"]] = false - end - end - $game_map.need_refresh = true - pbMessage(_INTL("All Trainers on this map were reset.")) - else - pbMessage(_INTL("This command can't be used here.")) - end + pbDebugRoamers } }) @@ -417,26 +409,218 @@ MenuHandlers.add(:debug_menu, :ready_rematches, { } }) -MenuHandlers.add(:debug_menu, :roamers, { - "name" => _INTL("Roaming Pokémon"), +MenuHandlers.add(:debug_menu, :reset_trainers, { + "name" => _INTL("Reset Map's Trainers"), "parent" => :battle_menu, - "description" => _INTL("Toggle and edit all roaming Pokémon."), + "description" => _INTL("Turn off Self Switches A and B for all events with \"Trainer\" in their name."), "effect" => proc { - pbDebugRoamers + if $game_map + $game_map.events.each_value do |event| + if event.name[/trainer/i] + $game_self_switches[[$game_map.map_id, event.id, "A"]] = false + $game_self_switches[[$game_map.map_id, event.id, "B"]] = false + end + end + $game_map.need_refresh = true + pbMessage(_INTL("All Trainers on this map were reset.")) + else + pbMessage(_INTL("This command can't be used here.")) + end } }) -MenuHandlers.add(:debug_menu, :encounter_version, { - "name" => _INTL("Set Encounters Version"), +MenuHandlers.add(:debug_menu, :toggle_exp_all, { + "name" => _INTL("Toggle Exp. All's Effect"), "parent" => :battle_menu, - "description" => _INTL("Choose which version of wild encounters should be used."), + "description" => _INTL("Toggle Exp. All's effect of giving Exp. to non-participants."), "effect" => proc { - params = ChooseNumberParams.new - params.setRange(0, 99) - params.setInitialValue($PokemonGlobal.encounter_version) - params.setCancelValue(-1) - value = pbMessageChooseNumber(_INTL("Set encounters version to which value?"), params) - $PokemonGlobal.encounter_version = value if value >= 0 + $player.has_exp_all = !$player.has_exp_all + pbMessage(_INTL("Enabled Exp. All's effect.")) if $player.has_exp_all + pbMessage(_INTL("Disabled Exp. All's effect.")) if !$player.has_exp_all + } +}) + +MenuHandlers.add(:debug_menu, :toggle_logging, { + "name" => _INTL("Toggle Battle Logging"), + "parent" => :battle_menu, + "description" => _INTL("Record debug logs for battles in Data/debuglog.txt."), + "effect" => proc { + $INTERNAL = !$INTERNAL + pbMessage(_INTL("Debug logs for battles will be made in the Data folder.")) if $INTERNAL + pbMessage(_INTL("Debug logs for battles will not be made.")) if !$INTERNAL + } +}) + +#=============================================================================== +# Pokémon options +#=============================================================================== +MenuHandlers.add(:debug_menu, :pokemon_menu, { + "name" => _INTL("Pokémon Options..."), + "parent" => :main, + "description" => _INTL("Heal the party, give Pokémon, fill/empty PC storage, etc."), + "always_show" => false +}) + +MenuHandlers.add(:debug_menu, :heal_party, { + "name" => _INTL("Heal Party"), + "parent" => :pokemon_menu, + "description" => _INTL("Fully heal the HP/status/PP of all Pokémon in the party."), + "effect" => proc { + $player.party.each { |pkmn| pkmn.heal } + pbMessage(_INTL("Your Pokémon were fully healed.")) + } +}) + +MenuHandlers.add(:debug_menu, :add_pokemon, { + "name" => _INTL("Add Pokémon"), + "parent" => :pokemon_menu, + "description" => _INTL("Give yourself a Pokémon of a chosen species/level. Goes to PC if party is full."), + "effect" => proc { + species = pbChooseSpeciesList + if species + params = ChooseNumberParams.new + params.setRange(1, GameData::GrowthRate.max_level) + params.setInitialValue(5) + params.setCancelValue(0) + level = pbMessageChooseNumber(_INTL("Set the Pokémon's level."), params) + if level > 0 + goes_to_party = !$player.party_full? + if pbAddPokemonSilent(species, level) + if goes_to_party + pbMessage(_INTL("Added {1} to party.", GameData::Species.get(species).name)) + else + pbMessage(_INTL("Added {1} to Pokémon storage.", GameData::Species.get(species).name)) + end + else + pbMessage(_INTL("Couldn't add Pokémon because party and storage are full.")) + end + end + end + } +}) + +MenuHandlers.add(:debug_menu, :fill_boxes, { + "name" => _INTL("Fill Storage Boxes"), + "parent" => :pokemon_menu, + "description" => _INTL("Puts one Pokémon of each species (at Level 50) in storage."), + "effect" => proc { + added = 0 + box_qty = $PokemonStorage.maxPokemon(0) + completed = true + GameData::Species.each do |species_data| + sp = species_data.species + f = species_data.form + # Record each form of each species as seen and owned + if f == 0 + if species_data.single_gendered? + g = (species_data.gender_ratio == :AlwaysFemale) ? 1 : 0 + $player.pokedex.register(sp, g, f, 0, false) + $player.pokedex.register(sp, g, f, 1, false) + else # Both male and female + $player.pokedex.register(sp, 0, f, 0, false) + $player.pokedex.register(sp, 0, f, 1, false) + $player.pokedex.register(sp, 1, f, 0, false) + $player.pokedex.register(sp, 1, f, 1, false) + end + $player.pokedex.set_owned(sp, false) + elsif species_data.real_form_name && !species_data.real_form_name.empty? + g = (species_data.gender_ratio == :AlwaysFemale) ? 1 : 0 + $player.pokedex.register(sp, g, f, 0, false) + $player.pokedex.register(sp, g, f, 1, false) + end + # Add Pokémon (if form 0, i.e. one of each species) + next if f != 0 + if added >= Settings::NUM_STORAGE_BOXES * box_qty + completed = false + next + end + added += 1 + $PokemonStorage[(added - 1) / box_qty, (added - 1) % box_qty] = Pokemon.new(sp, 50) + end + $player.pokedex.refresh_accessible_dexes + pbMessage(_INTL("Storage boxes were filled with one Pokémon of each species.")) + if !completed + pbMessage(_INTL("Note: The number of storage spaces ({1} boxes of {2}) is less than the number of species.", + Settings::NUM_STORAGE_BOXES, box_qty)) + end + } +}) + +MenuHandlers.add(:debug_menu, :clear_boxes, { + "name" => _INTL("Clear Storage Boxes"), + "parent" => :pokemon_menu, + "description" => _INTL("Remove all Pokémon in storage."), + "effect" => proc { + $PokemonStorage.maxBoxes.times do |i| + $PokemonStorage.maxPokemon(i).times do |j| + $PokemonStorage[i, j] = nil + end + end + pbMessage(_INTL("The storage boxes were cleared.")) + } +}) + +MenuHandlers.add(:debug_menu, :give_demo_party, { + "name" => _INTL("Give Demo Party"), + "parent" => :pokemon_menu, + "description" => _INTL("Give yourself 6 preset Pokémon. They overwrite the current party."), + "effect" => proc { + party = [] + species = [:PIKACHU, :PIDGEOTTO, :KADABRA, :GYARADOS, :DIGLETT, :CHANSEY] + species.each { |id| party.push(id) if GameData::Species.exists?(id) } + $player.party.clear + # Generate Pokémon of each species at level 20 + party.each do |spec| + pkmn = Pokemon.new(spec, 20) + $player.party.push(pkmn) + $player.pokedex.register(pkmn) + $player.pokedex.set_owned(spec) + case spec + when :PIDGEOTTO + pkmn.learn_move(:FLY) + when :KADABRA + pkmn.learn_move(:FLASH) + pkmn.learn_move(:TELEPORT) + when :GYARADOS + pkmn.learn_move(:SURF) + pkmn.learn_move(:DIVE) + pkmn.learn_move(:WATERFALL) + when :DIGLETT + pkmn.learn_move(:DIG) + pkmn.learn_move(:CUT) + pkmn.learn_move(:HEADBUTT) + pkmn.learn_move(:ROCKSMASH) + when :CHANSEY + pkmn.learn_move(:SOFTBOILED) + pkmn.learn_move(:STRENGTH) + pkmn.learn_move(:SWEETSCENT) + end + pkmn.record_first_moves + end + pbMessage(_INTL("Filled party with demo Pokémon.")) + } +}) + +MenuHandlers.add(:debug_menu, :quick_hatch_party_eggs, { + "name" => _INTL("Quick Hatch"), + "parent" => :pokemon_menu, + "description" => _INTL("Make all eggs in the party require just one more step to hatch."), + "effect" => proc { + $player.party.each { |pkmn| pkmn.steps_to_hatch = 1 if pkmn.egg? } + pbMessage(_INTL("All eggs in your party now require one step to hatch.")) + } +}) + +MenuHandlers.add(:debug_menu, :open_storage, { + "name" => _INTL("Access Pokémon Storage"), + "parent" => :pokemon_menu, + "description" => _INTL("Opens the Pokémon storage boxes in Organize Boxes mode."), + "effect" => proc { + pbFadeOutIn do + scene = PokemonStorageScene.new + screen = PokemonStorageScreen.new(scene, $PokemonStorage) + screen.pbStartScreen(0) + end } }) @@ -511,179 +695,6 @@ MenuHandlers.add(:debug_menu, :empty_bag, { } }) -#=============================================================================== -# Pokémon options -#=============================================================================== -MenuHandlers.add(:debug_menu, :pokemon_menu, { - "name" => _INTL("Pokémon Options..."), - "parent" => :main, - "description" => _INTL("Give Pokémon, heal party, fill/empty PC storage, etc."), - "always_show" => false -}) - -MenuHandlers.add(:debug_menu, :add_pokemon, { - "name" => _INTL("Add Pokémon"), - "parent" => :pokemon_menu, - "description" => _INTL("Give yourself a Pokémon of a chosen species/level. Goes to PC if party is full."), - "effect" => proc { - species = pbChooseSpeciesList - if species - params = ChooseNumberParams.new - params.setRange(1, GameData::GrowthRate.max_level) - params.setInitialValue(5) - params.setCancelValue(0) - level = pbMessageChooseNumber(_INTL("Set the Pokémon's level."), params) - if level > 0 - goes_to_party = !$player.party_full? - if pbAddPokemonSilent(species, level) - if goes_to_party - pbMessage(_INTL("Added {1} to party.", GameData::Species.get(species).name)) - else - pbMessage(_INTL("Added {1} to Pokémon storage.", GameData::Species.get(species).name)) - end - else - pbMessage(_INTL("Couldn't add Pokémon because party and storage are full.")) - end - end - end - } -}) - -MenuHandlers.add(:debug_menu, :give_demo_party, { - "name" => _INTL("Give Demo Party"), - "parent" => :pokemon_menu, - "description" => _INTL("Give yourself 6 preset Pokémon. They overwrite the current party."), - "effect" => proc { - party = [] - species = [:PIKACHU, :PIDGEOTTO, :KADABRA, :GYARADOS, :DIGLETT, :CHANSEY] - species.each { |id| party.push(id) if GameData::Species.exists?(id) } - $player.party.clear - # Generate Pokémon of each species at level 20 - party.each do |spec| - pkmn = Pokemon.new(spec, 20) - $player.party.push(pkmn) - $player.pokedex.register(pkmn) - $player.pokedex.set_owned(spec) - case spec - when :PIDGEOTTO - pkmn.learn_move(:FLY) - when :KADABRA - pkmn.learn_move(:FLASH) - pkmn.learn_move(:TELEPORT) - when :GYARADOS - pkmn.learn_move(:SURF) - pkmn.learn_move(:DIVE) - pkmn.learn_move(:WATERFALL) - when :DIGLETT - pkmn.learn_move(:DIG) - pkmn.learn_move(:CUT) - pkmn.learn_move(:HEADBUTT) - pkmn.learn_move(:ROCKSMASH) - when :CHANSEY - pkmn.learn_move(:SOFTBOILED) - pkmn.learn_move(:STRENGTH) - pkmn.learn_move(:SWEETSCENT) - end - pkmn.record_first_moves - end - pbMessage(_INTL("Filled party with demo Pokémon.")) - } -}) - -MenuHandlers.add(:debug_menu, :heal_party, { - "name" => _INTL("Heal Party"), - "parent" => :pokemon_menu, - "description" => _INTL("Fully heal the HP/status/PP of all Pokémon in the party."), - "effect" => proc { - $player.party.each { |pkmn| pkmn.heal } - pbMessage(_INTL("Your Pokémon were fully healed.")) - } -}) - -MenuHandlers.add(:debug_menu, :quick_hatch_party_eggs, { - "name" => _INTL("Quick Hatch"), - "parent" => :pokemon_menu, - "description" => _INTL("Make all eggs in the party require just one more step to hatch."), - "effect" => proc { - $player.party.each { |pkmn| pkmn.steps_to_hatch = 1 if pkmn.egg? } - pbMessage(_INTL("All eggs in your party now require one step to hatch.")) - } -}) - -MenuHandlers.add(:debug_menu, :fill_boxes, { - "name" => _INTL("Fill Storage Boxes"), - "parent" => :pokemon_menu, - "description" => _INTL("Puts one Pokémon of each species (at Level 50) in storage."), - "effect" => proc { - added = 0 - box_qty = $PokemonStorage.maxPokemon(0) - completed = true - GameData::Species.each do |species_data| - sp = species_data.species - f = species_data.form - # Record each form of each species as seen and owned - if f == 0 - if species_data.single_gendered? - g = (species_data.gender_ratio == :AlwaysFemale) ? 1 : 0 - $player.pokedex.register(sp, g, f, 0, false) - $player.pokedex.register(sp, g, f, 1, false) - else # Both male and female - $player.pokedex.register(sp, 0, f, 0, false) - $player.pokedex.register(sp, 0, f, 1, false) - $player.pokedex.register(sp, 1, f, 0, false) - $player.pokedex.register(sp, 1, f, 1, false) - end - $player.pokedex.set_owned(sp, false) - elsif species_data.real_form_name && !species_data.real_form_name.empty? - g = (species_data.gender_ratio == :AlwaysFemale) ? 1 : 0 - $player.pokedex.register(sp, g, f, 0, false) - $player.pokedex.register(sp, g, f, 1, false) - end - # Add Pokémon (if form 0, i.e. one of each species) - next if f != 0 - if added >= Settings::NUM_STORAGE_BOXES * box_qty - completed = false - next - end - added += 1 - $PokemonStorage[(added - 1) / box_qty, (added - 1) % box_qty] = Pokemon.new(sp, 50) - end - $player.pokedex.refresh_accessible_dexes - pbMessage(_INTL("Storage boxes were filled with one Pokémon of each species.")) - if !completed - pbMessage(_INTL("Note: The number of storage spaces ({1} boxes of {2}) is less than the number of species.", - Settings::NUM_STORAGE_BOXES, box_qty)) - end - } -}) - -MenuHandlers.add(:debug_menu, :clear_boxes, { - "name" => _INTL("Clear Storage Boxes"), - "parent" => :pokemon_menu, - "description" => _INTL("Remove all Pokémon in storage."), - "effect" => proc { - $PokemonStorage.maxBoxes.times do |i| - $PokemonStorage.maxPokemon(i).times do |j| - $PokemonStorage[i, j] = nil - end - end - pbMessage(_INTL("The storage boxes were cleared.")) - } -}) - -MenuHandlers.add(:debug_menu, :open_storage, { - "name" => _INTL("Access Pokémon Storage"), - "parent" => :pokemon_menu, - "description" => _INTL("Opens the Pokémon storage boxes in Organize Boxes mode."), - "effect" => proc { - pbFadeOutIn do - scene = PokemonStorageScene.new - screen = PokemonStorageScreen.new(scene, $PokemonStorage) - screen.pbStartScreen(0) - end - } -}) - #=============================================================================== # Player options #=============================================================================== @@ -694,33 +705,6 @@ MenuHandlers.add(:debug_menu, :player_menu, { "always_show" => false }) -MenuHandlers.add(:debug_menu, :set_badges, { - "name" => _INTL("Set Badges"), - "parent" => :player_menu, - "description" => _INTL("Toggle possession of each Gym Badge."), - "effect" => proc { - badgecmd = 0 - loop do - badgecmds = [] - badgecmds.push(_INTL("Give all")) - badgecmds.push(_INTL("Remove all")) - 24.times do |i| - badgecmds.push(_INTL("{1} Badge {2}", $player.badges[i] ? "[Y]" : "[ ]", i + 1)) - end - badgecmd = pbShowCommands(nil, badgecmds, -1, badgecmd) - break if badgecmd < 0 - case badgecmd - when 0 # Give all - 24.times { |i| $player.badges[i] = true } - when 1 # Remove all - 24.times { |i| $player.badges[i] = false } - else - $player.badges[badgecmd - 2] = !$player.badges[badgecmd - 2] - end - end - } -}) - MenuHandlers.add(:debug_menu, :set_money, { "name" => _INTL("Set Money"), "parent" => :player_menu, @@ -760,6 +744,33 @@ MenuHandlers.add(:debug_menu, :set_bp, { } }) +MenuHandlers.add(:debug_menu, :set_badges, { + "name" => _INTL("Set Badges"), + "parent" => :player_menu, + "description" => _INTL("Toggle possession of each Gym Badge."), + "effect" => proc { + badgecmd = 0 + loop do + badgecmds = [] + badgecmds.push(_INTL("Give all")) + badgecmds.push(_INTL("Remove all")) + 24.times do |i| + badgecmds.push(_INTL("{1} Badge {2}", $player.badges[i] ? "[Y]" : "[ ]", i + 1)) + end + badgecmd = pbShowCommands(nil, badgecmds, -1, badgecmd) + break if badgecmd < 0 + case badgecmd + when 0 # Give all + 24.times { |i| $player.badges[i] = true } + when 1 # Remove all + 24.times { |i| $player.badges[i] = false } + else + $player.badges[badgecmd - 2] = !$player.badges[badgecmd - 2] + end + end + } +}) + MenuHandlers.add(:debug_menu, :toggle_running_shoes, { "name" => _INTL("Toggle Running Shoes"), "parent" => :player_menu, @@ -771,17 +782,6 @@ MenuHandlers.add(:debug_menu, :toggle_running_shoes, { } }) -MenuHandlers.add(:debug_menu, :toggle_pokegear, { - "name" => _INTL("Toggle Pokégear"), - "parent" => :player_menu, - "description" => _INTL("Toggle possession of the Pokégear."), - "effect" => proc { - $player.has_pokegear = !$player.has_pokegear - pbMessage(_INTL("Gave Pokégear.")) if $player.has_pokegear - pbMessage(_INTL("Lost Pokégear.")) if !$player.has_pokegear - } -}) - MenuHandlers.add(:debug_menu, :toggle_pokedex, { "name" => _INTL("Toggle Pokédex and Dexes"), "parent" => :player_menu, @@ -811,6 +811,17 @@ MenuHandlers.add(:debug_menu, :toggle_pokedex, { } }) +MenuHandlers.add(:debug_menu, :toggle_pokegear, { + "name" => _INTL("Toggle Pokégear"), + "parent" => :player_menu, + "description" => _INTL("Toggle possession of the Pokégear."), + "effect" => proc { + $player.has_pokegear = !$player.has_pokegear + pbMessage(_INTL("Gave Pokégear.")) if $player.has_pokegear + pbMessage(_INTL("Lost Pokégear.")) if !$player.has_pokegear + } +}) + MenuHandlers.add(:debug_menu, :toggle_box_link, { "name" => _INTL("Toggle Pokémon Box Link's Effect"), "parent" => :player_menu, @@ -822,17 +833,6 @@ MenuHandlers.add(:debug_menu, :toggle_box_link, { } }) -MenuHandlers.add(:debug_menu, :toggle_exp_all, { - "name" => _INTL("Toggle Exp. All's Effect"), - "parent" => :player_menu, - "description" => _INTL("Toggle Exp. All's effect of giving Exp. to non-participants."), - "effect" => proc { - $player.has_exp_all = !$player.has_exp_all - pbMessage(_INTL("Enabled Exp. All's effect.")) if $player.has_exp_all - pbMessage(_INTL("Disabled Exp. All's effect.")) if !$player.has_exp_all - } -}) - MenuHandlers.add(:debug_menu, :set_player_character, { "name" => _INTL("Set Player Character"), "parent" => :player_menu, @@ -903,80 +903,71 @@ MenuHandlers.add(:debug_menu, :random_id, { }) #=============================================================================== -# Information editors +# PBS file editors #=============================================================================== -MenuHandlers.add(:debug_menu, :editors_menu, { - "name" => _INTL("Information Editors..."), +MenuHandlers.add(:debug_menu, :pbs_editors_menu, { + "name" => _INTL("PBS File Editors..."), "parent" => :main, - "description" => _INTL("Edit information in the PBS files, terrain tags, battle animations, etc.") -}) - -MenuHandlers.add(:debug_menu, :set_metadata, { - "name" => _INTL("Edit Metadata"), - "parent" => :editors_menu, - "description" => _INTL("Edit global metadata and player character metadata."), - "effect" => proc { - pbMetadataScreen - } -}) - -MenuHandlers.add(:debug_menu, :set_map_metadata, { - "name" => _INTL("Edit Map Metadata"), - "parent" => :editors_menu, - "description" => _INTL("Edit map metadata."), - "effect" => proc { - pbMapMetadataScreen(pbDefaultMap) - } + "description" => _INTL("Edit information in the PBS files.") }) MenuHandlers.add(:debug_menu, :set_map_connections, { - "name" => _INTL("Edit Map Connections"), - "parent" => :editors_menu, + "name" => _INTL("Edit map_connections.txt"), + "parent" => :pbs_editors_menu, "description" => _INTL("Connect maps using a visual interface. Can also edit map encounters/metadata."), "effect" => proc { pbFadeOutIn { pbConnectionsEditor } } }) -MenuHandlers.add(:debug_menu, :set_terrain_tags, { - "name" => _INTL("Edit Terrain Tags"), - "parent" => :editors_menu, - "description" => _INTL("Edit the terrain tags of tiles in tilesets. Required for tags 8+."), - "effect" => proc { - pbFadeOutIn { pbTilesetScreen } - } -}) - MenuHandlers.add(:debug_menu, :set_encounters, { - "name" => _INTL("Edit Wild Encounters"), - "parent" => :editors_menu, + "name" => _INTL("Edit encounters.txt"), + "parent" => :pbs_editors_menu, "description" => _INTL("Edit the wild Pokémon that can be found on maps, and how they are encountered."), "effect" => proc { pbFadeOutIn { pbEncountersEditor } } }) -MenuHandlers.add(:debug_menu, :set_trainer_types, { - "name" => _INTL("Edit Trainer Types"), - "parent" => :editors_menu, - "description" => _INTL("Edit the properties of trainer types."), - "effect" => proc { - pbFadeOutIn { pbTrainerTypeEditor } - } -}) - MenuHandlers.add(:debug_menu, :set_trainers, { - "name" => _INTL("Edit Individual Trainers"), - "parent" => :editors_menu, + "name" => _INTL("Edit trainers.txt"), + "parent" => :pbs_editors_menu, "description" => _INTL("Edit individual trainers, their Pokémon and items."), "effect" => proc { pbFadeOutIn { pbTrainerBattleEditor } } }) +MenuHandlers.add(:debug_menu, :set_trainer_types, { + "name" => _INTL("Edit trainer_types.txt"), + "parent" => :pbs_editors_menu, + "description" => _INTL("Edit the properties of trainer types."), + "effect" => proc { + pbFadeOutIn { pbTrainerTypeEditor } + } +}) + +MenuHandlers.add(:debug_menu, :set_map_metadata, { + "name" => _INTL("Edit map_metadata.txt"), + "parent" => :pbs_editors_menu, + "description" => _INTL("Edit map metadata."), + "effect" => proc { + pbMapMetadataScreen(pbDefaultMap) + } +}) + +MenuHandlers.add(:debug_menu, :set_metadata, { + "name" => _INTL("Edit metadata.txt"), + "parent" => :pbs_editors_menu, + "description" => _INTL("Edit global metadata and player character metadata."), + "effect" => proc { + pbMetadataScreen + } +}) + MenuHandlers.add(:debug_menu, :set_items, { - "name" => _INTL("Edit Items"), - "parent" => :editors_menu, + "name" => _INTL("Edit items.txt"), + "parent" => :pbs_editors_menu, "description" => _INTL("Edit item data."), "effect" => proc { pbFadeOutIn { pbItemEditor } @@ -984,26 +975,17 @@ MenuHandlers.add(:debug_menu, :set_items, { }) MenuHandlers.add(:debug_menu, :set_species, { - "name" => _INTL("Edit Pokémon Species"), - "parent" => :editors_menu, + "name" => _INTL("Edit pokemon.txt"), + "parent" => :pbs_editors_menu, "description" => _INTL("Edit Pokémon species data."), "effect" => proc { pbFadeOutIn { pbPokemonEditor } } }) -MenuHandlers.add(:debug_menu, :set_pokedex_lists, { - "name" => _INTL("Edit Regional Dexes"), - "parent" => :editors_menu, - "description" => _INTL("Create, rearrange and delete Regional Pokédex lists."), - "effect" => proc { - pbFadeOutIn { pbRegionalDexEditorMain } - } -}) - MenuHandlers.add(:debug_menu, :position_sprites, { - "name" => _INTL("Edit Pokémon Sprite Positions"), - "parent" => :editors_menu, + "name" => _INTL("Edit pokemon_metrics.txt"), + "parent" => :pbs_editors_menu, "description" => _INTL("Reposition Pokémon sprites in battle."), "effect" => proc { pbFadeOutIn do @@ -1015,8 +997,8 @@ MenuHandlers.add(:debug_menu, :position_sprites, { }) MenuHandlers.add(:debug_menu, :auto_position_sprites, { - "name" => _INTL("Auto-Position All Pokémon Sprites"), - "parent" => :editors_menu, + "name" => _INTL("Auto-Set pokemon_metrics.txts"), + "parent" => :pbs_editors_menu, "description" => _INTL("Automatically reposition all Pokémon sprites in battle. Don't use lightly."), "effect" => proc { if pbConfirmMessage(_INTL("Are you sure you want to reposition all sprites?")) @@ -1029,6 +1011,24 @@ MenuHandlers.add(:debug_menu, :auto_position_sprites, { } }) +MenuHandlers.add(:debug_menu, :set_pokedex_lists, { + "name" => _INTL("Edit regional_dexes.txt"), + "parent" => :pbs_editors_menu, + "description" => _INTL("Create, rearrange and delete Regional Pokédex lists."), + "effect" => proc { + pbFadeOutIn { pbRegionalDexEditorMain } + } +}) + +#=============================================================================== +# Other editors +#=============================================================================== +MenuHandlers.add(:debug_menu, :editors_menu, { + "name" => _INTL("Other Editors..."), + "parent" => :main, + "description" => _INTL("Edit battle animations, terrain tags, map data, etc.") +}) + MenuHandlers.add(:debug_menu, :animation_editor, { "name" => _INTL("Battle Animation Editor"), "parent" => :editors_menu, @@ -1065,78 +1065,31 @@ MenuHandlers.add(:debug_menu, :export_animations, { } }) +MenuHandlers.add(:debug_menu, :set_terrain_tags, { + "name" => _INTL("Edit Terrain Tags"), + "parent" => :editors_menu, + "description" => _INTL("Edit the terrain tags of tiles in tilesets. Required for tags 8+."), + "effect" => proc { + pbFadeOutIn { pbTilesetScreen } + } +}) + +MenuHandlers.add(:debug_menu, :fix_invalid_tiles, { + "name" => _INTL("Fix Invalid Tiles"), + "parent" => :editors_menu, + "description" => _INTL("Scans all maps and erases non-existent tiles."), + "effect" => proc { + pbDebugFixInvalidTiles + } +}) + #=============================================================================== # Other options #=============================================================================== MenuHandlers.add(:debug_menu, :other_menu, { - "name" => _INTL("Other Options..."), + "name" => _INTL("File Management Options..."), "parent" => :main, - "description" => _INTL("Mystery Gifts, translations, compile data, etc.") -}) - -MenuHandlers.add(:debug_menu, :mystery_gift, { - "name" => _INTL("Manage Mystery Gifts"), - "parent" => :other_menu, - "description" => _INTL("Edit and enable/disable Mystery Gifts."), - "effect" => proc { - pbManageMysteryGifts - } -}) - -MenuHandlers.add(:debug_menu, :extract_text, { - "name" => _INTL("Extract Text For Translation"), - "parent" => :other_menu, - "description" => _INTL("Extract all text in the game to text files for translating."), - "effect" => proc { - if Settings::LANGUAGES.length == 0 - pbMessage(_INTL("No languages are defined in the LANGUAGES array in Settings.")) - pbMessage(_INTL("You need to add at least one language to LANGUAGES first, to choose which one to extract text for.")) - next - end - # Choose a language from Settings to name the extraction folder after - cmds = [] - Settings::LANGUAGES.each { |val| cmds.push(val[0]) } - cmds.push(_INTL("Cancel")) - language_index = pbMessage(_INTL("Choose a language to extract text for."), cmds, cmds.length) - next if language_index == cmds.length - 1 - language_name = Settings::LANGUAGES[language_index][1] - # Choose whether to extract core text or game text - text_type = pbMessage(_INTL("Choose a language to extract text for."), - [_INTL("Game-specific text"), _INTL("Core text"), _INTL("Cancel")], 3) - next if text_type == 2 - # If game text, choose whether to extract map texts to map-specific files or - # to one big file - map_files = 0 - if text_type == 0 - map_files = pbMessage(_INTL("How many text files should map event texts be extracted to?"), - [_INTL("One big file"), _INTL("One file per map"), _INTL("Cancel")], 3) - next if map_files == 2 - end - # Extract the chosen set of text for the chosen language - Translator.extract_text(language_name, text_type == 1, map_files == 1) - } -}) - -MenuHandlers.add(:debug_menu, :compile_text, { - "name" => _INTL("Compile Translated Text"), - "parent" => :other_menu, - "description" => _INTL("Import text files and convert them into a language file."), - "effect" => proc { - # Find all folders with a particular naming convention - cmds = Dir.glob("Text_*_*") - if cmds.length == 0 - pbMessage(_INTL("No language folders found to compile.")) - pbMessage(_INTL("Language folders must be named \"Text_SOMETHING_core\" or \"Text_SOMETHING_game\" and be in the root folder.")) - next - end - cmds.push(_INTL("Cancel")) - # Ask which folder to compile into a .dat file - folder_index = pbMessage(_INTL("Choose a language folder to compile."), cmds, cmds.length) - next if folder_index == cmds.length - 1 - # Compile the text files in the chosen folder - dat_filename = cmds[folder_index].gsub!(/^Text_/, "") - Translator.compile_text(cmds[folder_index], dat_filename) - } + "description" => _INTL("Compile, generate PBS files, translations, Mystery Gifts, etc.") }) MenuHandlers.add(:debug_menu, :compile_data, { @@ -1215,15 +1168,6 @@ MenuHandlers.add(:debug_menu, :create_pbs_files, { } }) -MenuHandlers.add(:debug_menu, :fix_invalid_tiles, { - "name" => _INTL("Fix Invalid Tiles"), - "parent" => :other_menu, - "description" => _INTL("Scans all maps and erases non-existent tiles."), - "effect" => proc { - pbDebugFixInvalidTiles - } -}) - MenuHandlers.add(:debug_menu, :rename_files, { "name" => _INTL("Rename Outdated Files"), "parent" => :other_menu, @@ -1236,6 +1180,71 @@ MenuHandlers.add(:debug_menu, :rename_files, { } }) +MenuHandlers.add(:debug_menu, :extract_text, { + "name" => _INTL("Extract Text For Translation"), + "parent" => :other_menu, + "description" => _INTL("Extract all text in the game to text files for translating."), + "effect" => proc { + if Settings::LANGUAGES.length == 0 + pbMessage(_INTL("No languages are defined in the LANGUAGES array in Settings.")) + pbMessage(_INTL("You need to add at least one language to LANGUAGES first, to choose which one to extract text for.")) + next + end + # Choose a language from Settings to name the extraction folder after + cmds = [] + Settings::LANGUAGES.each { |val| cmds.push(val[0]) } + cmds.push(_INTL("Cancel")) + language_index = pbMessage(_INTL("Choose a language to extract text for."), cmds, cmds.length) + next if language_index == cmds.length - 1 + language_name = Settings::LANGUAGES[language_index][1] + # Choose whether to extract core text or game text + text_type = pbMessage(_INTL("Choose a language to extract text for."), + [_INTL("Game-specific text"), _INTL("Core text"), _INTL("Cancel")], 3) + next if text_type == 2 + # If game text, choose whether to extract map texts to map-specific files or + # to one big file + map_files = 0 + if text_type == 0 + map_files = pbMessage(_INTL("How many text files should map event texts be extracted to?"), + [_INTL("One big file"), _INTL("One file per map"), _INTL("Cancel")], 3) + next if map_files == 2 + end + # Extract the chosen set of text for the chosen language + Translator.extract_text(language_name, text_type == 1, map_files == 1) + } +}) + +MenuHandlers.add(:debug_menu, :compile_text, { + "name" => _INTL("Compile Translated Text"), + "parent" => :other_menu, + "description" => _INTL("Import text files and convert them into a language file."), + "effect" => proc { + # Find all folders with a particular naming convention + cmds = Dir.glob("Text_*_*") + if cmds.length == 0 + pbMessage(_INTL("No language folders found to compile.")) + pbMessage(_INTL("Language folders must be named \"Text_SOMETHING_core\" or \"Text_SOMETHING_game\" and be in the root folder.")) + next + end + cmds.push(_INTL("Cancel")) + # Ask which folder to compile into a .dat file + folder_index = pbMessage(_INTL("Choose a language folder to compile."), cmds, cmds.length) + next if folder_index == cmds.length - 1 + # Compile the text files in the chosen folder + dat_filename = cmds[folder_index].gsub!(/^Text_/, "") + Translator.compile_text(cmds[folder_index], dat_filename) + } +}) + +MenuHandlers.add(:debug_menu, :mystery_gift, { + "name" => _INTL("Manage Mystery Gifts"), + "parent" => :other_menu, + "description" => _INTL("Edit and enable/disable Mystery Gifts."), + "effect" => proc { + pbManageMysteryGifts + } +}) + MenuHandlers.add(:debug_menu, :reload_system_cache, { "name" => _INTL("Reload System Cache"), "parent" => :other_menu,