- #============================================================================== 
- # ★ RGSS3_メッセージ効果音 Ver1.1 
- #============================================================================== 
- =begin 
-   
- 作者:tomoaky 
- webサイト:ひきも記 ([url]http://hikimoki.sakura.ne.jp/[/url]) 
-   
- 文章の表示コマンド実行時、文字の表示と一緒に効果音を鳴らします。 
-   
- 制御文字 \B を使って効果音を再生するかどうかを設定できます。 
- \B が出てくるたびに切り替わりますが AUTO_SE が true の場合は 
- 最初から効果音が鳴る状態になっています。 
-   
- おまけ機能として文章の表示速度を変更することができます。 
- 设定了游戏变量(初期设定是8号)的数值越大 
- 显示速度越慢。1 是默认速度最低值。 
-   
- 使用游戏变量(初期设定) 
-   0008 
-    
- 2012.01.22  Ver1.1 
-   おまけ機能の文章表示速度変更を追加 
-    
- 2012.01.21  Ver1.0 
-   公開 
-   
- =end 
-   
- #============================================================================== 
- # □ 设定项目 
- #============================================================================== 
- module TMMESSAGESE 
-   MESSAGE_SE = RPG::SE.new("Cursor1", 80, 150)    # 再生される効果音 
-   AUTO_SE = true    # true で自動的に再生、false で制御文字があったときのみ再生 
-   
-   VN_MESSAGE_WAIT = 8   # 文章的显示速度处理游戏变量号码(这个是我改了的,原来是8) 
- end 
-   
- #============================================================================== 
- # ■ Window_Message 
- #============================================================================== 
- class Window_Message 
-   #-------------------------------------------------------------------------- 
-   # ● フラグのクリア 
-   #-------------------------------------------------------------------------- 
-   alias tmmessagese_window_message_clear_flags clear_flags 
-   def clear_flags 
-     tmmessagese_window_message_clear_flags 
-     @se_flag = TMMESSAGESE::AUTO_SE 
-   end 
-   #-------------------------------------------------------------------------- 
-   # ● 一文字出力後のウェイト 
-   #-------------------------------------------------------------------------- 
-   alias tmessagese_window_message_wait_for_one_character wait_for_one_character 
-   def wait_for_one_character 
-     [$game_variables[TMMESSAGESE::VN_MESSAGE_WAIT], 1].max.times do |i| 
-       tmessagese_window_message_wait_for_one_character 
-     end 
-   end 
-   #-------------------------------------------------------------------------- 
-   # ● 通常的文字处理 
-   #-------------------------------------------------------------------------- 
-   alias tmmessagese_window_message_process_normal_character process_normal_character 
-   def process_normal_character(c, pos) 
-     tmmessagese_window_message_process_normal_character(c, pos) 
-     TMMESSAGESE::MESSAGE_SE.play if @se_flag 
-   end 
-   #-------------------------------------------------------------------------- 
-   # ● 制御文字の処理 
-   #     code : 制御文字の本体部分(「\C[1]」なら「C」) 
-   #     text : 描画処理中の文字列バッファ(必要なら破壊的に変更) 
-   #     pos  : 描画位置 {:x, :y, :new_x, :height} 
-   #-------------------------------------------------------------------------- 
-   alias tmmessage_window_message_process_escape_character process_escape_character 
-   def process_escape_character(code, text, pos) 
-     case code.upcase 
-     when 'B' 
-       @se_flag ^= true 
-     else 
-       tmmessage_window_message_process_escape_character(code, text, pos) 
-     end 
-   end 
- end