mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2026-01-21 21:56:01 +00:00
Fixes sprites not being downloaded before form change
This commit is contained in:
@@ -298,7 +298,7 @@ def get_fusion_sprite_path(head_id, body_id, spriteform_body = nil, spriteform_h
|
||||
return local_generated_path if pbResolveBitmap(local_generated_path)
|
||||
|
||||
#Download generated sprite if nothing else found
|
||||
autogen_path = download_autogen_sprite(head_id, body_id)
|
||||
autogen_path = download_autogen_sprite(head_id, body_id,spriteform_body,spriteform_head)
|
||||
return autogen_path if pbResolveBitmap(autogen_path)
|
||||
|
||||
return Settings::DEFAULT_SPRITE_PATH
|
||||
|
||||
@@ -480,7 +480,6 @@ def customSpriteExistsForm(species,form_id_head=nil, form_id_body=nil)
|
||||
spritename += "_" + form_id_body.to_s if form_id_body
|
||||
|
||||
pathCustom = _INTL("Graphics/CustomBattlers/indexed/{1}/{2}.png", folder, spritename)
|
||||
|
||||
return true if pbResolveBitmap(pathCustom) != nil
|
||||
return download_custom_sprite(head, body,form_id_head,form_id_body) != nil
|
||||
end
|
||||
|
||||
@@ -81,11 +81,16 @@ def download_sprite(base_path, head_id, body_id, saveLocation = "Graphics/temp",
|
||||
end
|
||||
end
|
||||
|
||||
def download_autogen_sprite(head_id, body_id)
|
||||
def download_autogen_sprite(head_id, body_id,spriteformBody_suffix=nil,spriteformHead_suffix=nil)
|
||||
return nil if $PokemonSystem.download_sprites != 0
|
||||
url = Settings::AUTOGEN_SPRITES_REPO_URL + "{1}/{1}.{2}.png"
|
||||
template_url = Settings::AUTOGEN_SPRITES_REPO_URL + "{1}/{1}.{2}.png"
|
||||
|
||||
head_id = (head_id.to_s) + "_" + spriteformHead_suffix.to_s if spriteformHead_suffix
|
||||
body_id = (body_id.to_s) + "_" + spriteformBody_suffix.to_s if spriteformBody_suffix
|
||||
|
||||
destPath = _INTL("{1}{2}", Settings::BATTLERS_FOLDER, head_id)
|
||||
sprite = download_sprite(_INTL(url, head_id, body_id), head_id, body_id, destPath)
|
||||
url = _INTL(template_url, head_id, body_id)
|
||||
sprite = download_sprite(url, head_id, body_id, destPath)
|
||||
return sprite if sprite
|
||||
return nil
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user