Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # Text Sound Effect
- #------------------------------------------------------------------------------
- # by Zerbu
- #==============================================================================
- module Text_Sound_Effect
- #--------------------------------------------------------------------------
- # Options
- #--------------------------------------------------------------------------
- # The sound effect to play
- MESSAGE_SOUND = RPG::SE.new("Knock", 70, 80)
- # The number of characters to display before each time the sound plays
- # The default is 3, it's recommended you keep it as this unless you
- # know what you're doing
- MESSAGE_SOUND_FRAMES = 3
- end
- class Window_Base < Window
- include Text_Sound_Effect
- #--------------------------------------------------------------------------
- # alias method: process_characer
- #--------------------------------------------------------------------------
- alias textsound_process_character_normal process_character
- def process_character(c, text, pos)
- #---
- if !defined?(@sound_frames)
- @sound_frames = 0
- end
- #---
- if @sound_frames == 0
- MESSAGE_SOUND.play
- end
- #---
- @sound_frames+=1
- #---
- if @sound_frames == MESSAGE_SOUND_FRAMES
- @sound_frames = 0
- end
- #---
- textsound_process_character_normal(c, text, pos)
- #---
- end
- #---
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement