mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Fixes crash when missing fusion icons folder (thanks kurayamiblackheart)
This commit is contained in:
@@ -111,7 +111,7 @@ class PokeRadar_UI
|
|||||||
|
|
||||||
bitmap1 = AnimatedBitmap.new(GameData::Species.icon_filename(headPoke))
|
bitmap1 = AnimatedBitmap.new(GameData::Species.icon_filename(headPoke))
|
||||||
bitmap2 = AnimatedBitmap.new(GameData::Species.icon_filename(bodyPoke))
|
bitmap2 = AnimatedBitmap.new(GameData::Species.icon_filename(bodyPoke))
|
||||||
|
ensureFusionIconExists()
|
||||||
bitmapFileName = sprintf("Graphics/Pokemon/FusionIcons/icon%03d", pokemonId)
|
bitmapFileName = sprintf("Graphics/Pokemon/FusionIcons/icon%03d", pokemonId)
|
||||||
headPokeFileName = GameData::Species.icon_filename(headPoke)
|
headPokeFileName = GameData::Species.icon_filename(headPoke)
|
||||||
bitmapPath = sprintf("%s.png", bitmapFileName)
|
bitmapPath = sprintf("%s.png", bitmapFileName)
|
||||||
|
|||||||
@@ -188,6 +188,7 @@ class PokemonIconSprite < SpriteWrapper
|
|||||||
icon2 = AnimatedBitmap.new(GameData::Species.icon_filename(bodyPoke))
|
icon2 = AnimatedBitmap.new(GameData::Species.icon_filename(bodyPoke))
|
||||||
|
|
||||||
dexNum = getDexNumberForSpecies(@pokemon.species)
|
dexNum = getDexNumberForSpecies(@pokemon.species)
|
||||||
|
ensureFusionIconExists
|
||||||
bitmapFileName = sprintf("Graphics/Pokemon/FusionIcons/icon%03d", dexNum)
|
bitmapFileName = sprintf("Graphics/Pokemon/FusionIcons/icon%03d", dexNum)
|
||||||
headPokeFileName = GameData::Species.icon_filename(headPoke)
|
headPokeFileName = GameData::Species.icon_filename(headPoke)
|
||||||
bitmapPath = sprintf("%s.png", bitmapFileName)
|
bitmapPath = sprintf("%s.png", bitmapFileName)
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ class PokemonBoxIcon < IconSprite
|
|||||||
icon2 = AnimatedBitmap.new(GameData::Species.icon_filename(bodyPoke))
|
icon2 = AnimatedBitmap.new(GameData::Species.icon_filename(bodyPoke))
|
||||||
|
|
||||||
dexNum = getDexNumberForSpecies(species)
|
dexNum = getDexNumberForSpecies(species)
|
||||||
|
ensureFusionIconExists
|
||||||
bitmapFileName = sprintf("Graphics/Pokemon/FusionIcons/icon%03d", dexNum)
|
bitmapFileName = sprintf("Graphics/Pokemon/FusionIcons/icon%03d", dexNum)
|
||||||
headPokeFileName = GameData::Species.icon_filename(headPoke)
|
headPokeFileName = GameData::Species.icon_filename(headPoke)
|
||||||
bitmapPath = sprintf("%s.png", bitmapFileName)
|
bitmapPath = sprintf("%s.png", bitmapFileName)
|
||||||
|
|||||||
@@ -48,6 +48,11 @@ def pbAddPokemonID(pokemon_id, level = 1, see_form = true, skip_randomize = fals
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def ensureFusionIconExists
|
||||||
|
directory_name = "Graphics/Pokemon/FusionIcons"
|
||||||
|
Dir.mkdir(directory_name) unless File.exists?(directory_name)
|
||||||
|
end
|
||||||
|
|
||||||
def addNewTripleFusion(pokemon1,pokemon2,pokemon3,level = 1)
|
def addNewTripleFusion(pokemon1,pokemon2,pokemon3,level = 1)
|
||||||
return if !pokemon1
|
return if !pokemon1
|
||||||
return if !pokemon2
|
return if !pokemon2
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user