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

View File

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

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.