Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
- # [Xp/Vx] Custom Picture Path
- # Version: 1.00
- # Author : LiTTleDRAgo
- #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
- #------------------------------------------------------------------------------
- # SDK Check
- #------------------------------------------------------------------------------
- if Object.const_defined?('SDK')
- SDK.log('Custom Picture Path', 'LiTTleDRAgo', 3, '19.06.11')
- @custom_pict_disabled = !SDK.enabled?('Custom Picture Path')
- end
- if !@custom_pict_disabled
- #==============================================================================
- # ** Interpreter
- #------------------------------------------------------------------------------
- # This interpreter runs event commands. This class is used within the
- # Game_System class and the Game_Event class.
- #==============================================================================
- class Interpreter
- #--------------------------------------------------------------------------
- # * Alias Listing
- #--------------------------------------------------------------------------
- alias custom_pict_command231 command_231 if method_defined?(:command_231)
- #--------------------------------------------------------------------------
- # * Custom Pict
- #--------------------------------------------------------------------------
- def custom_pict(folder='Graphics/Pictures',file='')
- @custom_pict = ['custom',folder,file]
- return true
- end
- #--------------------------------------------------------------------------
- # * command_231 (Show Picture)
- #--------------------------------------------------------------------------
- def command_231
- @parameters[1] = @custom_pict unless @custom_pict.nil?
- custom_pict_command231
- @custom_pict = nil
- return true
- end
- end
- #==============================================================================
- # ** Game_Interpreter
- #------------------------------------------------------------------------------
- # An interpreter for executing event commands. This class is used within the
- # Game_Map, Game_Troop, and Game_Event classes.
- #==============================================================================
- class Game_Interpreter
- #--------------------------------------------------------------------------
- # * Alias Listing
- #--------------------------------------------------------------------------
- alias custom_pict_command231 command_231 if method_defined?(:command_231)
- #--------------------------------------------------------------------------
- # * Custom Pict
- #--------------------------------------------------------------------------
- def custom_pict(folder='Graphics/Pictures',file='')
- @custom_pict = ['custom',folder,file]
- return true
- end
- #--------------------------------------------------------------------------
- # * command_231 (Show Picture)
- #--------------------------------------------------------------------------
- def command_231
- @params[1] = @custom_pict unless @custom_pict.nil?
- custom_pict_command231
- @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
- #--------------------------------------------------------------------------
- # * name_change
- #--------------------------------------------------------------------------
- def name_change(name)
- @name = name
- end
- #--------------------------------------------------------------------------
- # * opacity_change
- #--------------------------------------------------------------------------
- def opacity_change(opacity, duration)
- if duration == 0
- @opacity = opacity
- @target_opacity = opacity
- @opacity_duration = 0
- else
- @target_opacity = opacity
- @opacity_duration = duration
- end
- end
- #--------------------------------------------------------------------------
- # * Frame Update
- #--------------------------------------------------------------------------
- def update
- if @picture_name != @picture.name and @picture.name[0] == 'custom'
- @picture_name = @picture.name
- pic1 = @picture_name[1].to_s
- pic2 = @picture_name[2].to_s
- self.bitmap = Cache.load_bitmap(pic1,pic2) rescue Cache.picture('')
- end
- custom_pict_update
- end
- end
- Cache = RPG::Cache if !defined? Cache
- #--------------------------------------------------------------------------
- # SDK Check End
- #--------------------------------------------------------------------------
- end
- #--------------------------------------------------------------------------
- # END OF SCRIPT
- #--------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement