#--------------------------------------------------------------------------
# ● 更新文章显示
#--------------------------------------------------------------------------
def update_message
loop do
c = @text.slice!(/./m) # 获取一个文字
case c
when nil # 无法获取文字时
finish_message # 结束文章更新
break
when "\x07" # 手动换行用 \<
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" # \. (等待四分之一秒)
@wait_count = 15
break
when "\x04" # \| (等待一秒)
@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)
c_width = contents.text_size(c).width
@contents_x += c_width
if @contents_x > self.width - 48
new_line
if @line_count >= MAX_LINE # 当行数已至最大行数
unless @text.empty? # 并还有有等待显示的文字时
self.pause = true # 等待输入
break
end
end
end
end
break unless @show_fast or @line_show_fast
end
end