mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-10 22:54:59 +00:00
6.4 update (minus sprites)
This commit is contained in:
@@ -51,22 +51,29 @@ class PokemonSprite < SpriteWrapper
|
||||
end
|
||||
|
||||
def setPokemonBitmap(pokemon, back = false)
|
||||
# Dispose of existing icon bitmap if it exists
|
||||
@_iconbitmap.dispose if @_iconbitmap
|
||||
@_iconbitmap = (pokemon) ? GameData::Species.sprite_bitmap_from_pokemon(pokemon, back) : nil
|
||||
if @_iconbitmap
|
||||
if pokemon.hat
|
||||
add_hat_to_bitmap(@_iconbitmap.bitmap,pokemon.hat,pokemon.hat_x,pokemon.hat_y)
|
||||
else
|
||||
|
||||
end
|
||||
self.bitmap = @_iconbitmap.bitmap
|
||||
@_iconbitmap = nil
|
||||
return if !pokemon
|
||||
base_bitmap = (pokemon) ? GameData::Species.sprite_bitmap_from_pokemon(pokemon, back) : nil
|
||||
if pokemon.hat
|
||||
new_bitmap = Bitmap.new(base_bitmap.width, base_bitmap.height)
|
||||
new_bitmap.blt(0, 0, base_bitmap.bitmap, base_bitmap.bitmap.rect)
|
||||
add_hat_to_bitmap(new_bitmap, pokemon.hat, pokemon.hat_x, pokemon.hat_y)
|
||||
@_iconbitmap = SpriteWrapper.new
|
||||
@_iconbitmap.bitmap = new_bitmap
|
||||
else
|
||||
@_iconbitmap.bitmap=nil
|
||||
# No hat, just use the base bitmap
|
||||
@_iconbitmap = base_bitmap
|
||||
end
|
||||
|
||||
# Assign the bitmap to the sprite
|
||||
self.bitmap = (@_iconbitmap) ? @_iconbitmap.bitmap : nil
|
||||
self.color = Color.new(0, 0, 0, 0)
|
||||
changeOrigin
|
||||
end
|
||||
|
||||
|
||||
def setPokemonBitmapFromId(id, back = false, shiny = false, bodyShiny = false, headShiny = false,spriteform_body=nil,spriteform_head=nil)
|
||||
@_iconbitmap.dispose if @_iconbitmap
|
||||
@_iconbitmap = GameData::Species.sprite_bitmap_from_pokemon_id(id, back, shiny, bodyShiny, headShiny)
|
||||
|
||||
Reference in New Issue
Block a user