sprites download fixes

This commit is contained in:
chardub
2023-02-04 16:11:05 -05:00
parent a53b9a4687
commit 80543cb31a
17 changed files with 17 additions and 5 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -419,10 +419,7 @@ def getCustomSpeciesList(allowOnline=true)
for i in 0..maxVal
path = filesList[i]
file = File.basename(path, ".*")
splitPoke = file.split(".")
head = splitPoke[0].to_i
body = splitPoke[1].to_i
fused = (body * NB_POKEMON) + head
fused = getDexNumFromFilename(file)
if fused <= maxDexNumber && fused > 0
speciesList << fused
end
@@ -435,12 +432,26 @@ def getCustomSpeciesList(allowOnline=true)
#try to get list from github
print "let's try it online bruh"
online_list = list_online_custom_sprites
return online_list if online_list !=nil
return nil if !online_list
species_id_list = []
for file in online_list
species_id_list << getDexNumFromFilename(file)
end
return species_id_list
end
return speciesList
end
#input: ex: 10.10.png
def getDexNumFromFilename(filename)
splitPoke = filename.split(".")
head = splitPoke[0].to_i
body = splitPoke[1].to_i
return (body * NB_POKEMON) + head
end
# def getCustomSpeciesList()
# filesList = Dir["./Graphics/CustomBattlers/*"]
# maxDexNumber = (NB_POKEMON * NB_POKEMON) + NB_POKEMON

View File

@@ -45,6 +45,7 @@ def download_custom_sprite(head_id, body_id)
return nil
end
#format: [1.1.png, 1.2.png, etc.]
def list_online_custom_sprites
repo = "Aegide/custom-fusion-sprites"
folder = "CustomBattlers"

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.