=begin
===============================================================================
视觉小说 By喵呜喵5
===============================================================================
【说明】
滚动文字变成视觉小说模式,支持对话中使用的转义字符“\.”、“\!”等
本质上不过是修改了默认的文字对话框,将其大小变为全屏幕罢了……
使用的时候先用事件指令中的脚本输入“m5_novel”(不包含双引号),
然后输入滚动文字
实际运行的时候就会以视觉小说的形式显示出来
(暂停对话请使用转义字符“\!”)
=end
$m5script = {} if $m5script.nil?
$m5script["M5VisualNovel"] = true
module M5VisualNovel
#==============================================================================
# 设定部分
#==============================================================================
X = 12
# 显示位置的X坐标
Y = 12
# 显示位置的Y坐标
end
#==============================================================================
# 脚本部分
#==============================================================================
class Window_Message
alias m5_20140416_update_placement update_placement
def update_placement
@position = $game_message.position
if @position == 3
self.width = Graphics.width
self.height = Graphics.height
create_contents
self.x = 0
self.y = 0
else
self.width = window_width
self.height = window_height
create_contents
m5_20140416_update_placement
end
end
alias m5_20140416_need_new_page? need_new_page?
def need_new_page?(text, pos)
if @position == 3
return (pos[:y] + pos[:height] > (Graphics.height - standard_padding * 2)\
&& !text.empty?)
else
return m5_20140416_need_new_page?(text, pos)
end
end
alias m5_2014041602_new_page new_page
def new_page(text, pos)
m5_2014041602_new_page(text, pos)
pos[:y] = M5VisualNovel::Y if @position == 3
end
alias m5_20140416_new_line_x new_line_x
def new_line_x
@position == 3 ? M5VisualNovel::X : m5_20140416_new_line_x
end
end
class Game_Interpreter
def m5_novel
index,list = @index,@list
if list[index+1].code == 105
list[index+1].code = 101
list[index+1].parameters = ["",0,2,3]
index += 2
while list[index].code == 405
list[index].code = 401
index += 1
end
end
end
end