down;oad & switch base pokemon alt sprites

This commit is contained in:
infinitefusion
2023-05-10 21:01:50 -04:00
parent c022e95bca
commit 147b264f42
20 changed files with 64 additions and 19 deletions

1
.~lock.music_export.csv# Normal file
View File

@@ -0,0 +1 @@
Charles Dubois,DESKTOP-U5METSR/charl,DESKTOP-U5METSR,10.05.2023 20:13,file:///C:/Users/charl/AppData/Roaming/OpenOffice/4;

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

@@ -6,7 +6,7 @@
module Settings module Settings
# The version of your game. It has to adhere to the MAJOR.MINOR.PATCH format. # The version of your game. It has to adhere to the MAJOR.MINOR.PATCH format.
GAME_VERSION = '5.0.0' GAME_VERSION = '5.0.0'
GAME_VERSION_NUMBER = "5.2.0" GAME_VERSION_NUMBER = "5.2.1"
POKERADAR_LIGHT_ANIMATION_RED_ID = 17 POKERADAR_LIGHT_ANIMATION_RED_ID = 17
POKERADAR_LIGHT_ANIMATION_GREEN_ID = 18 POKERADAR_LIGHT_ANIMATION_GREEN_ID = 18
@@ -21,6 +21,7 @@ module Settings
#Infinite fusion settings #Infinite fusion settings
NB_POKEMON = 420 NB_POKEMON = 420
CUSTOM_BASE_SPRITES_FOLDER = "Graphics/CustomBattlers/customBaseSprites/"
CUSTOM_BATTLERS_FOLDER = "Graphics/CustomBattlers/" CUSTOM_BATTLERS_FOLDER = "Graphics/CustomBattlers/"
CUSTOM_BATTLERS_FOLDER_INDEXED = "Graphics/CustomBattlers/indexed/" CUSTOM_BATTLERS_FOLDER_INDEXED = "Graphics/CustomBattlers/indexed/"
BATTLERS_FOLDER = "Graphics/Battlers/" BATTLERS_FOLDER = "Graphics/Battlers/"

View File

@@ -194,6 +194,10 @@ def get_unfused_sprite_path(dex_number)
folder = dex_number.to_s folder = dex_number.to_s
filename = sprintf("%s.png", dex_number) filename = sprintf("%s.png", dex_number)
if alt_sprites_substitutions_available && $PokemonGlobal.alt_sprite_substitutions.keys.include?(dex_number)
return $PokemonGlobal.alt_sprite_substitutions[dex_number]
end
normal_path = Settings::BATTLERS_FOLDER + folder + "/" + filename normal_path = Settings::BATTLERS_FOLDER + folder + "/" + filename
lightmode_path = Settings::BATTLERS_FOLDER + filename lightmode_path = Settings::BATTLERS_FOLDER + filename
return normal_path if pbResolveBitmap(normal_path) return normal_path if pbResolveBitmap(normal_path)

View File

@@ -38,9 +38,15 @@ end
def download_sprite(base_path, head_id, body_id, saveLocation = "Graphics/temp", alt_letter= "") def download_sprite(base_path, head_id, body_id, saveLocation = "Graphics/temp", alt_letter= "")
begin begin
downloaded_file_name = _INTL("{1}/{2}.{3}{4}.png", saveLocation, head_id, body_id,alt_letter) downloaded_file_name = _INTL("{1}/{2}.{3}{4}.png", saveLocation, head_id, body_id,alt_letter)
if !body_id
downloaded_file_name = _INTL("{1}/{2}{3}.png", saveLocation, head_id,alt_letter)
end
return downloaded_file_name if pbResolveBitmap(downloaded_file_name) return downloaded_file_name if pbResolveBitmap(downloaded_file_name)
url = _INTL(base_path, head_id, body_id) url = _INTL(base_path, head_id, body_id)
#echo "\nSending request to " + url if !body_id
url = _INTL(base_path, head_id)
end
response = HTTPLite.get(url) response = HTTPLite.get(url)
if response[:status] == 200 if response[:status] == 200
File.open(downloaded_file_name, "wb") do |file| File.open(downloaded_file_name, "wb") do |file|
@@ -78,6 +84,24 @@ def download_custom_sprite(head_id, body_id)
return nil return nil
end end
def download_unfused_alt_sprites(dex_num)
base_url = "https://raw.githubusercontent.com/infinitefusion/sprites/main/Other/Alternate%20Base%20Sprites/{1}"
extension = ".png"
destPath = _INTL("{1}", Settings::CUSTOM_BASE_SPRITES_FOLDER)
if !Dir.exist?(destPath)
Dir.mkdir(destPath)
end
alt_url = _INTL(base_url,dex_num) + extension
download_sprite(alt_url, dex_num,nil, destPath )
alphabet = ('a'..'z').to_a
alphabet.each do |letter|
alt_url = _INTL(base_url,dex_num) + letter + extension
sprite = download_sprite(alt_url, dex_num,nil, destPath, letter)
return if !sprite
end
end
def download_alt_sprites(head_id,body_id) def download_alt_sprites(head_id,body_id)
base_url = "https://raw.githubusercontent.com/infinitefusion/sprites/main/CustomBattlers/{1}.{2}" base_url = "https://raw.githubusercontent.com/infinitefusion/sprites/main/CustomBattlers/{1}.{2}"
extension = ".png" extension = ".png"

View File

@@ -1,5 +1,6 @@
class PokedexUtils class PokedexUtils
POSSIBLE_ALTS = %w[a b c d e f g h i j k x] POSSIBLE_ALTS = ["", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q",
"r", "s", "t", "u", "v", "w", "x", "y", "z"]
def pbGetAvailableAlts(species) def pbGetAvailableAlts(species)
ret = [] ret = []
@@ -8,6 +9,14 @@ class PokedexUtils
isFusion = dexNum > NB_POKEMON isFusion = dexNum > NB_POKEMON
if !isFusion if !isFusion
ret << Settings::BATTLERS_FOLDER + dexNum.to_s + "/" + dexNum.to_s + ".png" ret << Settings::BATTLERS_FOLDER + dexNum.to_s + "/" + dexNum.to_s + ".png"
POSSIBLE_ALTS.each { |alt_letter|
altFilePath = Settings::CUSTOM_BASE_SPRITES_FOLDER + dexNum.to_s + alt_letter + ".png"
if pbResolveBitmap(altFilePath)
ret << altFilePath
end
}
return ret return ret
end end
body_id = getBodyID(species) body_id = getBodyID(species)
@@ -19,16 +28,17 @@ class PokedexUtils
ret << baseFilePath ret << baseFilePath
end end
POSSIBLE_ALTS.each { |alt_letter| POSSIBLE_ALTS.each { |alt_letter|
if alt_letter != "" #empty is included in alt letters because unfused sprites can be alts and not have a letter
altFilePath = Settings::CUSTOM_BATTLERS_FOLDER_INDEXED + head_id.to_s + "/" + baseFilename + alt_letter + ".png" altFilePath = Settings::CUSTOM_BATTLERS_FOLDER_INDEXED + head_id.to_s + "/" + baseFilename + alt_letter + ".png"
if pbResolveBitmap(altFilePath) if pbResolveBitmap(altFilePath)
ret << altFilePath ret << altFilePath
end end
end
} }
ret << Settings::BATTLERS_FOLDER + head_id.to_s + "/" + baseFilename + ".png" ret << Settings::BATTLERS_FOLDER + head_id.to_s + "/" + baseFilename + ".png"
return ret return ret
end end
#todo: return array for split evolution lines that have multiple final evos #todo: return array for split evolution lines that have multiple final evos
def getFinalEvolution(species) def getFinalEvolution(species)
#ex: [[B3H4,Level 32],[B2H5, Level 35]] #ex: [[B3H4,Level 32],[B2H5, Level 35]]

View File

@@ -95,11 +95,17 @@ class PokemonPokedexInfo_Scene
end end
def pbGetAvailableForms def pbGetAvailableForms
dex_num = getDexNumberForSpecies(@species)
if dex_num <= NB_POKEMON
download_unfused_alt_sprites(dex_num)
else
body_id = getBodyID(@species) body_id = getBodyID(@species)
head_id = getHeadID(@species, body_id) head_id = getHeadID(@species, body_id)
download_custom_sprite(head_id, body_id) download_custom_sprite(head_id, body_id)
download_autogen_sprite(head_id, body_id) download_autogen_sprite(head_id, body_id)
download_alt_sprites(head_id, body_id) download_alt_sprites(head_id, body_id)
end
return PokedexUtils.new.pbGetAvailableAlts(@species) return PokedexUtils.new.pbGetAvailableAlts(@species)
end end
@@ -137,12 +143,13 @@ class PokemonPokedexInfo_Scene
@sprites["nextSprite"].setBitmap(@available[nextIndex]) @sprites["nextSprite"].setBitmap(@available[nextIndex])
selected_bitmap = @sprites["selectedSprite"].getBitmap selected_bitmap = @sprites["selectedSprite"].getBitmap
is_generated = !selected_bitmap.path.include?(Settings::CUSTOM_BATTLERS_FOLDER_INDEXED) sprite_path = selected_bitmap.path
showSpriteCredits(selected_bitmap.filename,is_generated) is_generated = sprite_path.start_with?(Settings::BATTLERS_FOLDER)
showSpriteCredits(selected_bitmap.filename, is_generated)
update_selected update_selected
end end
def showSpriteCredits(filename,generated_sprite=false) def showSpriteCredits(filename, generated_sprite = false)
@creditsOverlay.dispose @creditsOverlay.dispose
x = Graphics.width / 2 - 75 x = Graphics.width / 2 - 75
@@ -154,7 +161,7 @@ class PokemonPokedexInfo_Scene
discord_name = "Unknown artist" if !discord_name discord_name = "Unknown artist" if !discord_name
else else
#todo give credits to Japeal - need to differenciate unfused sprites #todo give credits to Japeal - need to differenciate unfused sprites
discord_name = ""#"Japeal\n(Generated)" discord_name = "" #"Japeal\n(Generated)"
end end
author_name = File.basename(discord_name, '#*') author_name = File.basename(discord_name, '#*')
@@ -256,8 +263,6 @@ class PokemonPokedexInfo_Scene
set_alt_sprite_substitution(species_number, new_main_sprite) set_alt_sprite_substitution(species_number, new_main_sprite)
end end
# def swap_main_sprite # def swap_main_sprite
# begin # begin
# old_main_sprite = @available[0] # old_main_sprite = @available[0]

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1 +1 @@
5.2 5.2.1

Binary file not shown.