From d941ae48e9c98508fdc3fee19de3f8a52df30d91 Mon Sep 17 00:00:00 2001 From: infinitefusion Date: Mon, 13 Nov 2023 21:13:55 -0500 Subject: [PATCH] create missing directories when importing new custom sprites --- Data/Scripts/999_Main/999_Main.rb | 6 ++++-- Data/System.rxdata | Bin 28411 -> 28411 bytes 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Data/Scripts/999_Main/999_Main.rb b/Data/Scripts/999_Main/999_Main.rb index 4020112a8..b574a6217 100644 --- a/Data/Scripts/999_Main/999_Main.rb +++ b/Data/Scripts/999_Main/999_Main.rb @@ -75,14 +75,16 @@ def sortCustomBattlers() next if !filename.end_with?(".png") headNum = filename.split('.')[0] oldPath = Settings::CUSTOM_BATTLERS_FOLDER + filename - newPath = Settings::CUSTOM_BATTLERS_FOLDER_INDEXED + headNum.to_s + "/" + filename + newDir = Settings::CUSTOM_BATTLERS_FOLDER_INDEXED + headNum.to_s + newPath = newDir + "/" + filename begin if File.file?(newPath) alreadyExists[oldPath] = newPath echo "\nFile " + newPath + " already exists... Skipping." else - File.rename(oldPath, newPath) + Dir.mkdir(newDir) if !Dir.exist?(newDir) + File.rename(oldPath, newPath) $game_temp.nb_imported_sprites+=1 echo "\nSorted " + filename + " into " + newPath end diff --git a/Data/System.rxdata b/Data/System.rxdata index 611de1b389e6e455e6b3759fef910519b3b1e987..335c0093cfa27310c70c74b3ed4754a4d0510710 100644 GIT binary patch delta 19 bcmex;m+|*q#tm+gEPJw*88>@LZVUwgUJD2< delta 19 bcmex;m+|*q#tm+gEFAkEF>m&g+!zV~Uz`Yz