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 99e66525b..d8495da22 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/Map734.rxdata b/Data/Map734.rxdata index de63376c3..9e4406800 100644 Binary files a/Data/Map734.rxdata and b/Data/Map734.rxdata differ diff --git a/Data/Map787.rxdata b/Data/Map787.rxdata index 83832a194..8345d1351 100644 Binary files a/Data/Map787.rxdata and b/Data/Map787.rxdata differ diff --git a/Data/MapInfos.rxdata b/Data/MapInfos.rxdata index 6e22fd624..5691b0e62 100644 Binary files a/Data/MapInfos.rxdata and b/Data/MapInfos.rxdata differ diff --git a/Data/Scripts/018_Alternate battle modes/001_Battle Frontier/002_Challenge_Data.rb b/Data/Scripts/018_Alternate battle modes/001_Battle Frontier/002_Challenge_Data.rb index d6c56b10f..e71ccc7ce 100644 --- a/Data/Scripts/018_Alternate battle modes/001_Battle Frontier/002_Challenge_Data.rb +++ b/Data/Scripts/018_Alternate battle modes/001_Battle Frontier/002_Challenge_Data.rb @@ -36,7 +36,8 @@ end def pbGetBTPokemon(challenge_id) customsOnly = !$game_switches[SWITCH_BATTLE_FACTORY_INCLUDE_ALL] if customsOnly - return getCustomSpeciesList() + customsList = getCustomSpeciesList() + return customsList if customsList end return listAllPokemon diff --git a/Data/Scripts/050_AddOns/GeneralUtils.rb b/Data/Scripts/050_AddOns/GeneralUtils.rb index f17b30b5d..d466e3e4c 100644 --- a/Data/Scripts/050_AddOns/GeneralUtils.rb +++ b/Data/Scripts/050_AddOns/GeneralUtils.rb @@ -406,7 +406,7 @@ def customSpriteExists(species) return download_custom_sprite(head, body) != nil end -def customSpriteExistsBase(head,body) +def customSpriteExistsBase(body,head) pathCustom = getCustomSpritePath(body,head) return true if pbResolveBitmap(pathCustom) != nil return download_custom_sprite(head, body) != nil diff --git a/Data/Scripts/050_AddOns/HttpCalls.rb b/Data/Scripts/050_AddOns/HttpCalls.rb index f468588b2..f2a07f3a5 100644 --- a/Data/Scripts/050_AddOns/HttpCalls.rb +++ b/Data/Scripts/050_AddOns/HttpCalls.rb @@ -12,10 +12,9 @@ def downloadCustomSprite(head_id,body_id) end -def download_sprite(base_path, head_id, body_id) +def download_sprite(base_path, head_id, body_id, saveLocation="Graphics/temp") begin - temp_sprites_folder = "Graphics/temp" - downloaded_file_name = _INTL("{1}/{2}.{3}.png",temp_sprites_folder,head_id,body_id) + downloaded_file_name = _INTL("{1}/{2}.{3}.png",saveLocation,head_id,body_id) return downloaded_file_name if pbResolveBitmap(downloaded_file_name) url = _INTL(base_path,head_id,body_id) response = HTTPLite.get(url) @@ -23,6 +22,7 @@ def download_sprite(base_path, head_id, body_id) File.open(downloaded_file_name, "wb") do |file| file.write(response[:body]) end + echo _INTL("\nDownloaded file {1} to {2}",downloaded_file_name,saveLocation) return downloaded_file_name end return nil @@ -33,8 +33,9 @@ end def download_autogen_sprite(head_id, body_id) return nil if $PokemonSystem.download_sprites != 0 - base_path = "https://raw.githubusercontent.com/Aegide/autogen-fusion-sprites/master/Battlers/{1}/{1}.{2}.png" - sprite = download_sprite(_INTL(base_path,head_id,body_id),head_id,body_id) + url = "https://raw.githubusercontent.com/Aegide/autogen-fusion-sprites/master/Battlers/{1}/{1}.{2}.png" + destPath = _INTL("{1}/{2}",Settings::BATTLERS_FOLDER,head_id) + sprite = download_sprite(_INTL(url,head_id,body_id),head_id,body_id,destPath) return sprite if sprite return nil end @@ -42,8 +43,9 @@ end def download_custom_sprite(head_id, body_id) return nil if $PokemonSystem.download_sprites != 0 #base_path = "https://raw.githubusercontent.com/Aegide/custom-fusion-sprites/main/CustomBattlers/{1}.{2}.png" - base_path = "https://raw.githubusercontent.com/infinitefusion/sprites/main/CustomBattlers/{1}.{2}.png" - sprite = download_sprite(_INTL(base_path,head_id,body_id),head_id,body_id) + url = "https://raw.githubusercontent.com/infinitefusion/sprites/main/CustomBattlers/{1}.{2}.png" + destPath= _INTL("{1}/{2}",Settings::CUSTOM_BATTLERS_FOLDER_INDEXED,head_id) + sprite = download_sprite(_INTL(url,head_id,body_id),head_id,body_id,destPath) return sprite if sprite return nil end @@ -52,13 +54,14 @@ end # https://api.github.com/repos/infinitefusion/contents/sprites/CustomBattlers # repo = "Aegide/custom-fusion-sprites" # folder = "CustomBattlers" +# +# todo: github api returns a maximum of 1000 files. Need to find workaround. +# Possibly using git trees https://docs.github.com/fr/rest/git/trees?apiVersion=2022-11-28#get-a-tree def list_online_custom_sprites - # repo = "infinitefusion/sprites" - # folder = "CustomBattlers" - - repo = "Aegide/custom-fusion-sprites" - folder = "CustomBattlers" - api_url = "https://api.github.com/repos/#{repo}/contents/#{folder}" - response = HTTPLite.get(api_url) - return HTTPLite::JSON.parse(response[:body]).map { |file| file['name'] } + return nil + # repo = "infinitefusion/sprites" + # folder = "CustomBattlers" + # api_url = "https://api.github.com/repos/#{repo}/contents/#{folder}" + # response = HTTPLite.get(api_url) + # return HTTPLite::JSON.parse(response[:body]).map { |file| file['name'] } end \ No newline at end of file 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 130b38a5a..d1ab786b2 100644 Binary files a/Data/System.rxdata and b/Data/System.rxdata differ diff --git a/Data/Tilesets.rxdata b/Data/Tilesets.rxdata index acaa59516..ec292660a 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