119 lines
5.2 KiB
Ruby
119 lines
5.2 KiB
Ruby
|
||
#==============================================================================
|
||
# 「ロングメッセージ」(ACE) ver2.2 by奈々
|
||
#
|
||
# ◇使用規約
|
||
# 使用される場合はスクリプト作成者として「奈々」を明記して下さい。
|
||
# このスクリプトを改変したり、改変したものを配布するなどは自由ですが
|
||
# その場合も元のスクリプトの作成者として名前は載せて下さい。
|
||
# その他、詳しい利用規約はブログを参照して下さい。
|
||
#
|
||
#------------------------------------------------------------------------------
|
||
#
|
||
# デフォルトでは4行で固定の「文章の表示」を好きな行に可変させます。
|
||
# (ロングメッセージと言いつつ、ショートメッセージも作れます)
|
||
# また「文章のスクロール表示」を使って長いテキストを1回で入力できます。
|
||
#
|
||
# ・可変行
|
||
# まず初期設定でゲーム開始時の行数を指定します。
|
||
# ゲーム中に変更したい場合はイベントコマンドの「スクリプト」に
|
||
# change_message_row(行数)
|
||
# と入力します。
|
||
#
|
||
# ・長文入力
|
||
# イベントコマンド「文章の表示」に1行「header」とだけ入れて
|
||
# その直後に「文章のスクロール表示」を置くことで
|
||
# スクロール表示ではなく、通常の文章の表示として使用できます。
|
||
# (顔グラや表示位置などの設定はheaderのものが適用されます)
|
||
# 可変行で5行以上のメッセージを入力したい場合や
|
||
# 4行ずつ入力するのが面倒な場合に活用して下さい。
|
||
#
|
||
#==============================================================================
|
||
# ◇初期設定
|
||
module NanaSeven
|
||
START_TEXT_ROW = 4 # 表示行数の初期値
|
||
end
|
||
#==============================================================================
|
||
|
||
class Game_System
|
||
#--------------------------------------------------------------------------
|
||
# ● 公開インスタンス変数(追加)
|
||
#--------------------------------------------------------------------------
|
||
attr_accessor :nana_message_row # メッセージ行数
|
||
#--------------------------------------------------------------------------
|
||
# ● オブジェクト初期化(alias再定義)
|
||
#--------------------------------------------------------------------------
|
||
alias long_text_initialize initialize
|
||
def initialize
|
||
long_text_initialize
|
||
@nana_message_row = NanaSeven::START_TEXT_ROW
|
||
end
|
||
end
|
||
#==============================================================================
|
||
# ■ Window_Message
|
||
#------------------------------------------------------------------------------
|
||
# 文章表示に使うメッセージウィンドウです。
|
||
#==============================================================================
|
||
|
||
class Window_Message < Window_Base
|
||
#--------------------------------------------------------------------------
|
||
# ● 表示行数の取得
|
||
#--------------------------------------------------------------------------
|
||
def visible_line_number
|
||
return $game_system.nana_message_row
|
||
end
|
||
end
|
||
|
||
#==============================================================================
|
||
# ■ Game_Interpreter
|
||
#------------------------------------------------------------------------------
|
||
# イベントコマンドを実行するインタプリタです。このクラスは Game_Map クラス、
|
||
# Game_Troop クラス、Game_Event クラスの内部で使用されます。
|
||
#==============================================================================
|
||
|
||
class Game_Interpreter
|
||
#--------------------------------------------------------------------------
|
||
# ● 文章の表示(再定義)
|
||
#--------------------------------------------------------------------------
|
||
def command_101
|
||
wait_for_message
|
||
$game_message.face_name = @params[0]
|
||
$game_message.face_index = @params[1]
|
||
$game_message.background = @params[2]
|
||
$game_message.position = @params[3]
|
||
while next_event_code == 401 # 文章データ
|
||
@index += 1
|
||
header = (@list[@index].parameters[0] == "header")
|
||
$game_message.add(@list[@index].parameters[0]) unless header
|
||
end
|
||
while next_event_code == 105 && header
|
||
@index += 1
|
||
end
|
||
while next_event_code == 405 && header
|
||
@index += 1
|
||
$game_message.add(@list[@index].parameters[0])
|
||
end
|
||
case next_event_code
|
||
when 102 # 選択肢の表示
|
||
@index += 1
|
||
setup_choices(@list[@index].parameters)
|
||
when 103 # 数値入力の処理
|
||
@index += 1
|
||
setup_num_input(@list[@index].parameters)
|
||
when 104 # アイテム選択の処理
|
||
@index += 1
|
||
setup_item_choice(@list[@index].parameters)
|
||
end
|
||
wait_for_message
|
||
end
|
||
#--------------------------------------------------------------------------
|
||
# ● メッセージ行数の変更
|
||
#--------------------------------------------------------------------------
|
||
def change_message_row(value)
|
||
$game_system.nana_message_row = value
|
||
Fiber.yield while $game_message.visible
|
||
if SceneManager.scene_is?(Scene_Map) || SceneManager.scene_is?(Scene_Battle)
|
||
SceneManager.scene.create_message_window
|
||
end
|
||
end
|
||
end
|