From cca1e0bd62e7824a3d08287296be7363732390a3 Mon Sep 17 00:00:00 2001 From: infinitefusion Date: Sat, 13 Apr 2024 13:49:49 -0400 Subject: [PATCH] Automatically downloads updated dex entries from repo --- Data/Scripts/050_AddOns/HttpCalls.rb | 5 +++++ Data/Scripts/050_AddOns/MultiSaves.rb | 1 + Data/Scripts/DownloadedSettings.rb | 1 + 3 files changed, 7 insertions(+) diff --git a/Data/Scripts/050_AddOns/HttpCalls.rb b/Data/Scripts/050_AddOns/HttpCalls.rb index a412dc01f..8fb102aa1 100644 --- a/Data/Scripts/050_AddOns/HttpCalls.rb +++ b/Data/Scripts/050_AddOns/HttpCalls.rb @@ -16,6 +16,11 @@ def updateCreditsFile download_file(Settings::CREDITS_FILE_URL, Settings::CREDITS_FILE_PATH,) end +def updateCustomDexFile + return if $PokemonSystem.download_sprites != 0 + download_file(Settings::CUSTOM_DEX_FILE_URL, Settings::CUSTOM_DEX_ENTRIES_PATH,) +end + def createCustomSpriteFolders() if !Dir.exist?(Settings::CUSTOM_BATTLERS_FOLDER) Dir.mkdir(Settings::CUSTOM_BATTLERS_FOLDER) diff --git a/Data/Scripts/050_AddOns/MultiSaves.rb b/Data/Scripts/050_AddOns/MultiSaves.rb index 75504fc58..082882bac 100644 --- a/Data/Scripts/050_AddOns/MultiSaves.rb +++ b/Data/Scripts/050_AddOns/MultiSaves.rb @@ -336,6 +336,7 @@ class PokemonLoadScreen def pbStartLoadScreen updateHttpSettingsFile updateCreditsFile + updateCustomDexFile newer_version = find_newer_available_version if newer_version pbMessage(_INTL("Version {1} is now available! Please use the game's installer to download the newest version. Check the Discord for more information.", newer_version)) diff --git a/Data/Scripts/DownloadedSettings.rb b/Data/Scripts/DownloadedSettings.rb index 57f5b3892..3ebcec190 100644 --- a/Data/Scripts/DownloadedSettings.rb +++ b/Data/Scripts/DownloadedSettings.rb @@ -4,6 +4,7 @@ module Settings CREDITS_FILE_URL = "https://gitlab.com/pokemoninfinitefusion/customsprites/-/raw/master/Sprite Credits.csv" SPRITES_FILE_URL = "https://raw.githubusercontent.com/infinitefusion/infinitefusion-e18/main/Data/CUSTOM_SPRITES" VERSION_FILE_URL = "https://raw.githubusercontent.com/infinitefusion/infinitefusion-e18/main/Data/VERSION" + CUSTOM_DEX_FILE_URL = "https://raw.githubusercontent.com/infinitefusion/infinitefusion-e18/main/Data/dex.json" AUTOGEN_SPRITES_REPO_URL = "https://gitlab.com/pokemoninfinitefusion/autogen-fusion-sprites/-/raw/master/Battlers/" CUSTOM_SPRITES_REPO_URL = "https://gitlab.com/pokemoninfinitefusion/customsprites/-/raw/master/CustomBattlers/"