From d3d7222fd3959e0497c1928643d91d54f8900162 Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Sat, 26 Dec 2020 19:59:05 +0000 Subject: [PATCH] Changed naming convention for various sprites, and added compiler script that renames files for this --- .../011_Data/001_Game data/003_Item.rb | 14 +- .../001_Game data/008_Trainer type.rb | 20 +- .../001_Game data/011_Species files.rb | 65 +++-- .../Scripts/017_UI/020_PScreen_EggHatching.rb | 6 +- Data/Scripts/017_UI/025_PScreen_Mart.rb | 2 +- Data/Scripts/022_Compiler/002_Compiler.rb | 2 + .../005_Compiler_Sprite renamer.rb | 238 ++++++++++++++++++ Data/Scripts/999_Main/999_Main.rb | 15 +- 8 files changed, 298 insertions(+), 64 deletions(-) create mode 100644 Data/Scripts/022_Compiler/005_Compiler_Sprite renamer.rb diff --git a/Data/Scripts/011_Data/001_Game data/003_Item.rb b/Data/Scripts/011_Data/001_Game data/003_Item.rb index cf6876921..b853d11fb 100644 --- a/Data/Scripts/011_Data/001_Game data/003_Item.rb +++ b/Data/Scripts/011_Data/001_Game data/003_Item.rb @@ -19,24 +19,24 @@ module GameData include InstanceMethods def self.icon_filename(item) - return "Graphics/Icons/itemBack" if item.nil? + return "Graphics/Items/back" if item.nil? item_data = self.try_get(item) - return "Graphics/Icons/item000" if item_data.nil? + return "Graphics/Items/000" if item_data.nil? # Check for files - ret = sprintf("Graphics/Icons/item%s", item_data.id) + ret = sprintf("Graphics/Items/%s", item_data.id) return ret if pbResolveBitmap(ret) - ret = sprintf("Graphics/Icons/item%03d", item_data.id_number) + ret = sprintf("Graphics/Items/%03d", item_data.id_number) return ret if pbResolveBitmap(ret) # Check for TM/HM type icons if item_data.is_machine? move_type = GameData::Move.get(item_data.move).type type_data = GameData::Type.get(move_type) - ret = sprintf("Graphics/Icons/itemMachine%s", type_data.id) + ret = sprintf("Graphics/Items/machine_%s", type_data.id) return ret if pbResolveBitmap(ret) - ret = sprintf("Graphics/Icons/itemMachine%03d", type_data.id_number) + ret = sprintf("Graphics/Items/machine_%03d", type_data.id_number) return ret if pbResolveBitmap(ret) end - return "Graphics/Icons/item000" + return "Graphics/Items/000" end def self.held_icon_filename(item) diff --git a/Data/Scripts/011_Data/001_Game data/008_Trainer type.rb b/Data/Scripts/011_Data/001_Game data/008_Trainer type.rb index 581efc1b8..b74b2293a 100644 --- a/Data/Scripts/011_Data/001_Game data/008_Trainer type.rb +++ b/Data/Scripts/011_Data/001_Game data/008_Trainer type.rb @@ -17,19 +17,19 @@ module GameData extend ClassMethods include InstanceMethods - def self.check_file(tr_type, path, suffix = "") + def self.check_file(tr_type, path, optional_suffix = "", suffix = "") tr_type_data = self.try_get(tr_type) return nil if tr_type_data.nil? # Check for files - if !suffix.empty? - ret = path + tr_type_data.id.to_s + suffix + if !optional_suffix.empty? + ret = path + tr_type_data.id.to_s + optional_suffix + suffix return ret if pbResolveBitmap(ret) - ret = path + sprintf("%03d", tr_type_data.id_number) + suffix + ret = path + sprintf("%03d", tr_type_data.id_number) + optional_suffix + suffix return ret if pbResolveBitmap(ret) end - ret = path + tr_type_data.id.to_s + ret = path + tr_type_data.id.to_s + suffix return ret if pbResolveBitmap(ret) - ret = path + sprintf("%03d", tr_type_data.id_number) + ret = path + sprintf("%03d", tr_type_data.id_number) + suffix return (pbResolveBitmap(ret)) ? ret : nil end @@ -44,21 +44,21 @@ module GameData end def self.front_sprite_filename(tr_type) - return self.check_file(tr_type, "Graphics/Trainers/trainer") + return self.check_file(tr_type, "Graphics/Trainers/") end def self.player_front_sprite_filename(tr_type) outfit = ($Trainer) ? $Trainer.outfit : 0 - return self.check_file(tr_type, "Graphics/Trainers/trainer", sprintf("_%d", outfit)) + return self.check_file(tr_type, "Graphics/Trainers/", sprintf("_%d", outfit)) end def self.back_sprite_filename(tr_type) - return self.check_file(tr_type, "Graphics/Trainers/trback") + return self.check_file(tr_type, "Graphics/Trainers/", nil, "_back") end def self.player_back_sprite_filename(tr_type) outfit = ($Trainer) ? $Trainer.outfit : 0 - return self.check_file(tr_type, "Graphics/Trainers/trback", sprintf("_%d", outfit)) + return self.check_file(tr_type, "Graphics/Trainers/", sprintf("_%d", outfit), "_back") end def self.map_icon_filename(tr_type) diff --git a/Data/Scripts/011_Data/001_Game data/011_Species files.rb b/Data/Scripts/011_Data/001_Game data/011_Species files.rb index a3226f0c1..2a78c37ef 100644 --- a/Data/Scripts/011_Data/001_Game data/011_Species files.rb +++ b/Data/Scripts/011_Data/001_Game data/011_Species files.rb @@ -1,18 +1,17 @@ module GameData class Species - def self.check_graphic_file(path, species, form = 0, gender = 0, shiny = false, shadow = false, back = false) + def self.check_graphic_file(path, species, form = 0, gender = 0, shiny = false, shadow = false, subfolder = "") + try_subfolder = sprintf("%s/", subfolder) species_data = self.get_species_form(species, form) species_id = sprintf("%03d", (species_data) ? self.get(species_data.species).id_number : 0) try_species = species try_form = (form > 0) ? sprintf("_%d", form) : "" - try_gender = (gender == 1) ? "f" : "" - try_shiny = (shiny) ? "s" : "" + try_gender = (gender == 1) ? "_female" : "" try_shadow = (shadow) ? "_shadow" : "" - try_back = (back) ? "b" : "" factors = [] - factors.push([4, try_shadow, ""]) if shadow + factors.push([4, sprintf("%s shiny/", subfolder), try_subfolder]) if shiny + factors.push([3, try_shadow, ""]) if shadow factors.push([2, try_gender, ""]) if gender == 1 - factors.push([3, try_shiny, ""]) if shiny factors.push([1, try_form, ""]) if form > 0 factors.push([0, try_species, "000"]) # Go through each combination of parameters in turn to find an existing sprite @@ -21,19 +20,19 @@ module GameData factors.each_with_index do |factor, index| value = ((i / (2 ** index)) % 2 == 0) ? factor[1] : factor[2] case factor[0] - when 0 then try_species = value - when 1 then try_form = value - when 2 then try_gender = value - when 3 then try_shiny = value - when 4 then try_shadow = value + when 0 then try_species = value + when 1 then try_form = value + when 2 then try_gender = value + when 3 then try_shadow = value + when 4 then try_subfolder = value # Shininess end end # Look for a graphic matching this combination's parameters for j in 0...2 # Try using the species' ID symbol and then its ID number next if !try_species || (try_species == "000" && j == 1) try_species_text = (j == 0) ? try_species : species_id - ret = pbResolveBitmap(sprintf("%s%s%s%s%s%s%s", path, - try_species_text, try_gender, try_shiny, try_back, try_form, try_shadow)) + ret = pbResolveBitmap(sprintf("%s%s%s%s%s%s", path, try_subfolder, + try_species_text, try_form, try_gender, try_shadow)) return ret if ret end end @@ -45,27 +44,27 @@ module GameData return nil if species_data.nil? species_id = self.get(species_data.species).id_number if form > 0 - ret = pbResolveBitmap(sprintf("%s%segg_%d", path, species_data.species, form)) + ret = pbResolveBitmap(sprintf("%s%s_%d", path, species_data.species, form)) return ret if ret - ret = pbResolveBitmap(sprintf("%s%03degg_%d", path, species_id, form)) + ret = pbResolveBitmap(sprintf("%s%03d_%d", path, species_id, form)) return ret if ret end - ret = pbResolveBitmap(sprintf("%s%segg", path, species_data.species)) + ret = pbResolveBitmap(sprintf("%s%s", path, species_data.species)) return ret if ret - return pbResolveBitmap(sprintf("%s%03degg", path, species_id)) + return pbResolveBitmap(sprintf("%s%03d", path, species_id)) end def self.front_sprite_filename(species, form = 0, gender = 0, shiny = false, shadow = false) - return self.check_graphic_file("Graphics/Battlers/", species, form, gender, shiny, shadow) + return self.check_graphic_file("Graphics/Pokemon/", species, form, gender, shiny, shadow, "Front") end def self.back_sprite_filename(species, form = 0, gender = 0, shiny = false, shadow = false) - return self.check_graphic_file("Graphics/Battlers/", species, form, gender, shiny, shadow, true) + return self.check_graphic_file("Graphics/Pokemon/", species, form, gender, shiny, shadow, "Back") end def self.egg_sprite_filename(species, form) - ret = self.check_egg_graphic_file("Graphics/Battlers/", species, form) - return (ret) ? ret : pbResolveBitmap("Graphics/Battlers/egg") + ret = self.check_egg_graphic_file("Graphics/Pokemon/Eggs/", species, form) + return (ret) ? ret : pbResolveBitmap("Graphics/Pokemon/Eggs/000") end def self.sprite_filename(species, form = 0, gender = 0, shiny = false, shadow = false, back = false, egg = false) @@ -117,13 +116,13 @@ module GameData #=========================================================================== def self.egg_icon_filename(species, form) - ret = self.check_egg_graphic_file("Graphics/Icons/icon", species, form) - return (ret) ? ret : pbResolveBitmap("Graphics/Icons/iconEgg") + ret = self.check_egg_graphic_file("Graphics/Pokemon/Icons", species, form) + return (ret) ? ret : pbResolveBitmap("Graphics/Pokemon/Icons/000_egg") end def self.icon_filename(species, form = 0, gender = 0, shiny = false, shadow = false, egg = false) return self.egg_icon_filename(species, form) if egg - return self.check_graphic_file("Graphics/Icons/icon", species, form, gender, shiny, shadow) + return self.check_graphic_file("Graphics/Pokemon/", species, form, gender, shiny, shadow, "Icons") end def self.icon_filename_from_pokemon(pkmn) @@ -151,14 +150,14 @@ module GameData return nil if species_data.nil? species_id = self.get(species_data.species).id_number if form > 0 - ret = pbResolveBitmap(sprintf("Graphics/Icons/Footprints/footprint%s_%d", species_data.species, form)) + ret = pbResolveBitmap(sprintf("Graphics/Pokemon/Footprints/%s_%d", species_data.species, form)) return ret if ret - ret = pbResolveBitmap(sprintf("Graphics/Icons/Footprints/footprint%03d_%d", species_id, form)) + ret = pbResolveBitmap(sprintf("Graphics/Pokemon/Footprints/%03d_%d", species_id, form)) return ret if ret end - ret = pbResolveBitmap(sprintf("Graphics/Icons/Footprints/footprint%s", species_data.species)) + ret = pbResolveBitmap(sprintf("Graphics/Pokemon/Footprints/%s", species_data.species)) return ret if ret - return pbResolveBitmap(sprintf("Graphics/Icons/Footprints/footprint%03d", species_id)) + return pbResolveBitmap(sprintf("Graphics/Pokemon/Footprints/%03d", species_id)) end #=========================================================================== @@ -169,17 +168,17 @@ module GameData species_id = self.get(species_data.species).id_number # Look for species-specific shadow graphic if form > 0 - ret = pbResolveBitmap(sprintf("Graphics/Battlers/%s_%d_battleshadow", species_data.species, form)) + ret = pbResolveBitmap(sprintf("Graphics/Pokemon/Shadow/%s_%d", species_data.species, form)) return ret if ret - ret = pbResolveBitmap(sprintf("Graphics/Battlers/%03d_%d_battleshadow", species_id, form)) + ret = pbResolveBitmap(sprintf("Graphics/Pokemon/Shadow/%03d_%d", species_id, form)) return ret if ret end - ret = pbResolveBitmap(sprintf("Graphics/Battlers/%s_battleshadow", species_data.species)) + ret = pbResolveBitmap(sprintf("Graphics/Pokemon/Shadow/%s", species_data.species)) return ret if ret - ret = pbResolveBitmap(sprintf("Graphics/Battlers/%03d_battleshadow", species_id)) + ret = pbResolveBitmap(sprintf("Graphics/Pokemon/Shadow/%03d", species_id)) return ret if ret # Use general shadow graphic - return pbResolveBitmap(sprintf("Graphics/Pictures/Battle/battler_shadow_%d", species_data.shadow_size)) + return pbResolveBitmap(sprintf("Graphics/Pokemon/Shadow/%d", species_data.shadow_size)) end def self.shadow_bitmap(species, form = 0) diff --git a/Data/Scripts/017_UI/020_PScreen_EggHatching.rb b/Data/Scripts/017_UI/020_PScreen_EggHatching.rb index e0ab611a8..7aeaf3660 100644 --- a/Data/Scripts/017_UI/020_PScreen_EggHatching.rb +++ b/Data/Scripts/017_UI/020_PScreen_EggHatching.rb @@ -28,10 +28,10 @@ class PokemonEggHatch_Scene @pokemon.form, @pokemon.shiny?, false, false, true) # Egg sprite # Load egg cracks bitmap - crackfilename = sprintf("Graphics/Battlers/%seggCracks", @pokemon.species) + crackfilename = sprintf("Graphics/Pokemon/Eggs/%s_cracks", @pokemon.species) if !pbResolveBitmap(crackfilename) - crackfilename = sprintf("Graphics/Battlers/%03deggCracks", @pokemon.species_data.id_number) - crackfilename = sprintf("Graphics/Battlers/eggCracks") if !pbResolveBitmap(crackfilename) + crackfilename = sprintf("Graphics/Pokemon/Eggs/%03d_cracks", @pokemon.species_data.id_number) + crackfilename = sprintf("Graphics/Pokemon/Eggs/000_cracks") if !pbResolveBitmap(crackfilename) end crackfilename=pbResolveBitmap(crackfilename) @hatchSheet=AnimatedBitmap.new(crackfilename) diff --git a/Data/Scripts/017_UI/025_PScreen_Mart.rb b/Data/Scripts/017_UI/025_PScreen_Mart.rb index d2f553ebb..29da610f0 100644 --- a/Data/Scripts/017_UI/025_PScreen_Mart.rb +++ b/Data/Scripts/017_UI/025_PScreen_Mart.rb @@ -108,7 +108,7 @@ class RpgxpMartAdapter def getItemIcon(item) return nil if !item if item == 0 - return sprintf("Graphics/Icons/itemBack") + return sprintf("Graphics/Items/back") elsif item.respond_to?("icon_index") return "Graphics/System/IconSet" else diff --git a/Data/Scripts/022_Compiler/002_Compiler.rb b/Data/Scripts/022_Compiler/002_Compiler.rb index 62cce0043..0570d682f 100644 --- a/Data/Scripts/022_Compiler/002_Compiler.rb +++ b/Data/Scripts/022_Compiler/002_Compiler.rb @@ -668,6 +668,8 @@ module Compiler yield(_INTL("Saving messages")) pbSetTextMessages MessageTypes.saveMessages + yield(_INTL("Renaming sprites and cries")) + convert_files end pbSetWindowText(nil) end diff --git a/Data/Scripts/022_Compiler/005_Compiler_Sprite renamer.rb b/Data/Scripts/022_Compiler/005_Compiler_Sprite renamer.rb new file mode 100644 index 000000000..cc970569a --- /dev/null +++ b/Data/Scripts/022_Compiler/005_Compiler_Sprite renamer.rb @@ -0,0 +1,238 @@ +class File + # Copies the source file to the destination path. + def self.copy(source, destination) + data = "" + t = Time.now + File.open(source, 'rb') do |f| + while r = f.read(4096) + if Time.now - t > 1 + Graphics.update + t = Time.now + end + data += r + end + end + File.delete(destination) if File.file?(destination) + f = File.new(destination, 'wb') + f.write data + f.close + end + + # Copies the source to the destination and deletes the source. + def self.move(source, destination) + File.copy(source, destination) + File.delete(source) + end +end + +#=============================================================================== +# +#=============================================================================== +module Compiler + module_function + + def readDirectoryFiles(directory, formats) + files = [] + Dir.chdir(directory) { + for i in 0...formats.length + Dir.glob(formats[i]) { |f| files.push(f) } + end + } + return files + end + + def convert_pokemon_filename(full_name, default_prefix = "") + name = full_name + extension = nil + if full_name[/^(.+)\.([^\.]+)$/] # Of the format something.abc + name = $~[1] + extension = $~[2] + end + prefix = default_prefix + form = female = shadow = crack = "" + if default_prefix == "" + if name[/s/] && !name[/shadow/] + prefix = (name[/b/]) ? "Back shiny/" : "Front shiny/" + else + prefix = (name[/b/]) ? "Back/" : "Front/" + end + end + if name[/000/] + species = "000" + else + species_number = name[0, 3].to_i + species_data = GameData::Species.try_get(species_number) + raise _INTL("Species {1} is not defined (trying to rename Pokémon graphic {2}).", species_number, full_name) if !species_data + species = species_data.id.to_s + form = "_" + $~[1].to_s if name[/_(\d+)/] + female = "_female" if name[/f/] + shadow = "_shadow" if name[/_shadow/] + if name[/egg/] + (default_prefix == "") ? prefix = "Eggs/" : crack = "_egg" + crack = "_cracks" if name[/eggCracks/] + end + end + return prefix + species + form + female + shadow + crack + ((extension) ? "." + extension : ".png") + end + + def convert_pokemon_sprites(src_dir, dest_dir) + return if !FileTest.directory?(src_dir) + # generates a list of all graphic files + files = readDirectoryFiles(src_dir, ["*.png", "*.gif"]) + # starts automatic renaming + files.each_with_index do |file, i| + Graphics.update if i % 100 == 0 + pbSetWindowText(_INTL("Converting Pokémon sprites {1}/{2}...", i, files.length)) if i % 50 == 0 + case file + when "battlers.png" + File.delete(src_dir + file) + when "egg.png" + File.move(src_dir + file, dest_dir + "Eggs/000.png") + when "eggCracks.png" + File.move(src_dir + file, dest_dir + "Eggs/000_cracks.png") + else + next if !file[/^\d{3}[^\.]*\.[^\.]*$/] + new_filename = convert_pokemon_filename(file) + # moves the files into their appropriate folders + File.move(src_dir + file, dest_dir + new_filename) + end + end + Dir.delete(src_dir) rescue nil + end + + def convert_pokemon_icons(src_dir, dest_dir) + return if !FileTest.directory?(src_dir) + # generates a list of all graphic files + files = readDirectoryFiles(src_dir, ["*.png", "*.gif"]) + # starts automatic renaming + files.each_with_index do |file, i| + Graphics.update if i % 100 == 0 + pbSetWindowText(_INTL("Converting Pokémon icons {1}/{2}...", i, files.length)) if i % 50 == 0 + case file + when "iconEgg.png" + File.move(src_dir + file, dest_dir + "Icons/000_egg.png") + else + next if !file[/^icon\d{3}[^\.]*\.[^\.]*$/] + new_filename = convert_pokemon_filename(file.sub(/^icon/, ''), "Icons/") + # moves the files into their appropriate folders + File.move(src_dir + file, dest_dir + new_filename) + end + end + end + + def convert_pokemon_footprints(src_dir, dest_dir) + return if !FileTest.directory?(src_dir) + # generates a list of all graphic files + files = readDirectoryFiles(src_dir, ["*.png", "*.gif"]) + # starts automatic renaming + files.each_with_index do |file, i| + Graphics.update if i % 100 == 0 + pbSetWindowText(_INTL("Converting footprints {1}/{2}...", i, files.length)) if i % 50 == 0 + next if !file[/^footprint\d{3}[^\.]*\.[^\.]*$/] + new_filename = convert_pokemon_filename(file.sub(/^footprint/, ''), "Footprints/") + # moves the files into their appropriate folders + File.move(src_dir + file, dest_dir + new_filename) + end + Dir.delete(src_dir) rescue nil + end + + def convert_item_icons(src_dir, dest_dir) + return if !FileTest.directory?(src_dir) + # generates a list of all graphic files + files = readDirectoryFiles(src_dir, ["*.png", "*.gif"]) + # starts automatic renaming + files.each_with_index do |file, i| + Graphics.update if i % 100 == 0 + pbSetWindowText(_INTL("Converting item icons {1}/{2}...", i, files.length)) if i % 50 == 0 + case file + when "item000.png" + File.move(src_dir + file, dest_dir + "000.png") + when "itemBack.png" + File.move(src_dir + file, dest_dir + "back.png") + else + if file[/^itemMachine(.+)\.([^\.]*)$/] + type = $~[1] + extension = $~[2] + File.move(src_dir + file, dest_dir + "machine_" + type + "." + extension) + elsif file[/^item(\d{3})[^\.]*\.([^\.]*)$/] + item_number = $~[1].to_i + extension = $~[2] + item_data = GameData::Item.try_get(item_number) + raise _INTL("Item {1} is not defined (trying to rename item icon {2}).", item_number, file) if !item_data + item = item_data.id.to_s + # moves the files into their appropriate folders + File.move(src_dir + file, dest_dir + item + "." + extension) + end + end + end + end + + def convert_pokemon_cries(src_dir) + return if !FileTest.directory?(src_dir) + # generates a list of all audio files + files = readDirectoryFiles(src_dir, ["*.wav", "*.mp3", "*.ogg"]) + # starts automatic renaming + files.each_with_index do |file, i| + Graphics.update if i % 100 == 0 + pbSetWindowText(_INTL("Converting Pokémon cries {1}/{2}...", i, files.length)) if i % 50 == 0 + if file[/^(\d{3})Cry[^\.]*\.([^\.]*)$/] + species_number = $~[1].to_i + extension = $~[2] + form = (file[/Cry_(\d+)\./]) ? sprintf("_%s", $~[1]) : "" + species_data = GameData::Species.try_get(species_number) + raise _INTL("Species {1} is not defined (trying to rename species cry {2}).", species_number, file) if !species_data + species = species_data.id.to_s + File.move(src_dir + file, src_dir + species + form + "." + extension) + end + end + end + + def convert_trainer_sprites(src_dir) + return if !FileTest.directory?(src_dir) + # generates a list of all graphic files + files = readDirectoryFiles(src_dir, ["*.png", "*.gif"]) + # starts automatic renaming + files.each_with_index do |file, i| + Graphics.update if i % 100 == 0 + pbSetWindowText(_INTL("Converting trainer sprites {1}/{2}...", i, files.length)) if i % 50 == 0 + if file[/^trainer(\d{3})\.([^\.]*)$/] + tr_type_number = $~[1].to_i + extension = $~[2] + tr_type_data = GameData::TrainerType.try_get(tr_type_number) + raise _INTL("Trainer type {1} is not defined (trying to rename trainer sprite {2}).", tr_type_number, file) if !tr_type_data + tr_type = tr_type_data.id.to_s + File.move(src_dir + file, src_dir + tr_type + "." + extension) + elsif file[/^trback(\d{3})\.([^\.]*)$/] + tr_type_number = $~[1].to_i + extension = $~[2] + tr_type_data = GameData::TrainerType.try_get(tr_type_number) + raise _INTL("Trainer type {1} is not defined (trying to rename trainer sprite {2}).", tr_type_number, file) if !tr_type_data + tr_type = tr_type_data.id.to_s + File.move(src_dir + file, src_dir + tr_type + "_back." + extension) + end + end + end + + def convert_files + return if !pbConfirmMessage("Do you want to check for Pokémon graphics/cries and item icons that need renaming?") + # Rename and move Pokémon sprites/icons + dest_dir = "Graphics/Pokemon/" + Dir.mkdir(dest_dir) if !FileTest.directory?(dest_dir) + for ext in ["Front/", "Back/", "Icons/", "Front shiny/", "Back shiny/", "Icons shiny/", + "Eggs/", "Footprints/", "Shadow/"] + Dir.mkdir(dest_dir + ext) if !FileTest.directory?(dest_dir + ext) + end + convert_pokemon_sprites("Graphics/Battlers/", dest_dir) + convert_pokemon_icons("Graphics/Icons/", dest_dir) + convert_pokemon_footprints("Graphics/Icons/Footprints/", dest_dir) + # Rename and move item icons + dest_dir = "Graphics/Items/" + Dir.mkdir(dest_dir) if !FileTest.directory?(dest_dir) + convert_item_icons("Graphics/Icons/", dest_dir) + # Rename Pokémon cries + convert_pokemon_cries("Audio/SE/Cries/") + # Rename trainer sprites + convert_trainer_sprites("Graphics/Trainers/") + pbSetWindowText(nil) + end +end diff --git a/Data/Scripts/999_Main/999_Main.rb b/Data/Scripts/999_Main/999_Main.rb index 6c9fcd5e2..0f09d5f00 100644 --- a/Data/Scripts/999_Main/999_Main.rb +++ b/Data/Scripts/999_Main/999_Main.rb @@ -1,6 +1,3 @@ -Compiler.main -pbSetUpSystem - class Scene_DebugIntro def main Graphics.transition(0) @@ -13,10 +10,9 @@ end def pbCallTitle return Scene_DebugIntro.new if $DEBUG - # First parameter is an array of images in the Titles - # directory without a file extension, to show before the - # actual title screen. Second parameter is the actual - # title screen filename, also in Titles with no extension. + # First parameter is an array of images in the Titles directory without a file + # extension, to show before the actual title screen. Second parameter is the + # actual title screen filename, also in Titles with no extension. return Scene_Intro.new(['intro1'], 'splash') end @@ -31,9 +27,8 @@ end def mainFunctionDebug begin - getCurrentProcess = Win32API.new("kernel32.dll", "GetCurrentProcess", "", "l") - setPriorityClass = Win32API.new("kernel32.dll", "SetPriorityClass", %w(l i), "") - setPriorityClass.call(getCurrentProcess.call(), 32768) # "Above normal" priority class + Compiler.main + pbSetUpSystem $data_animations = pbLoadRxData("Data/Animations") $data_tilesets = pbLoadRxData("Data/Tilesets") $data_common_events = pbLoadRxData("Data/CommonEvents")