#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:= # Custom Picture Path # Version: 1.40 # Author : LiTTleDRAgo #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=: ($imported ||= {})[:drg_custom_pic_path] = 1.40 #============================================================================== # ** Interpreter #------------------------------------------------------------------------------ # This interpreter runs event commands. This class is used within the # Game_System class and the Game_Event class. #============================================================================== VX = defined?(Window_ActorCommand) Klass = VX ? Game_Interpreter : Interpreter class Klass #-------------------------------------------------------------------------- # * Alias Listing #-------------------------------------------------------------------------- alias custom_pict_command231 command_231 if method_defined?(:command_231) #-------------------------------------------------------------------------- # * Custom Pict #-------------------------------------------------------------------------- def custom_pict(folder='Graphics/Pictures',file='',hue=0) @custom_pict = ['custom',folder,file,hue] return true end #-------------------------------------------------------------------------- # * command_231 (Show Picture) #-------------------------------------------------------------------------- def command_231(*args) (@parameters||=[])[1] = @custom_pict if !@custom_pict.nil? (@params ||=[])[1] = @custom_pict if !@custom_pict.nil? custom_pict_command231(*args) @custom_pict = nil return true end end #============================================================================== # ** Sprite_Picture #------------------------------------------------------------------------------ # This sprite is used to display the picture.It observes the Game_Character # class and automatically changes sprite conditions. #============================================================================== class Sprite_Picture < Sprite #-------------------------------------------------------------------------- # * Alias Listing #-------------------------------------------------------------------------- alias custom_pict_update update #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update(*args) cache = VX ? Cache : RPG::Cache if @picture_name != @picture.name and @picture.name[0] == 'custom' pic1 = @picture.name[1].to_s pic2 = @picture.name[2].to_s pic3 = @picture.name[3].to_i self.bitmap = cache.load_bitmap(pic1,pic2,pic3) if pic2 != '' @picture_name = pic2 @picture.instance_variable_set(:@name, pic2) end custom_pict_update(*args) end #-------------------------------------------------------------------------- # * Update_Bitmap #-------------------------------------------------------------------------- if method_defined?(:update_bitmap) alias custom_pict_update_bitmap update_bitmap def update_bitmap(*args) if @picture_name != @picture.name custom_pict_update_bitmap(*args) @picture_name = @picture.name end end end end