creates customBattlers folder if missing

This commit is contained in:
infinitefusion
2023-07-15 17:33:36 -04:00
parent 9106833a9d
commit ba6b1b47d4
2 changed files with 10 additions and 1 deletions

View File

@@ -11,6 +11,15 @@ def updateCreditsFile
download_file(Settings::CREDITS_FILE_URL,Settings::CREDITS_FILE_PATH,) download_file(Settings::CREDITS_FILE_URL,Settings::CREDITS_FILE_PATH,)
end end
def createCustomSpriteFolders()
if !Dir.exist?(Settings::CUSTOM_BATTLERS_FOLDER)
Dir.mkdir(Settings::CUSTOM_BATTLERS_FOLDER)
end
if !Dir.exist?(Settings::CUSTOM_BATTLERS_FOLDER_INDEXED)
Dir.mkdir(Settings::CUSTOM_BATTLERS_FOLDER_INDEXED)
end
end
def download_file(url, saveLocation) def download_file(url, saveLocation)
begin begin
response = HTTPLite.get(url) response = HTTPLite.get(url)
@@ -72,7 +81,6 @@ end
def download_custom_sprite(head_id, body_id) def download_custom_sprite(head_id, body_id)
return nil if $PokemonSystem.download_sprites != 0 return nil if $PokemonSystem.download_sprites != 0
#base_path = "https://raw.githubusercontent.com/Aegide/custom-fusion-sprites/main/CustomBattlers/{1}.{2}.png"
url = "https://raw.githubusercontent.com/infinitefusion/sprites/main/CustomBattlers/{1}.{2}.png" url = "https://raw.githubusercontent.com/infinitefusion/sprites/main/CustomBattlers/{1}.{2}.png"
destPath = _INTL("{1}{2}", Settings::CUSTOM_BATTLERS_FOLDER_INDEXED, head_id) destPath = _INTL("{1}{2}", Settings::CUSTOM_BATTLERS_FOLDER_INDEXED, head_id)
if !Dir.exist?(destPath) if !Dir.exist?(destPath)

View File

@@ -144,6 +144,7 @@ def mainFunctionDebug
Graphics.update Graphics.update
Graphics.freeze Graphics.freeze
#clearTempFolder() #clearTempFolder()
createCustomSpriteFolders()
begin begin
sortCustomBattlers() sortCustomBattlers()
rescue rescue