# SEセットに使う変数番号。 MSE_VAL_ID = 1 MSE_SET = [] # 鳴らすSEのファイル名、音量、ピッチ。 # MSE_SET[val] = ["ファイル名", 音量, ピッチ]で指定。 MSE_SET[0] = ["Cursor1", 80, 100] MSE_SET[1] = ["Cursor1", 80, 150] MSE_WAIT = [] # 音を鳴らすたびに入れるウェイトのフレーム数。 # 0でツクールデフォルトと同じ。 # 何かしらいじるとメッセージ速度を変えられるかも。 MSE_WAIT[0] = 1 #============================================================================== # ■ Window_Message #============================================================================== class Window_Message < Window_Selectable #-------------------------------------------------------------------------- # ● メッセージの更新 #-------------------------------------------------------------------------- def update_message loop do c = @text.slice!(/./m) # 次の文字を取得 case c when nil # 描画すべき文字がない finish_message # 更新終了 break when "\x00" # 改行 new_line if @line_count >= MAX_LINE # 行数が最大のとき unless @text.empty? # さらに続きがあるなら self.pause = true # 入力待ちを入れる break end end when "\x01" # \C[n] (文字色変更) @text.sub!(/\[([0-9]+)\]/, "") contents.font.color = text_color($1.to_i) next when "\x02" # \G (所持金表示) @gold_window.refresh @gold_window.open when "\x03" # \. (ウェイト 1/4 秒) @wait_count = 15 break when "\x04" # \| (ウェイト 1 秒) @wait_count = 60 break when "\x05" # \! (入力待ち) self.pause = true break when "\x06" # \> (瞬間表示 ON) @line_show_fast = true when "\x07" # \< (瞬間表示 OFF) @line_show_fast = false when "\x08" # \^ (入力待ちなし) @pause_skip = true else # 普通の文字 contents.draw_text(@contents_x, @contents_y, 40, WLH, c) v = $game_variables[MSE_VAL_ID] Audio.se_play("Audio/SE/"+MSE_SET[v][0], MSE_SET[v][1], MSE_SET[v][2]) # ☆ @wait_count = MSE_WAIT[0] # ☆ c_width = contents.text_size(c).width @contents_x += c_width end break unless @show_fast or @line_show_fast end end end