fixes base sprites importing

This commit is contained in:
infinitefusion
2025-01-04 20:02:50 -05:00
parent 028c6d1442
commit 0e42591bfd
17 changed files with 17 additions and 4 deletions

View File

@@ -26,6 +26,7 @@ module Settings
CUSTOM_BATTLERS_FOLDER = "Graphics/CustomBattlers/"
CUSTOM_SPRITES_TO_IMPORT_FOLDER = "Graphics/CustomBattlers/Sprites to import/"
CUSTOM_BATTLERS_FOLDER_INDEXED = "Graphics/CustomBattlers/local_sprites/indexed/"
CUSTOM_BASE_SPRITE_FOLDER = "Graphics/CustomBattlers/local_sprites/BaseSprites/"
BATTLERS_FOLDER = "Graphics/Battlers/Autogens/"
DOWNLOADED_SPRITES_FOLDER = "Graphics/temp/"
DEFAULT_SPRITE_PATH = "Graphics/Battlers/Special/000.png"

View File

@@ -1527,8 +1527,8 @@ QUEST_REWARDS = [
QuestReward.new(10, :LANTERN, 1, "This will allow you to illuminate caves without having to use a HM! Practical, isn't it?"),
QuestReward.new(15, :LINKINGCORD, 3, "This strange cable triggers the evolution of Pokémon that typically evolve via trade. I know you'll put it to good use!"),
QuestReward.new(20, :SLEEPINGBAG, 1, "This handy item will allow you to sleep anywhere you want. You won't even need hotels anymore!"),
QuestReward.new(30, :MISTSTONE, 1, "This rare stone can evolve any Pokémon, regardless of their level or evolution method. Use it wisely!"),
QuestReward.new(45, :MASTERBALL, 1, "This rare ball can catch any Pokémon. Don't waste it!"),
QuestReward.new(30, :MISTSTONE, 1, "This rare stone can evolve any Pokémon, regardless of their level or evolution method. Use it wisely!",true),
QuestReward.new(45, :MASTERBALL, 1, "This rare ball can catch any Pokémon. Don't waste it!",true),
QuestReward.new(60, :GSBALL, 1, "This mysterious ball is rumored to be the key to call upon the protector of Ilex Forest. It's a precious relic."),
]

View File

@@ -79,10 +79,22 @@ def sortCustomBattlers()
Dir.foreach(Settings::CUSTOM_SPRITES_TO_IMPORT_FOLDER) do |filename|
next if filename == '.' or filename == '..'
next if !filename.end_with?(".png")
headNum = filename.split('.')[0]
split_name = filename.split('.')
headNum = split_name[0]
oldPath = Settings::CUSTOM_SPRITES_TO_IMPORT_FOLDER + filename
newDir = Settings::CUSTOM_BATTLERS_FOLDER_INDEXED + headNum.to_s
echoln split_name
echoln split_name.length
is_base_sprite = split_name.length ==2
if is_base_sprite #fusion sprite
newDir = Settings::CUSTOM_BASE_SPRITE_FOLDER
else
newDir = Settings::CUSTOM_BATTLERS_FOLDER_INDEXED + headNum.to_s
end
newPath = newDir + "/" + filename
begin
if File.file?(newPath)
alreadyExists[oldPath] = newPath