mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 14:14:59 +00:00
release 6.2
This commit is contained in:
@@ -2,22 +2,40 @@
|
||||
# Walking charset, for use in text entry screens and load game screen
|
||||
#===============================================================================
|
||||
class TrainerWalkingCharSprite < SpriteWrapper
|
||||
def initialize(charset,viewport=nil)
|
||||
def initialize(charset,viewport=nil,trainer=nil)
|
||||
super(viewport)
|
||||
@animbitmap = nil
|
||||
@trainer=trainer
|
||||
self.charset = charset
|
||||
@animframe = 0 # Current pattern
|
||||
@frame = 0 # Frame counter
|
||||
self.animspeed = 5 # Animation speed (frames per pattern)
|
||||
end
|
||||
|
||||
|
||||
def charset=(value)
|
||||
@animbitmap.dispose if @animbitmap
|
||||
@animbitmap = nil
|
||||
|
||||
outfit_bitmap = _INTL("Graphics/Characters/players/outfits/{1}_{2}",value,$Trainer.outfit) if $Trainer && $Trainer.outfit
|
||||
|
||||
@trainer = $Trainer if !@trainer
|
||||
if $Trainer
|
||||
meta=GameData::Metadata.get_player($Trainer.character_ID)
|
||||
isPlayerCharacter = value == pbGetPlayerCharset(meta,1,nil,true)
|
||||
end
|
||||
isPlayerCharacter = true if $scene.is_a?(Scene_Intro) #
|
||||
|
||||
bitmapFileName = sprintf("Graphics/Characters/%s",value)
|
||||
@charset = pbResolveBitmap(bitmapFileName)
|
||||
if @charset
|
||||
@animbitmap = AnimatedBitmap.new(@charset)
|
||||
if isPlayerCharacter #Display clothed player on continue screen
|
||||
@animbitmap.bitmap = generateClothedBitmapStatic(@trainer)
|
||||
@animbitmap.bitmap.blt(0, 0, outfit_bitmap, outfit_bitmap.rect) if pbResolveBitmap(outfit_bitmap)
|
||||
else
|
||||
@animbitmap.bitmap.blt(0, 0, outfit_bitmap, outfit_bitmap.rect) if pbResolveBitmap(outfit_bitmap)
|
||||
end
|
||||
self.bitmap = @animbitmap.bitmap
|
||||
self.src_rect.set(0,0,self.bitmap.width/4,self.bitmap.height/4)
|
||||
else
|
||||
@@ -54,6 +72,7 @@ class TrainerWalkingCharSprite < SpriteWrapper
|
||||
@animbitmap.update
|
||||
self.bitmap = @animbitmap.bitmap
|
||||
end
|
||||
|
||||
@frame += 1
|
||||
if @frame>=@frameskip
|
||||
@animframe = (@animframe+1)%4
|
||||
|
||||
Reference in New Issue
Block a user