mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Fixes issue with possible uninitialized dyed items map when opening clothing menus
This commit is contained in:
@@ -12,9 +12,14 @@ class CustomSpriteExtracter < PIFSpriteExtracter
|
||||
def load_bitmap_from_spritesheet(pif_sprite)
|
||||
body_id = pif_sprite.body_id
|
||||
spritesheet_file = getSpritesheetPath(pif_sprite)
|
||||
|
||||
echoln spritesheet_file
|
||||
spritesheet_bitmap = AnimatedBitmap.new(spritesheet_file).bitmap
|
||||
|
||||
sprite_x_position,sprite_y_position =get_sprite_position_on_spritesheet(body_id,SPRITE_SIZE,COLUMNS)
|
||||
echoln sprite_x_position
|
||||
echoln sprite_y_position
|
||||
|
||||
src_rect = Rect.new(sprite_x_position, sprite_y_position, SPRITE_SIZE, SPRITE_SIZE)
|
||||
|
||||
sprite_bitmap = Bitmap.new(SPRITE_SIZE, SPRITE_SIZE)
|
||||
|
||||
@@ -12,6 +12,8 @@ class OutfitsMartAdapter < PokemonMartAdapter
|
||||
@worn_clothes = get_current_clothes()
|
||||
@isShop = isShop
|
||||
@version = nil
|
||||
$Trainer.dyed_hats = {} if !$Trainer.dyed_hats
|
||||
$Trainer.dyed_clothes = {} if !$Trainer.dyed_clothes
|
||||
end
|
||||
|
||||
def getDisplayName(item)
|
||||
|
||||
@@ -138,10 +138,8 @@ class ClothesShopPresenter < PokemonMartScreen
|
||||
return true
|
||||
elsif options[choice] == cmd_confirm
|
||||
confirmPutClothes(nil)
|
||||
@scene.pbEndBuyScene
|
||||
return false
|
||||
return true
|
||||
elsif options[choice] == cmd_dye
|
||||
#removeDye(item) selectHatColor
|
||||
dyeOptions(@adapter.is_secondary_hat,item)
|
||||
return true
|
||||
elsif options[choice] == cmd_swap
|
||||
|
||||
@@ -416,6 +416,8 @@ def switchToFavoriteOutfit()
|
||||
|
||||
else
|
||||
if (Kernel.pbConfirmMessage("Put on your favorite outfit?"))
|
||||
echoln "favorite clothes: #{$Trainer.favorite_clothes}, favorite hat: #{$Trainer.favorite_hat}, favorite hat2: #{$Trainer.favorite_hat2}"
|
||||
|
||||
playOutfitChangeAnimation()
|
||||
putOnClothes($Trainer.favorite_clothes, true) if $Trainer.favorite_clothes
|
||||
putOnHat($Trainer.favorite_hat, true, false) if $Trainer.favorite_hat
|
||||
|
||||
Reference in New Issue
Block a user