unless @no_term_stop
@pic_skin.dispose if @pic_skin != nil
end
@kkme_name = ""
begin
@kkme_name = $game_temp.message_text.split(":")[0] if $game_temp.message_text.split(":")[1] != nil
if @kkme_name != ""
jiajia = '\c[1]【' + @kkme_name + '】\c[0]'
$game_temp.message_text = jiajia + $game_temp.message_text[@kkme_name.size + 2,$game_temp.message_text.size]
else
$game_temp.message_text = '\c[0]' + $game_temp.message_text
end
rescue
end
unless @no_term_stop
self.contents.clear
self.contents.font.color = Color.new(0, 0, 0, 255)
self.contents.font.size = FUKI::MES_FONT_SIZE
# 取得窗口尺寸
get_windowsize
w = @w + 32 + 8
h = @h * (self.contents.font.size + 6) + 26
# 生成呼出窗口
# 生成角色名字窗口
set_fukidasi(self.x, self.y, w, h)
set_namewindow
pic_back
end
# 初始化信息表示使用的变量
@dx = @save_x # 0
@dy = @save_y # 0
@cursor_width = 0
@contents_drawing = true
update
# 瞬间表示的情况下
if $mes_speed == 0
# 循环信息描绘处理
while $game_temp.message_text != ""
draw_massage
end
draw_opt_text
@contents_showing_end = true
@contents_drawing = false
else
# 一个一个描绘文字
refresh_drawtext
end
end
#--------------------------------------------------------------------------
# ○ 一个一个描绘文字
#--------------------------------------------------------------------------
def refresh_drawtext
if $game_temp.message_text != nil
if @wait > 0
@wait -= 1
elsif @wait == 0
#$game_system.se_play($data_system.cursor_se)
# 描绘处理
draw_massage
@wait = $mes_speed
end
end
# 描绘结束
if $game_temp.message_text == ""
draw_opt_text
@contents_showing_end = true
@contents_drawing = false
end
end
#--------------------------------------------------------------------------
# ○ 取得窗口尺寸
#--------------------------------------------------------------------------
def get_windowsize
x = y = 0
@h = @w = 0
@cursor_width = 0
# 有选择项的话,处理字的缩进
if $game_temp.choice_start == 0
x = 16
end
# 有等待显示的文字的情况下
if $game_temp.message_text != nil
text = $game_temp.message_text.clone
# 限制文字处理
begin
last_text = text.clone
text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
end until text == last_text
text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
$game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
end
# 为了方便、将 "\\\\" 变换为 "\000"
text.gsub!(/\\\\/) { "\000" }
# "\\C" 变为 "\001" 、"\\G" 变为 "\002"
text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001" }
text.gsub!(/\\[Gg]/) { "\002" }
# c 获取 1 个字 (如果不能取得文字就循环)
while ((c = text.slice!(/./m)) != nil)
# \\ 的情况下
if c == "\000"
# 还原为本来的文字
c = "\\"
end
# \C[n] 或者 \G 的情况下
if c == "\001" or c == "\002"
# 下面的文字
next
end
# 另起一行文字的情况下
if c == "\n"
# y 累加 1
y += 1
# 取得纵横尺寸
@h = y
@w = x > @w ? x : @w
if y >= $game_temp.choice_start
@w = x + 8 > @w ? x + 8 : @w
end
x = 0
# 移动到选择项的下一行
if y >= $game_temp.choice_start
x = 8
end
# 下面的文字
next
end
# x 为要描绘文字的宽度加法运算
x += self.contents.text_size(c).width
end
end
# 输入数值的情况
if $game_temp.num_input_variable_id > 0
digits_max = $game_temp.num_input_digits_max
number = $game_variables[$game_temp.num_input_variable_id]
@h += 1
x = digits_max * self.contents.font.size + 16
@w = x > @w ? x : @w
end
end
#--------------------------------------------------------------------------
# ○ 描绘信息处理
#--------------------------------------------------------------------------
def draw_massage
# 有等待显示的文字的情况下
if $game_temp.message_text != nil or @old_text_info != nil
text = $game_temp.message_text
# 限制文字处理
begin
last_text = text.clone
text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
end until text == last_text
text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
$game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
end
# 为了方便、将 "\\\\" 变换为 "\000"
text.gsub!(/\\\\/) { "\000" }
# "\\C" 变为 "\001"、"\\G" 变为 "\002"
text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
text.gsub!(/\\[Gg]/) { "\002" }
# c 获取 1 个字
c = text.slice!(/./m)
# 选择项的情况
if @dy >= $game_temp.choice_start
# 处理字的缩进
@dx = 8
# 描绘文字
font_size = self.contents.font.size
self.contents.draw_text(4 + @dx, (font_size+5)*@dy, 40, 32, c)
# x 为要描绘文字宽度的加法运算
@dx += self.contents.text_size(c).width
# 循环
while ((c = text.slice!(/./m)) != "\n")
# 描绘文字
self.contents.draw_text(4 + @dx, (font_size+5)*@dy, 40, 32, c)
# x 为要描绘文字宽度的加法运算
@dx += self.contents.text_size(c).width
end
if c == "\n"
# 更新光标宽度
@cursor_width = [@cursor_width, @dx].max
# dy 累加 1
@dy += 1
@dx = 0
end
return
end
# \\ 的情况下
if c == "\000"
# 还原为本来的文字
c = "\\"
end
#\C[n] 的情况下
if c == "\001"
# 更改文字色
text.sub!(/\[([0-9]+)\]/, "")
color = $1.to_i
if color >= 0 and color <= 7
self.contents.font.color = text_color(color)
end
end
# \G 的情况下
if c == "\002"
# ★生成金钱窗口★
@contents_showing_end = true
@contents_drawing = false
terminate_messageX
@save_x = @dx
@save_y = @dy
end
# 另起一行文字的情况下
if c == "\n"
# dy 累加 1
@dy += 1
@dx = 0
end
# 描绘文字