diff --git a/Data/Actors.rxdata b/Data/Actors.rxdata index 41edc8e26..7967a5432 100644 Binary files a/Data/Actors.rxdata and b/Data/Actors.rxdata differ diff --git a/Data/Animations.rxdata b/Data/Animations.rxdata index 826e1e8a6..8e67182ba 100644 Binary files a/Data/Animations.rxdata and b/Data/Animations.rxdata differ diff --git a/Data/Armors.rxdata b/Data/Armors.rxdata index 901f2bb2b..2249bec14 100644 Binary files a/Data/Armors.rxdata and b/Data/Armors.rxdata differ diff --git a/Data/CommonEvents.rxdata b/Data/CommonEvents.rxdata index d9768a4e2..600ac79c8 100644 Binary files a/Data/CommonEvents.rxdata and b/Data/CommonEvents.rxdata differ diff --git a/Data/Enemies.rxdata b/Data/Enemies.rxdata index be622f513..004ee903d 100644 Binary files a/Data/Enemies.rxdata and b/Data/Enemies.rxdata differ diff --git a/Data/Items.rxdata b/Data/Items.rxdata index fe767fa0b..3e62ba6d2 100644 Binary files a/Data/Items.rxdata and b/Data/Items.rxdata differ diff --git a/Data/MapInfos.rxdata b/Data/MapInfos.rxdata index b3acb6b8d..398e1c619 100644 Binary files a/Data/MapInfos.rxdata and b/Data/MapInfos.rxdata differ diff --git a/Data/Scripts/001_Settings.rb b/Data/Scripts/001_Settings.rb index 4afb3ece7..2ae059958 100644 --- a/Data/Scripts/001_Settings.rb +++ b/Data/Scripts/001_Settings.rb @@ -25,7 +25,7 @@ module Settings CUSTOM_BATTLERS_FOLDER_INDEXED = "Graphics/CustomBattlers/indexed" BATTLERS_FOLDER = "Graphics/Battlers/" FRONTSPRITE_POSITION_OFFSET = 20 - FRONTSPRITE_SCALE = 0.6666666 + FRONTSPRITE_SCALE = 0.6666666666 BACKRPSPRITE_SCALE = 1 EGGSPRITE_SCALE = 1 BACKSPRITE_POSITION_OFFSET = 20 diff --git a/Data/Scripts/004_Game classes/001_Switches and Variables/001_Game_Temp.rb b/Data/Scripts/004_Game classes/001_Switches and Variables/001_Game_Temp.rb index 981a54638..197ae32a6 100644 --- a/Data/Scripts/004_Game classes/001_Switches and Variables/001_Game_Temp.rb +++ b/Data/Scripts/004_Game classes/001_Switches and Variables/001_Game_Temp.rb @@ -25,6 +25,7 @@ class Game_Temp attr_accessor :fadestate # for sprite hashes attr_accessor :background_bitmap attr_accessor :mart_prices + attr_accessor :unimportedSprites #----------------------------------------------------------------------------- # * Object Initialization #----------------------------------------------------------------------------- diff --git a/Data/Scripts/007_Objects and windows/011_Messages.rb b/Data/Scripts/007_Objects and windows/011_Messages.rb index 050963da8..85d44421b 100644 --- a/Data/Scripts/007_Objects and windows/011_Messages.rb +++ b/Data/Scripts/007_Objects and windows/011_Messages.rb @@ -908,7 +908,7 @@ end def pbShowCommands(msgwindow, commands = nil, cmdIfCancel = 0, defaultCmd = 0) return 0 if !commands - if defaultCmd == 0 && $game_variables[VAR_COMMAND_WINDOW_INDEX] != 0 + if defaultCmd == 0 && ($game_variables && $game_variables[VAR_COMMAND_WINDOW_INDEX] != 0) defaultCmd = $game_variables[VAR_COMMAND_WINDOW_INDEX] end cmdwindow = Window_CommandPokemonEx.new(commands) diff --git a/Data/Scripts/050_AddOns/MultiSaves.rb b/Data/Scripts/050_AddOns/MultiSaves.rb index d52e60226..632c56085 100644 --- a/Data/Scripts/050_AddOns/MultiSaves.rb +++ b/Data/Scripts/050_AddOns/MultiSaves.rb @@ -299,6 +299,9 @@ class PokemonLoadScreen end def pbStartLoadScreen + if($game_temp.unimportedSprites.size >0) + handleReplaceExistingSprites() + end copyKeybindings() save_file_list = SaveData::AUTO_SLOTS + SaveData::MANUAL_SLOTS first_time = true diff --git a/Data/Scripts/999_Main/999_Main.rb b/Data/Scripts/999_Main/999_Main.rb index d32eb87b9..331f33a2d 100644 --- a/Data/Scripts/999_Main/999_Main.rb +++ b/Data/Scripts/999_Main/999_Main.rb @@ -8,6 +8,37 @@ class Scene_DebugIntro end end +def handleReplaceExistingSprites() + spritesToReplaceList= $game_temp.unimportedSprites + $game_temp.unimportedSprites=nil + return if spritesToReplaceList.size==0 + commands = [] + #commands << "Pick which sprites to use as mains" + commands << "Replace all the old sprites with the new ones" + #commands << "Import all the new sprites as alts" + commands << "Do not import the new sprites" + + messageSingular = "While importing custom sprites, the game has detected that {1} new custom sprite already has a version that exist in the game." + messagePlural = "While importing custom sprites, the game has detected that {1} new custom sprites already have versions that exist in the game." + + messageText = spritesToReplaceList.size==1 ? messageSingular : messagePlural + message = _INTL(messageText,spritesToReplaceList.length.to_s) + pbMessage(message) + + command = pbMessage("What to do with the new sprites?",commands,commands.size-1) + case command + when 0 #Replace olds + spritesToReplaceList.each do |oldPath, newPath| + File.rename(oldPath, newPath) + echo "\nSorted " + oldPath + " into " + newPath + end + #when 1 #Keep olds (rename new as alts) + when 1 #Do not import + pbMessage("You can manually sort the new sprites in the /indexed folder to choose which ones you want to keep.") + return + end +end + def pbCallTitle return Scene_DebugIntro.new if $DEBUG return Scene_Intro.new @@ -22,8 +53,11 @@ def mainFunction return 1 end + + def sortCustomBattlers() echo "Sorting CustomBattlers files..." + alreadyExists = {} Dir.foreach(Settings::CUSTOM_BATTLERS_FOLDER) do |filename| next if filename == '.' or filename == '..' next if !filename.end_with?(".png") @@ -31,19 +65,25 @@ def sortCustomBattlers() oldPath = Settings::CUSTOM_BATTLERS_FOLDER + "/" + filename newPath = Settings::CUSTOM_BATTLERS_FOLDER_INDEXED + "/" + headNum.to_s + "/" +filename begin - File.rename(oldPath, newPath) - echo "\nSorted " + filename + " into " + newPath + if File.file?(newPath) + alreadyExists[oldPath] = newPath + echo "\nFile " + newPath + " already exists... Skipping." + + else + File.rename(oldPath, newPath) + echo "\nSorted " + filename + " into " + newPath + end rescue echo "\nCould not sort "+ filename end end echo "\nFinished sorting" + $game_temp.unimportedSprites=alreadyExists end def mainFunctionDebug begin - sortCustomBattlers() MessageTypes.loadMessageFile("Data/messages.dat") if safeExists?("Data/messages.dat") PluginManager.runPlugins Compiler.main @@ -51,6 +91,8 @@ def mainFunctionDebug Game.set_up_system Graphics.update Graphics.freeze + sortCustomBattlers() + $scene = pbCallTitle $scene.main until $scene.nil? Graphics.transition(20) diff --git a/Data/Skills.rxdata b/Data/Skills.rxdata index a45219f5e..61cba7ea2 100644 Binary files a/Data/Skills.rxdata and b/Data/Skills.rxdata differ diff --git a/Data/States.rxdata b/Data/States.rxdata index 868d49e59..0f9b4ae5d 100644 Binary files a/Data/States.rxdata and b/Data/States.rxdata differ diff --git a/Data/System.rxdata b/Data/System.rxdata index fc4d06d08..d9db424a6 100644 Binary files a/Data/System.rxdata and b/Data/System.rxdata differ diff --git a/Data/Tilesets.rxdata b/Data/Tilesets.rxdata index a7e9f4cf9..256e9df71 100644 Binary files a/Data/Tilesets.rxdata and b/Data/Tilesets.rxdata differ diff --git a/Data/Weapons.rxdata b/Data/Weapons.rxdata index c7ea19a7a..d9bd35260 100644 Binary files a/Data/Weapons.rxdata and b/Data/Weapons.rxdata differ