mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Adds art gallery
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
|
||||
def test_http_get
|
||||
url = "http://localhost:8080"
|
||||
response = HTTPLite.get(url)
|
||||
@@ -7,35 +6,55 @@ def test_http_get
|
||||
end
|
||||
end
|
||||
|
||||
def downloadCustomSprite(head_id,body_id)
|
||||
base_custom_path = "https://raw.githubusercontent.com/Aegide/custom-fusion-sprites/main/CustomBattlers/{1}.{2}.png"
|
||||
|
||||
def downloadCustomSprite(head_id, body_id)
|
||||
base_custom_path = "https://raw.githubusercontent.com/infinitefusion/sprites/main/Sprite%20Credits.csv"
|
||||
end
|
||||
|
||||
def download_sprite(base_path, head_id, body_id, saveLocation="Graphics/temp")
|
||||
def updateCreditsFile
|
||||
return if $PokemonSystem.download_sprites != 0
|
||||
download_file(Settings::CREDITS_FILE_URL,Settings::CREDITS_FILE_PATH,)
|
||||
end
|
||||
|
||||
def download_file(url, saveLocation)
|
||||
begin
|
||||
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)
|
||||
if response[:status] == 200
|
||||
File.open(downloaded_file_name, "wb") do |file|
|
||||
file.write(response[:body])
|
||||
response = HTTPLite.get(url)
|
||||
if response[:status] == 200
|
||||
File.open(saveLocation, "wb") do |file|
|
||||
file.write(response[:body])
|
||||
end
|
||||
echo _INTL("\nDownloaded file {1} to {2}", url, saveLocation)
|
||||
return saveLocation
|
||||
end
|
||||
echo _INTL("\nDownloaded file {1} to {2}",downloaded_file_name,saveLocation)
|
||||
return downloaded_file_name
|
||||
end
|
||||
return nil
|
||||
return nil
|
||||
rescue MKXPError
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
def download_sprite(base_path, head_id, body_id, saveLocation = "Graphics/temp")
|
||||
begin
|
||||
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)
|
||||
if response[:status] == 200
|
||||
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
|
||||
rescue MKXPError
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
def download_autogen_sprite(head_id, body_id)
|
||||
return nil if $PokemonSystem.download_sprites != 0
|
||||
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)
|
||||
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
|
||||
@@ -44,8 +63,8 @@ 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"
|
||||
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)
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user