질문과 답변

Extra Form

일본거 스크립트를 다운받아서 써봤는데요,


#==============================================================================
# ★RGSS2
# STR22Edit_MWEXT++/カスタマイズセクション v1.0 08/02/16
# サポート:http://otsu.cool.ne.jp/strcatyou/
#
# ・メッセージウィンドウEXT++の設定プラグインです。
#
#------------------------------------------------------------------------------
#
# 更新履歴
# ◇1.0
# やっぱり本体と分割。マニュアルは設定箇所の下に移動しました。
#
#==============================================================================
# ■ Window_Message
#==============================================================================
class Window_Message < Window_Selectable
  #-------------------------------------------------------------------------#
  # ★ 基本設定                                                             #
  #-------------------------------------------------------------------------#
  # 通常サイズ(X(0), Y(0), 幅, 高さ)
  WINDOW_RECT  = Rect.new(0, 0, 544, 128)
  # バトルメッセージモード
  BTMESMODE    = 0        # 0 = 通常 1 = STR11b(XP風バトル)モード
  # フェードタイプ
  FADE_TYPE    = 1        # 0 = 縦に開閉(デフォルト) 1 = 透明度変化
  # ふきだしファイル名
  POPUP_FILE   = "Window_Popup" # 使用しない場合は""
  # ふきだしタイプ参照先変数
  POPUP_TYPE_V = 12       # ◆指定した変数の値でポップアップのパターンが
                          #  決定されます。
  POPUP_MIRROR = true     # ふきだしをキャラ位置に応じて左右反転
  POPUP_LR     = 0        # ふきだしグラフィックの向き
                          # 0 = 左 1 = 右
  # スリムウィンドウ
  S_WINDOW     = true     # スリムウィンドウを有効にする
  S_WINDOW_W   = 10       # 縮めるウィンドウの横幅(pixel)
  S_WINDOW_H   = 12       # 縮めるウィンドウの縦幅(pixel)
  # ネームウィンドウ
  N_WINDOW_FN  = "UmePlus Gothic" # フォント
  N_WINDOW_FS  = 16       # フォントサイズ
  N_WINDOW_ED  = true     # 縁取り
  N_WINDOW_CO  = Color.new(255,255,255) # 通常カラー
  N_WINDOW_CE  = Color.new( 64, 32,128) # 縁取りカラー
  N_WINDOW_WH  = [10, 8]  # 幅,高さ修正[幅, 高さ]
  N_WINDOW_XY  = [0,-14]  # XY座標修正[X, Y]
  N_WINDOW_OPC = 100      # 不透明度(通常ウィンドウに対しての%)
  N_WINDOW_IX  = true     # 顔グラフィックを左側に表示した時、
                          # ネームウィンドウの位置を文章に合わせる
  N_WINDOW_1V  = true     # "背景を暗くする"の時、ネームウィンドウを
                          # 透明にする
  # ポーズサイン位置
  P_WINDOW     = 1        # ポーズサイン位置 0 = 中央下 1 = 右下
  P_WINDOW_XY  = [-24,-24]# XY座標修正[X, Y]
  # 顔グラフィック
  FACE_SIZE    = [96, 96] # サイズ[幅, 高さ]
  FACE_XY      = [0, 0]   # XY座標修正[X, Y]
  FACE_Y       = 1        # 縦位置 0 = 上 1 = 中央 2 = 下
  FACE_SPACE   = 8        # 顔グラと文章間のスペース
  # メッセージバック
  MESBACK_VA   = 13       # ◆指定した変数の値でメッセージバックが
                          #  決定されます。
  # メッセージバックリスト定義(指定した変数の値に対応するファイル名)
  #   対応する値 => "ファイル名",
  MESBACK_LIST = {0 => "MessageBack", # デフォルト
                  1 => "Window_ext",
                  2 => "",
                  }
  # メッセージ表示中移動の際にONにするスイッチID
  MESMOVE      = 12       # ◆
  #-------------------------------------------------------------------------#
  # ★ フォント                                                             #
  #-------------------------------------------------------------------------#
  # 基本
  DEFAULT_SIZE = 20       # デフォルトの文字サイズ
  WLH          = 24       # 行間
  ALIGN        = 0        # 文字揃え 0 = 左 1 = 中央 2 = 右
  # フォントリスト定義(\F[n]で指定するフォントです)
  FONTLIST = {0 => "UmePlus Gothic",  # ■デフォルトのフォント
              1 => "MS Pゴシック", # XPデフォルト
              2 => "MS P明朝",     # 渋い
              3 => "Arial",           # XPタイマーフォント
              4 => "Arial Black",     # XPダメージポップフォント
              }
  # 縁取りカラーリスト定義(\CE[n]で指定するカラーです)
  EDGE_COLOR = {0 => Color.new( 64, 32,128),   # 青
                1 => Color.new(128, 32, 32),   # 赤
                2 => Color.new( 96, 96, 32),   # 黄
                3 => Color.new( 32, 32, 32),   # 黒
                4 => Color.new(64,32,128,128), # うっすらブルー
                }
  #-------------------------------------------------------------------------#
  # ★ タイピングSE                                                         #
  #-------------------------------------------------------------------------#
  # タイピングSEリスト定義 MESSE_VNUMで指定した変数の値のSEを再生します。
  #  対応する値 => SE 情報
  MESSAGE_SE = {0 => RPG::SE.new("Open1", 60, 150), # カチャチャ
                1 => RPG::SE.new("", 80, 150),      # 無音
                }
  # 基本設定
  MESSE      = true    # タイピングSEを有効にするかどうか
  MESSE_WAIT = 2       # タイピングSEの通常再生間隔 0 で最速
  MESSE_VNUM = 10      # ◆再生するSE番号の参照元変数(ID)
                       #  指定した変数の値で再生するSEが決定されます
  MESSE_VWAI = 11      # ◆タイピングSEの再生間隔の強制指定に参照する変数(ID)
                       #  指定した変数の値が 1 以上の時、再生間隔を
                       #  その値に強制指定します
  #-------------------------------------------------------------------------#
  # ★ スキップ                                                             #
  #-------------------------------------------------------------------------#
  # 基本
  FAST_B = Input::B    # メッセージニ倍速ボタン
  F_AUTO = false       # メッセージニ倍速を標準スピードに
  SKIP_B = Input::A    # メッセージスキップボタン
  F_WAIT = 0           # 文章終了時のウェイト VXデフォルトの値は 10
  # 完全スキップ無効化スイッチID
  PSID = 9             # ◆ここで指定したスイッチがONの時、Cボタン押下を含めた
                       #  全てのメッセージスキップ機能が無効になります
  # スキップ無効化スイッチID
  SSID = 10            # ◆ここで指定したスイッチがONの時、
                       #  メッセージスキップ機能が無効になります
  # ニ倍速無効化スイッチID
  FSID = 11            # ◆ここで指定したスイッチがONの時、
                       #  メッセージニ倍速流し機能が無効になります
  #-------------------------------------------------------------------------#
  # ★ 拡張設定                                                             #
  #-------------------------------------------------------------------------#
  # マクロ定義 \M[n]で置き換えるテキストです。
  # 制御文字の "\" は "\\" と入力する必要があります。
  MACRO = { 0 => "\\c[1]\\f",                   # カラー1番、縁取り切り替え
            1 => "\\c[0]\\f",                   # カラー0番、縁取り切り替え
            2 => "を手に入れた!",              # 手に入れた。
            3 => "\\fs[16]\\eはい\\e\\fs[d]",   # 縁取り小さめのはい
            4 => "\\fs[16]\\eいいえ\\e\\fs[d]", # 縁取り小さめのいいえ
            5 => "\\r[漢,おとこ]",              # 男
            }
  # オートネームウィンドウ定義 "Actor[n]"と書くことでn番のアクターの名前に設定可
  # "ファイル名 + _ + フェイスインデックス" => "なまえ",
  # フェイスインデックスの  0123
  # 割り当て図 →      4567
  A_N_WINDOW = {"Actor1_0" => "ラルフ",
                "Actor1_3" => "ウルリカ",
                "Actor2_2" => "ベネット",
                "Actor2_5" => "イルヴァ",
                "Actor1_4" => "Actor[5]",
                "Evil_4"   => "Actor[6]",
                "Actor3_1" => "Actor[7]",
                "Actor3_2" => "Actor[8]",
                }
  def initialize_vocab
  # 用語リスト(\VO[n]で置き換える用語です)
  @vo={0 => Vocab::ShopBuy,     1 => Vocab::ShopSell,    2 => Vocab::ShopCancel,
       3 => Vocab::Possession,  4 => Vocab::ExpTotal,    5 => Vocab::ExpNext,
       6 => Vocab::SaveMessage, 7 => Vocab::LoadMessage, 8 => File,
       9 => Vocab::level,      10 => Vocab::level_a,    11 => Vocab::hp,
      12 => Vocab::hp_a,       13 => Vocab::mp,         14 => Vocab::mp_a,
      15 => Vocab::atk,        16 => Vocab::def,        17 => Vocab::spi,
      18 => Vocab::agi,        19 => Vocab::weapon,     20 => Vocab::armor1,
      21 => Vocab::armor2,     22 => Vocab::armor3,     23 => Vocab::armor4,
      24 => Vocab::weapon1,    25 => Vocab::weapon2,    26 => Vocab::attack,
      27 => Vocab::skill,      28 => Vocab::guard,      29 => Vocab::item,
      30 => Vocab::equip,      31 => Vocab::status,     32 => Vocab::save,
      33 => Vocab::game_end,   34 => Vocab::gold,       35 => "はにゃーん!",
    }
  end
  #-------------------------------------------------------------------------#
  # ★ システムパラメータ ※変更注意                               #
  #-------------------------------------------------------------------------#
  STRXXS_WINDOW = false  # STR_SlimWindow
  STR22000 =  5          # ItalicOFF
  STR22001 =  8          # BoldOFF
  STR22002 =  4          # NewLine_it
  STR22007 =  4          # LineAlpha
  STR22008 =  4          # Ruby
  STR22009 = 24          # IconSize
  STR22010 =  8          # Pause_AnimationSpeed
  STR22011 = 48          # Fadetype=1_Speed
  STR22100 =  1          # XY_Update
  STR22101 = true        # Framereset
  STR22900 = [544,416]   # Screen
end
  #-------------------------------------------------------------------------#
  # ★ フェイスアニメ                                                       #
  #-------------------------------------------------------------------------#
module STRRGSS2
  # ループアニメスピード 参考) 4で標準速 2で倍速
  STR22_ANSPEED = 4
  # ループアニメ最大セル数 1-16 ※よくわからない場合は変更しないでください
  STR22_MAXCELL = 16
end
#==============================================================================
# ★ STR22_メッセージウィンドウEXT++ マニュアル
#  一通り目を通しておくことをお勧めします。
#  あと、ここに書いてない機能や仕様があったりして・・・(汗)
#==============================================================================
#
# ◇素材規格
#
# □ふきだし(/Graphics/Systemフォルダ)
#  ウィンドウのフレーム部分にかぶせて、
#  ふきだしのように見せるためのグラフィック。
#
#   幅 = 32 + 32
#  高さ = 64 * 任意のふきだしパターン数
#
#  1パターンの64*64内にふきだし上下のグラフィックを収めます。
#  左32*64に下向きのふきだし、右32*64に上向きのふきだしを、
#  ウィンドウの枠部分と重ねて、違和感がないように配置します。
#
#  サンプルのふきだしグラフィックを見ていただくのが
#  一番分かりやすいと思われます。
#
#  ※ふきだしパターンは上から01234...と順番に割り当てられます。
#   この割り当ては変数でパターン指定する際の対応する値となります。
#
#------------------------------------------------------------------------------
#
# ★追加制御文字 アルファベットは小文字で入力しても可
#
# \* \xxxxx :解説
#
# \  = [カッコ内]には、\N、\V等の制御文字が使用できます。
#  * = テキストが改行されると情報が初期化されます。
#
# ◇エクステンド--------------------------------------------------------◇
#
# \ \M[n]  □テキスト置き換え(マクロ)。
#       設定箇所で定義したリストの n 番のテキストに置き換えます。
#       使い方次第で、様々な文章打ち込みの作業を
#       大幅に簡略化することが可能です。
# \ \P[n]  □キャラクターにポップアップ。
#       n 番のイベントにポップアップ+自動リサイズします。
#       0 で実行元のイベント、-1 でプレイヤーにポップアップします。
#       また、同時にふきだし設定(\PP[n])を行います。
# \  \PP[n] □ふきだしを n 番のイベントに位置指定します。
#       0 で実行元のイベント、-1 でプレイヤー、-2 で非表示に。
#       通常メッセージでふきだしを表示させる場合や
#       逆に、ポップアップのふきだしを非表示にする時に使います。
# \  \NA[t] □ネームウィンドウ表示。t に任意の文字列。
#       例:\NA[ラルフ] ラルフを表示
#         \NA[\N[1]] 1番のアクターの名前を表示
#       また、\NA[] と、何も書かずに制御文字を入れると
#       ネームウィンドウは非表示になります。
#       この機能は、オートネームウィンドウ(後述)による表示を
#       無効にしたい場合に使用します。
#  \NEXT  □文章の連続表示。
#       行数拡張(後述)で指定した、最大行数を超えない範囲で
#       メッセージをまとめて表示します。
#       行数拡張の項目も合わせてご覧ください。
# \  \SH[p,s,d]
#      □メッセージウィンドウのシェイク。
#       p に強さ、s にスピード、d に時間(1/60sec)を指定します。
#       シェイクの仕様はイベントコマンドで行える
#       "画面のシェイク"と同じです。
#       例:\sh[6,20,60]うおおお! → 1秒速シェイク
#
# ◇キャラ操作----------------------------------------------------------◇
#
# \ \A[n,m] □キャラクターにアニメーション。
#       n 番のイベントに m 番のアニメーションを再生します。
#       n を 0 にすると実行元のイベント、-1 でプレイヤーに再生します。
# \ \U[n,m] □キャラクターにフキダシアイコン。
#       n 番のイベントに m に対応したフキダシアイコンを表示します。
#       n を 0 にすると実行元のイベント、-1 でプレイヤーに表示します。
#       m = 0:びっくり 1:はてな 2:音符 3:ハート 4:怒り
#         5:汗 6:くしゃくしゃ 7:沈黙 8:電球 9:Zzz
#
# ◇ウェイトコントロール------------------------------------------------◇
#
#  \MOVE  □メッセージ表示中のプレイヤー移動を許可します。
#       この制御文字で移動が許可されている間、設定箇所で指定した
#       スイッチがONになります。
#       ※メッセージ表示中に接触イベントなどが起動できない仕様の
#        対策のため。スイッチがONの間、イベントをすり抜ける等の
#        症状を解決させるための仕様です。
#  \STOP  □マップ更新ストップ。
#       文章表示中、マップの更新(イベント移動など)が停止します。
# \ \S[n]  □文章スピード。値が大きいほどスピードが遅くなります。
#       n には 0 以上の整数を指定してください。
# \ \W[n]  □詳細ウェイト。n フレームのウェイトを掛けます。(1/60sec)
#
# ◇フェイス------------------------------------------------------------◇
#
#  \FR   □顔グラフィックの位置を右側に設定します。
#  \FM   □顔グラフィックを左右反転表示させます。
# \ \FC[n,m]□顔グラフィック変更。
#       n に"ファイル名"、m にフェイスインデックスを指定します。
#       顔グラフィックが指定されて無い場合は無効になります。
#       例:\fc[Actor2,2] → ベネットさん
#  \FCM  □リアルタイムに顔グラフィックを左右反転させます。
#       ギャグっぽい演出に使えそうですね。
# \ \FA[n] □顔グラフィックに n 番のアニメーションを再生させます。
# \ \FAL[n] □顔グラフィックに n 番のアニメーションをループ再生させます。
#       \FLCでアニメーションループ再生に置き換えられている場合、
#       置き換えのアニメを n 番のアニメーションに変更します。
# \ \FLC[n] □顔グラフィックを n 番のアニメーションループ再生に置き換えます。
#       ウゴウゴする顔や口パクなどができる予感。
#       これらのアニメ指定で、n を 0 にするとアニメOFFになります。
#
# ◇置き換え/描画強化---------------------------------------------------◇
#
# \ \MAP  □現在のマップ名に置き換えます。
#       マップ名の # 以降の文字列は無視されます。
#       例:テストマップ#その1 → テストマップ
#       ※ # を2つ以上含んだマップ名の場合、うまく描画されません
# \ \VO[n] □用語。設定箇所で定義した、n 番の用語に置き換えます。
# \ \IC[n] □アイコン。n番のインデックスのアイコンを描画します。
# \ \IN[n,m]□アイテム名。n の種類の m 番のアイテムの名前を描画します。
#       種類(n):0 = アイテム 1 = 武器 2 = 防具 3 = スキル
# \ \IT[n,m]□アイコン+アイテム名。nの種類のm番のアイテムを描画します
#       種類(n):0 = アイテム 1 = 武器 2 = 防具 3 = スキル
# \ \SPIX[n]□スペース。nピクセルの空白を挿入します。
#
# ◇フォント------------------------------------------------------------◇
#
# \ \R[t,r] □ルビ振り。t に通常の文字、r にルビ文字を指定します。
#       例:\r[野口英世,1000YEN]
#       ルビサイズは 文字サイズ / 2 です。
#       ※ルビサイズが小さくなりすぎるとエラーがでます。
#        ご注意ください。
# \* \AL[n] □文字揃え。その行の文字揃えを設定します。
#       n:0 = 左 1 = 中央 2 = 右
#       ○設定箇所でデフォルトの文字そろえを設定できます。
# \* \F[n]  □フォント。設定箇所で定義したリストの
#       n 番のフォントに設定します。
# \* \FS[n] □フォントサイズ。n のサイズに設定します。
#       n に D を入れると、デフォルトのフォントサイズに設定します。
#       \fs[d] この様に、d は小文字でも可。
#       ※小さすぎる値もしくは大きすぎる値を指定するとエラーがでます。
#        ご注意ください。
#  * \B   □太字モードON/OFF
#  * \I   □斜体モードON/OFF
#  * \E   □縁取りモードON/OFF(エッジ)
# \ \CE[n] □縁取りカラー設定。設定箇所で定義したリストの
#       n 番のカラーに設定します。
# * \UND  □アンダーライン(_)ON/OFF
# * \STR  □打ち消し線ON/OFF
#
# ◇スイッチ/変数操作---------------------------------------------------◇
#
# \ \SW[i,f]□スイッチ操作。i に操作するスイッチID、
#       fにON,OFF,RV(ON/OFF/反転)のいずれかを指定します。
#       例:\sw[\v[128],rv] → 変数128番の値のスイッチを反転
# \ \VA[i,n]□変数代入。i に操作する変数ID、n に代入する値を指定します。
#       例:\va[256,-512] → 変数256番に-512を代入
#       ※あくまで補助的な制御文字なので、
#        代入以外の操作は行えません。また、少数の代入も非サポートです。
#
#------------------------------------------------------------------------------
#
# ★その他の機能
#
# □行数拡張
# イベントコマンド等のスクリプトで、以下のスクリプトを実行すると
# メッセージの最大行数を拡張することができます。
#
# $game_message.maxlineex = line
#
# line に最大行数を指定します。初期値は 4、推奨値は 4 の倍数です。
# 5 以上に指定した時、\NEXTの制御文字を含めた文章コマンドを並べることで、
# 五行以上のメッセージを流すことが可能です。
# 長い説明(プレイングマニュアル等)に便利。
#
# □ウィンドウ位置/サイズ強制指定
# イベントコマンド等のスクリプトで、以下のスクリプトを実行すると
# ウィンドウ位置とサイズを強制指定することが出来ます。
#
# $game_message.xywh.set(240, 176, 64, 64)
#
# 括弧には(X座標, Y座標, 幅, 高さ)の順に数値を指定します。
# 初期値は(0, 0, 32, 32)です。幅と高さのどちらかが33未満の場合、
# 位置/サイズ強制指定は無効になります。
#
# □オートネームウィンドウ
# 設定箇所で定義した顔グラフィックが指定された場合、
# 自動でネームウィンドウを表示します。
# この機能によるネームウィンドウ表示をさせたくない時は、
# \NA[]とメッセージに記入してください。
#
# □メッセージ二倍速流し/高速メッセージスキップ
# 設定箇所で指定したボタンが押されている間、
# メッセージを高速でスキップします。
# 設定箇所で指定したスイッチをONにする事で
# 機能を無効にすることが可能です。
#
# □タイピングSE
# メッセージ描画時に効果音を鳴らせるようになります。
# 設定箇所で複数設定する事ができ、変数を使って鳴らす音を
# 変更する事が可能です。
#
# □スリムウィンドウ
# 16+16ピクセルを占める枠部分を縮めて、
# メッセージウィンドウをスリムに見せます。
# 設定箇所で指定したピクセル分だけウィンドウを縮めます。 
#
# □ポーズサイン位置変更
# ポーズサインの位置をある程度変更出来るようになります。
# (デフォルトのポーズサイン位置は下中央)
# 
# □顔グラフィックサイズ変更
# 顔グラフィック一枚あたりのサイズを変更する事が出来ます。
# 
# □フェードタイプ変更
# 通常の縦開閉タイプに加え、透明度を変化させるタイプの
# フェードイン/アウトに設定する事ができます。
#
# □Etc...
#
#==============================================================================
#
# ○追加機能案はいつでも受付中。なにかあったらどうぞ。
#  他のメッセージ系スクリプトとの併用が絶望的なので
#  「○○の△△を作ってくれー」とか言ってくれれば
#  出来る限り機能再現します。
#
#==============================================================================


#==============================================================================
# ★RGSS2
# STR22Core_メッセージウィンドウEXT++/本体 v1.2 08/02/17
# サポート:http://otsu.cool.ne.jp/strcatyou/
#
# ・メッセージ機能を大幅に拡張強化強化します。
# ・37種類もの制御文字を追加。コレを使いこなせる人はスゴイ。
# ・いろいろマニアックな仕様になっていますが、
#  その辺りは実際に使って覚えてください。
# ・えくすてんどぷらすぷらす、と読む。どうでもいい
# ※STR09と併用しないでください。STR09の機能はこのスクリプトに含まれています。
#
#------------------------------------------------------------------------------
#
# 更新履歴
# ◇1.1→1.2
# STR11bとうまく併用できないバグを修正・一部仕様改善
# ◇1.00→1.1
# バトルメッセージの挙動がおかしいバグを修正
# バグ修正ラッシュを想定して、このバージョンから設定箇所と分割。
# ◇0.95β→1.00
# フキダシアイコン表示の制御文字を追加(\U[n,m])
# 一部処理を軽量化・ポーズサインの座標指定の仕様変更
# ネームウィンドウのフォントをある程度指定できるようになった
# 設定箇所追加・地味に解像度変更に対応
# ふきだし反転判定のXY値が間違ってたバグを修正
# いろいろ
# ◇0.95β
# テストバージョン
#
#==============================================================================
# ■ Window_Message
#==============================================================================
class Window_Message < Window_Selectable
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化(エイリアス)
  #--------------------------------------------------------------------------
  alias initialize_str22 initialize
  def initialize
    # 初期設定
    initialize_vocab            # 用語リスト作成
    @mwextpp = true             # EXT判定
    @fade_type = FADE_TYPE      # フェードタイプ
    @indent_fx = 0              # 顔グラフィックによるインデント
    @pause_x = @pause_y = 0     # ポーズサイン座標
    shake_reset                 # シェイク
    @s_window_w = S_WINDOW_W
    @s_window_h = S_WINDOW_H
    # ポーズサインスプライト
    @pause_window = Sprite_STRPause.new
    # 同期ウィンドウ作成
    @slim_window = Window.new if S_WINDOW
    # ネームウィンドウ
    name = Cache.system("Window").clone
    name.clear_rect(80, 16, 32, 32)
    @name_sprite = Sprite.new
    @name_d_window = Window.new
    @name_d_window.width = 24
    @name_d_window.height = 24
    @name_d_window.windowskin = name
    @name_sprite.visible = false
    @name_d_window.visible = false
    # ふきだしスプライト
    @popup = Sprite.new
    @popup.bitmap = Cache.system(POPUP_FILE)
    @popup.src_rect.set(0, 0, 32, 64)
    @popup.visible = false
    # フェイススプライト
    @face_sprite = Sprite_STRFace.new(nil)
    # 呼び戻し
    initialize_str22
    # リサイズ
    self.x = WINDOW_RECT.x
    self.y = WINDOW_RECT.y
    self.width = WINDOW_RECT.width
    self.height = WINDOW_RECT.height
    # いろいろ初期化
    @w_opacity = 0              # 不透明度
    @face_lr = 0                # 顔グラフィック位置
    @contents_width = [0]       # 各行の幅
    @contents_y_line = [0]      # 選択肢用縦幅配列
    @e_color = 0                # 縁取りカラーインデックス
    @messe_wait = 0             # タイピングSEウェイト
    @popid = @popid_f = -99     # ポップアップ/ふきだしID
    @name_text = ""             # ネームウィンドウ
    @text_speed = 0             # 文章スピード
    @und_on = @str_on = false   # アンダーライン/打ち消し線ONフラグ
    reset_ext                   # 共通リセット
  end
  #--------------------------------------------------------------------------
  # ● 解放(エイリアス)
  #--------------------------------------------------------------------------
  alias dispose_str22 dispose
  def dispose
    # 呼び戻し
    dispose_str22
    # ポーズサイン・スリムウィンドウ・
    # ネームウィンドウ・フェイススプライト開放
    @pause_window.dispose
    @slim_window.dispose if S_WINDOW
    @name_sprite.bitmap.dispose if @name_sprite.bitmap != nil
    @name_sprite.dispose
    @name_d_window.dispose
    @face_sprite.bitmap.dispose if @face_sprite.bitmap != nil
    @face_sprite.dispose
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新(エイリアス)
  #--------------------------------------------------------------------------
  alias update_str22 update
  def update
    @messe_wait -= 1 if @messe_wait > 0 # SE再生間隔調整ウェイトを進める
    # フェード処理
    update_str22                        # 呼び戻し
    if @background == 0
      self.opacity = @w_opacity
    else
      self.opacity = 0
    end
    self.contents_opacity = @w_opacity
    @face_sprite.update                 # フェイススプライト更新
    update_shake                        # シェイク更新
    return unless $game_message.visible # メッセージ非表示ならリターン
    return unless (Graphics.frame_count % STR22100) == 0
    @pause_window.update if self.pause  # ポーズサイン更新
    # ネームスプライト・フェイススプライトの可視状態設定
    @name_sprite.visible = (self.openness == 255)
    @face_sprite.visible = @name_sprite.visible
    # キャラポップアップ中の場合、座標更新
    r = $game_message.xywh
    window_xy_update if @popid != -99 and (r.width <= 32 or r.height <= 32)
    # ふきだしの座標更新・可視状態設定
    window_xy_update_f if @popid_f != -99
    @popup.visible = false if self.opacity != 255
    # 数値入力(スクロールに対応させるため)
    number_xy_update if $game_message.num_input_variable_id > 0
  end
  #--------------------------------------------------------------------------
  # ● 背景スプライトの更新
  #--------------------------------------------------------------------------
  def update_back_sprite
    r = $game_message.xywh
    a = [self.openness, @w_opacity][FADE_TYPE]
    @back_sprite.visible = (@background == 1)
    @back_sprite.x = self.x + (self.width / 2)
    @back_sprite.y = self.y + (self.height / 2)
    @back_sprite.opacity = a
    @back_sprite.update
  end
  #--------------------------------------------------------------------------
  # ● ポップアップ用座標計算(追加)
  #--------------------------------------------------------------------------
  def window_xy_update
    # IDで分岐
    case @popid
    when -1 ; event = $game_player                             # プレイヤー
    when  0 ; event = $game_map.events[$game_message.event_id] # このイベント
    else    ; event = $game_map.events[@popid]                 # 指定イベントID
    end
    return if event == nil
    # X座標
    wx = event.screen_x - (self.width / 2)
    position = @position
    # プレイヤーの位置でポップアップ位置変更
    if @popid == 0
      if $game_player.screen_y >= event.screen_y
        position = 0
      else
        position = 2
      end
    end
    # ポジション別にY座標計算
    case position
    when 0  # 上
      @gold_window.y = 360
      # キャラクターの高さ
      if event.tile_id > 0
        pop_y = 32
      else
        b = Cache.character(event.character_name)
        sign = event.character_name[/^[\!\$]./]
        if sign != nil and sign.include?('$')
          pop_y = b.height / 4
        else
          pop_y = b.height / 8
        end
        pop_y -= 4 unless sign != nil and sign.include?('!')
      end
      pop_y += 16
      #
      wy = event.screen_y - self.height - pop_y
    when 1  # 中
      @gold_window.y = 0
      wy = event.screen_y - (self.height / 2)
    when 2  # 下
      @gold_window.y = 0
      wy = event.screen_y + 16
    end
    # 設定
    self.x = [[wx, STR22900[0] - self.width].min, 0].max
    self.y = [[wy, STR22900[1] - self.height].min, 0].max
  end
  #--------------------------------------------------------------------------
  # ● ふきだし座標計算(追加)
  #--------------------------------------------------------------------------
  def window_xy_update_f
    @popup.visible = false
    # IDで分岐
    case @popid_f
    when -1 ; event = $game_player                             # プレイヤー
    when  0 ; event = $game_map.events[$game_message.event_id] # このイベント
    else    ; event = $game_map.events[@popid_f]               # 指定イベントID
    end
    return if @popid_f == -2 or event == nil
    src_y = $game_variables[POPUP_TYPE_V] * 64
    @popup.visible = true if self.openness == 255
    if event.screen_y < self.y + (self.height / 2)
      position = 2
      @popup.src_rect.set(32, src_y, 32, 64)
      my = self.y - 32 + (@s_window_h / 2)
    else
      position = 0
      @popup.src_rect.set(0, src_y, 32, 64)
      my = self.y + self.height - 32 - (@s_window_h / 2)
    end
    x = event.screen_x - 16
    mx = self.x + 16 + (@s_window_w / 2)
    mw = self.x + self.width - 48 - (@s_window_w / 2)
    @popup.x = [[x, mw].min, mx].max
    @popup.y = my
    if POPUP_MIRROR
      case position
      when 0 ; @popup.mirror = (event.screen_x > @popup.x + 16)
      when 2 ; @popup.mirror = (event.screen_x > @popup.x + 16)
      end
      @popup.mirror ^= true if POPUP_LR == 1
    end
  end
  #--------------------------------------------------------------------------
  # ● 数値入力ウィンドウ座標セット
  #--------------------------------------------------------------------------
  def number_xy_update
    @number_input_window.x = self.x
    if @face_lr == 0 and not $game_message.face_name.empty?
      @number_input_window.x += FACE_SIZE[0] + FACE_SPACE
    end
    @number_input_window.y = self.y + @contents_y
  end
  #--------------------------------------------------------------------------
  # ● タイピングSE再生
  #--------------------------------------------------------------------------
  def typese_update
    if @messe_wait <= 0
      MESSAGE_SE[$game_variables[MESSE_VNUM]].play
      @messe_wait = MESSE_WAIT
      @messe_wait = $game_variables[MESSE_VWAI] if $game_variables[MESSE_VWAI] > 0
    end
  end
  #--------------------------------------------------------------------------
  # ● 文字揃えセット
  #--------------------------------------------------------------------------
  def align_set
    cx = @contents_x
    w = @contents_width[@line_count]
    w += FACE_SIZE[0] + FACE_SPACE if @face_lr == 1
    case @line_align[@line_count]
    when 1 ; @contents_x += (self.width - 32 - cx - w) / 2
    when 2 ; @contents_x += self.width - 32 - cx - w
    end
  end
  #--------------------------------------------------------------------------
  # ● 共通リセット(改ページ/改行)
  #--------------------------------------------------------------------------
  def reset_ext
    @maxtextsize = WLH           # 行中の最大テキストサイズ
    @line_show_fast = false      # 行早送り
    @font_index = 0              # フォントインデックス
    @font_size = DEFAULT_SIZE    # フォントサイズ
    @e_text = false              # 縁取りテキストフラグ
    @font_bold = false           # 太字フラグ
    @font_italic = false         # 斜体フラグ
    @bold_off = false            # 太字OFFフラグ
    @italic_off = false          # 斜体OFFフラグ
    @tx_und = false              # アンダーラインフラグ
    @tx_str = false              # 打ち消し線フラグ
    @r_mode = false              # ルビ描画モード
    @rbx = 0                     # ルビ開始X座標
    @rbw = 0                     # ルビ幅
  end
  #--------------------------------------------------------------------------
  # ● 改ページ処理(再定義)
  #--------------------------------------------------------------------------
  def new_page
    contents.clear                      # コンテンツクリア
    @contents_x = 0                     # 描画X座標
    @contents_y = 0                     # 描画Y座標
    @line_count = 0                     # 現在の行
    @show_fast = false                  # 早送り
    @pause_skip = false                 # ポーズを待たない
    # フェイススプライト設定
    @face_sprite.set_face("", 0, FACE_SIZE[0], FACE_SIZE[1])
    unless $game_message.face_name.empty?
      name = $game_message.face_name
      index = $game_message.face_index
      @face_sprite.set_face(name, index, FACE_SIZE[0], FACE_SIZE[1])
      @contents_x = FACE_SIZE[0] + FACE_SPACE if @face_lr == 0
    end
    @indent_fx = @contents_x            # インデント
    contents.font.color = text_color(0) # カラー初期化
    @e_color = 0                        # 縁取りカラー初期化
    @messe_wait = 0                     # タイピングSEウェイト
    @name_text = ""                     # ネームウィンドウを空に
    @text_speed = 0                     # 文章スピード
    reset_ext                           # 共通リセット
    align_set                           # 文字揃えセット
    self.x = self.x                     # ウィンドウを同期
  end
  #--------------------------------------------------------------------------
  # ● 改行処理(再定義)
  #--------------------------------------------------------------------------
  def new_line
    @contents_x = 0              # 描画X座標
    @contents_y += @maxtextsize  # 描画Y座標
    @line_count += 1             # 行を進める
    # フェイスによるインデントを設定
    unless $game_message.face_name.empty?
      @contents_x = FACE_SIZE[0] + FACE_SPACE if @face_lr == 0
    end
    reset_ext                    # 共通リセット
    align_set                    # 文字揃えセット
  end
  #--------------------------------------------------------------------------
  # ● メッセージの開始(エイリアス)
  #--------------------------------------------------------------------------
  alias start_message_str22 start_message
  def start_message
    start_message_str22
    Graphics.frame_reset if STR22101
  end
  #--------------------------------------------------------------------------
  # ● メッセージの終了(エイリアス)
  #--------------------------------------------------------------------------
  alias terminate_message_str22 terminate_message
  def terminate_message
    @face_sprite.animation_id = @face_sprite.loop_animation_id = 0
    @contents_y_line = [0]
    @popid = @popid_f = -99
    terminate_message_str22
  end
  #--------------------------------------------------------------------------
  # ● 特殊文字の変換(エイリアス)
  #--------------------------------------------------------------------------
  alias convert_special_characters_str22 convert_special_characters
  def convert_special_characters
    # 変数・マクロ
    @text.gsub!(/\\V\[([0-9]+)\]/i)    { $game_variables[$1.to_i] }
    @text.gsub!(/\\M\[([0-9]+)\]/i)    { MACRO[$1.to_i] }
    # 呼び戻し
    convert_special_characters_str22
    @text.gsub!(/\\g/)                 { "\x02" }
    # 現在のマップ名
    @text.gsub!(/\\MAP/i)              { $game_map.map_name_strextpp }
    # 用語
    @text.gsub!(/\\VO\[([0-9]+)\]/i)   { @vo[$1.to_i] }
    # アイコン・アイテム
    i = [$data_items, $data_weapons, $data_armors, $data_skills]
    @text.gsub!(/\\IT\[([0-9]+),([0-9]+)\]/i)   {
    "\\IC[#{i[$1.to_i][$2.to_i].icon_index.to_s}]\\IN[#{$1},#{$2}]" }
    @text.gsub!(/\\IC\[([0-9]+)\]/i)            { "\x10[#{$1}]" }
    @text.gsub!(/\\IN\[([0-9]+),([0-9]+)\]/i)   { i[$1.to_i][$2.to_i].name }
    # アニメーション
    @text.gsub!(/\\A\[([0-9]+),([0-9]+)\]/i)    { "\x11[#{[$1]},#{[$2]}]" }
    @text.gsub!(/\\A\[\-1,([0-9]+)\]/i)         { "\x11[9999,#{[$1]}]" }
    # バルーン
    @text.gsub!(/\\U\[([0-9]+),([0-9]+)\]/i)    { "\xb0[#{[$1]},#{[$2]}]" }
    @text.gsub!(/\\U\[\-1,([0-9]+)\]/i)         { "\xb0[9999,#{[$1]}]" }
    # 文字揃え
    @text.gsub!(/\\AL\[([0-9]+)\]/i)            { "\x12[#{$1}]" }
    # ルビ
    @text.gsub!(/\\R\[([^\[\]\s]+),([^\[\]\s]+)\]/i){ "\x98#{$1}\x99[#{$2}]" }
    # ネームウィンドウ
    @text.sub!(/\\NA\[([^\[\]\s]*)\]/i){ "\x89[#{$1}]]" }
    # フェイス
    @text.gsub!(/\\FR/i)               { "\x13" }
    @text.gsub!(/\\FM/i)               { "\x14" }
    @text.gsub!(/\\FC\[([^\[\]\s]+),([0-9]+)\]/i) { "\xa1[#{$1}][#{$2}]" }
    @text.gsub!(/\\FCM/i)              { "\xa2" }
    @text.gsub!(/\\FA\[([0-9]+)\]/i)   { "\x15[#{$1}]" }
    @text.gsub!(/\\FAL\[([0-9]+)\]/i)  { "\x16[#{$1}]" }
    @text.gsub!(/\\FLC\[([0-9]+)\]/i)  { "\x17[#{$1}]" }
    # メッセージ表示中移動・ストップ・ウェイト・文章スピード
    @text.gsub!(/\\MOVE/i)             { "\xa3" }
    @text.gsub!(/\\STOP/i)             { "\x18" }
    @text.gsub!(/\\W\[([0-9]+)\]/i)    { "\x94[#{$1}]" }
    @text.gsub!(/\\S\[([0-9]+)\]/i)    { "\x93[#{$1}]" }
    # フォント
    @text.gsub!(/\\E/i)                { "\x81" }
    @text.gsub!(/\\FS\[([0-9]+)\]/i)   { "\x82[#{$1}]" }
    @text.gsub!(/\\FS\[D\]/i)          { "\xa0" }
    @text.gsub!(/\\B/i)                { "\x83" }
    @text.gsub!(/\\I/i)                { "\x84" }
    @text.gsub!(/\\F\[([0-9]+)\]/i)    { "\x85[#{$1}]" }
    @text.gsub!(/\\CE\[([0-9]+)\]/i)   { "\x86[#{$1}]" }
    @text.gsub!(/\\UND/i)              { "\x95" }
    @text.gsub!(/\\STR/i)              { "\x96" }
    # ポップアップ・ふきだし
    @text.sub!(/\\P\[([0-9]+)\]/i)     { "\x87[#{$1}]" }
    @text.sub!(/\\P\[\-1+\]/i)         { "\x88" }
    @text.sub!(/\\PP\[([0-9]+)\]/i)    { "\x90[#{$1}]" }
    @text.sub!(/\\PP\[\-1+\]/i)        { "\x91" }
    @text.sub!(/\\PP\[\-2+\]/i)        { "\x92" }
    # シェイク
    @text.gsub!(/\\SH\[(\d+),(\d+),(\d+)\]/i) { "\xa4[#{[$1]},#{[$2]},#{[$3]}]" }
    # スイッチ/変数
    @text.gsub!(/\\SW\[(\d+),ON\]/i)      { "\xa5[#{$1}]" }
    @text.gsub!(/\\SW\[(\d+),OFF\]/i)     { "\xa6[#{$1}]" }
    @text.gsub!(/\\SW\[(\d+),RV\]/i)      { "\xa7[#{$1}]" }
    @text.gsub!(/\\VA\[(\d+),(\d+)\]/i)   { "\xa8[#{$1},#{$2}]" }
    @text.gsub!(/\\VA\[(\d+),\-(\d+)\]/i) { "\xa9[#{$1},#{$2}]" }
    # ネクスト
    @text.gsub!(/\\NEXT/i)                { "" }
    # 空白
    @text.gsub!(/\\SPIX\[([0-9]+)\]/i)    { "\x97[#{$1}]" }
  end
  #--------------------------------------------------------------------------
  # ● ウィンドウリセット-F(追加)
  #--------------------------------------------------------------------------
  def reset_window_f
    # 各行の文字揃え
    ar = []
    for i in 0..$game_message.maxlineex
      ar[i] = ALIGN
    end
    @line_align = ar
    # 更新ストップオフ
    $game_message.mapstop = false
    # フェイス
    @face_sprite.no_face = false    # カオナシフラグ アッアッアー
    @face_lr = 0                    # 顔位置
    @face_sprite.mirror = false     # 顔反転
    # バック・ポジション取得
    @background = $game_message.background
    @position   = $game_message.position
    # 透明ウィンドウなら透明に
    if @background != 0
      @w_opacity = 0
      self.opacity = @w_opacity
      if @background == 1
        @back_sprite.bitmap.dispose
        @back_sprite.bitmap = Cache.system(MESBACK_LIST[$game_variables[MESBACK_VA]])
        @back_sprite.ox = @back_sprite.bitmap.width / 2
        @back_sprite.oy = @back_sprite.bitmap.height / 2
      end
    end
    # 縦開閉フェードの場合不透明度255
    @w_opacity = 255 if FADE_TYPE == 0
    # 透明度変化フェードの場合オープン度255
    self.openness = 255 if FADE_TYPE == 1
    # オートネームウィンドウの設定
    if not $game_message.face_name.empty?
      name = $game_message.face_name + "_" + $game_message.face_index.to_s
      @name_text = A_N_WINDOW[name] if A_N_WINDOW[name] != nil
      if @name_text[/Actor\[(\d+)\]/i] != nil
        @name_text.sub(/Actor\[(\d+)\]/i, "")
        @name_text = $game_actors[$1.to_i].name
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● ネームウィンドウ設定(追加)
  #--------------------------------------------------------------------------
  def name_window_set
    # ネームウィンドウ設定
    @name_sprite.bitmap.dispose if @name_sprite.bitmap != nil
    @name_sprite.bitmap = nil
    unless @name_text.empty?
      # 計算用ダミービットマップ
      bitmap = Cache.system("")
      bitmap.font.name = N_WINDOW_FN
      bitmap.font.size = N_WINDOW_FS
      tw = bitmap.text_size(@name_text).width + 8
      # ビットマップ作成
      bitmap = Bitmap.new(tw, bitmap.font.size + 4)
      bitmap.font.name = N_WINDOW_FN
      bitmap.font.size = N_WINDOW_FS
      bitmap.font.color = N_WINDOW_CO
      unless N_WINDOW_ED
        bitmap.draw_text(0, 0, bitmap.width, bitmap.height, @name_text, 1)
      else
        co = N_WINDOW_CE
        bitmap.draw_text_f(0, 0, bitmap.width, bitmap.height, @name_text, 1, co)
      end
      # スプライト設定
      @name_sprite.bitmap = bitmap
      @name_sprite.ox = bitmap.width / 2
      @name_sprite.oy = bitmap.height / 2
      # ネームウィンドウリサイズ
      @name_d_window.width = bitmap.width + N_WINDOW_WH[0]
      @name_d_window.height = bitmap.height + N_WINDOW_WH[1]
    end
    # ネームウィンドウ可視状態設定
    @name_d_window.visible = (self.visible and not @name_text.empty?)
  end
  #--------------------------------------------------------------------------
  # ● ウィンドウリセット
  #--------------------------------------------------------------------------
  def reset_window
    reset_window_f    # ウィンドウリセット-F
    shake_reset       # シェイク
    # いろいろ初期化
    ar = []
    for i in 0..$game_message.maxlineex
      ar[i] = 0
    end
    @pause_x = @pause_y = 0             # ポーズサイン座標
    @rb_h = ar                          # ルビ高さ
    str_line_size = 0                   # ライン
    contents_x = [0]                    # X配列
    contents_y = [0]                    # Y配列
    text = @text.clone                  # テキスト
    maxtextsize = WLH                   # 最大テキストサイズ
    font_size = DEFAULT_SIZE            # フォントサイズ
    font_index = 0                      # フォント
    e_text = false                      # 縁取り
    font_bold = false                   # 太字
    bold_off = false                    # 太字OFFフラグ
    font_italic = false                 # 斜体
    italic_off = false                  # 斜体OFFフラグ
    #-----------------------------------------------------------
    # ★ 内容先読みループ/ウィンドウサイズ等を正確に割り出す
    loop do
      c = text.slice!(/./m)             # 次の文字を取得
      case c
      when nil ; break                  # 残りの文字が無い場合、ループ中断
      when "\x02"                       # \G  (所持金表示)
      when "\x03"                       # \.  (ウェイト 1/4 秒)
      when "\x04"                       # \|  (ウェイト 1 秒)
      when "\x05"                       # \!  (入力待ち)
      when "\x06"                       # \>  (瞬間表示 ON)
      when "\x07"                       # \<  (瞬間表示 OFF)
      when "\x08"                       # \^  (入力待ちなし)
      when "\x01" ;text.sub!(/\[([0-9]+)\]/, "")   # \C[n]  (文字色変更)
      when "\x81" ;e_text ^= true                  # \E
      when "\x88" ;@popid = @popid_f =  -1         # \P[-1]
      when "\x91" ;@popid_f = -1                   # \PP[-1]
      when "\x92" ;@popid_f = -2                   # \PP[-2]
      when "\x93" ;text.sub!(/\[([0-9]+)\]/, "")   # \S[n]
      when "\x94" ;text.sub!(/\[([0-9]+)\]/, "")   # \W[n]
      when "\x95"                                  # \UND
      when "\x96"                                  # \STR
      when "\x11" ;text.sub!(/\[([0-9]+)\,([0-9]+)\]/, "")# \A[n]
      when "\xb0" ;text.sub!(/\[([0-9]+)\,([0-9]+)\]/, "")# \U[n]
      when "\x13" ;@face_lr = 1                    # \FR
      when "\x14" ;@face_sprite.mirror = true      # \FM
      when "\x15" ;text.sub!(/\[([0-9]+)\]/, "")   # \FA[n]
      when "\x16" ;text.sub!(/\[([0-9]+)\]/, "")   # \FAL[n]
      when "\x18" ;$game_message.mapstop = true    # \STOP
      when "\x98"                                  # \R
      when "\xa0" ;font_size = DEFAULT_SIZE        # \FS[d]
      when "\xa1" ;text.sub!(/\[([^\[\]\s]+)\]\[([0-9]+)\]/, "")# \FC[n,m]
      when "\xa2"                                  # \FCM
      when "\xa4" ;text.sub!(/\[\d+,\d+,\d+\]/, "")# \SH[p,s,d]
      when "\xa5" ;text.sub!(/\[\d+\]/, "")        # \SW[id,ON]
      when "\xa6" ;text.sub!(/\[\d+\]/, "")        # \SW[id,OFF]
      when "\xa7" ;text.sub!(/\[\d+\]/, "")        # \SW[id,RV]
      when "\xa8" ;text.sub!(/\[\d+,\d+\]/, "")    # \VA[id,n]
      when "\xa9" ;text.sub!(/\[\d+,\d+\]/, "")    # \VA[id,n]
      when "\x00"                       # 改行
        contents_x[str_line_size] += font_size / STR22002 + 2 if font_italic or italic_off
        str_line_size += 1
        contents_x[str_line_size] = 0
        contents_y[str_line_size] = 0
        contents_y[str_line_size] += maxtextsize + @rb_h[str_line_size - 1]
        maxtextsize = WLH               # 最大テキストサイズ
        font_size = DEFAULT_SIZE        # フォントサイズ
        font_index = 0                  # フォント
        e_text = false                  # 縁取り
        font_bold = bold_off = false    # 太字
        font_italic = italic_off = false# 斜体
        if str_line_size >= $game_message.maxlineex # 行数が最大のとき
          break unless text.empty?      # ループ中断
        end
      when "\x82"                                  # \FS[n]
        text.sub!(/\[([0-9]+)\]/, "")
        font_size = $1.to_i
      when "\x83"                                  # \B
        bold_off = true if font_bold
        font_bold ^= true
      when "\x84"                                  # \I
        italic_off = true if font_italic
        font_italic ^= true
      when "\x85"                                  # \F[n]
        text.sub!(/\[([0-9]+)\]/, "")
        font_index = $1.to_i
      when "\x86"                                  # \CE[n]
        text.sub!(/\[([0-9]+)\]/, "")
        e_color = $1.to_i
      when "\x87"                                  # \P[n]
        text.sub!(/\[([0-9]+)\]/, "")
        @popid = @popid_f = $1.to_i
      when "\x90"                                  # \PP[n]
        text.sub!(/\[([0-9]+)\]/, "")
        @popid_f = $1.to_i
      when "\x89"                                  # \NA[s]
        text.sub!(/\[([^\[\]\s]*)\]\]/, "")
        @name_text = $1
      when "\x97"                                  # \SPIX[n]
        text.sub!(/\[([0-9]+)\]/, "")
        contents_x[str_line_size] += $1.to_i
      when "\x10"                                  # \IC[n]
        text.sub!(/\[([0-9]+)\]/, "")
        contents_x[str_line_size] += STR22009
      when "\x12"                                  # \AL[n]
        text.sub!(/\[([0-9]+)\]/, "")
        @line_align[str_line_size] = $1.to_i
      when "\x17"                                  # \FLC[n]
        text.sub!(/\[([0-9]+)\]/, "")
        @face_sprite.loop_animation_id = $1.to_i
        @face_sprite.no_face = true
      when "\xa3"                                  # \MOVE
        $game_message.mes_move = $game_switches[MESMOVE] = true
        $game_map.need_refresh = true
      when "\x99"                                  # \R
        text.sub!(/\[([^\[\]\s]+)\]/, "")
        size = (font_size / STR22008)
        @rb_h[str_line_size] = size if size > @rb_h[str_line_size]
      else                                         # 普通の文字
        # 字体別文字幅修正
        unless italic_off
          iw = 0
        else
          iw = contents.font.size / STR22000
          italic_off = false
        end
        if bold_off
          iw += contents.font.size / STR22001
          bold_off = false
        end
        # フォント設定読み込み
        contents.font.name = FONTLIST[font_index]
        contents.font.size = font_size
        contents.font.bold = font_bold
        contents.font.italic = font_italic
        maxtextsize = font_size if font_size > maxtextsize
        wlh = maxtextsize
        contents.font.bold = false
        c_width = contents.text_size(c).width + iw
        contents_x[str_line_size] += c_width
      end
    end
    # ★ 内容先読みループ ここまで
    #-----------------------------------------------------------
    # ネームウィンドウ設定
    name_window_set
    # 顔グラフィックを表示するか
    face = (not $game_message.face_name.empty?)
    # 高さを求める
    h = 0
    for i in contents_y
      h += i
    end
    # フェイス表示時の高さが足りない場合
    h = WINDOW_RECT.height - 32 if face and (32 + h < WINDOW_RECT.height)
    if $game_message.xywh.width > 32 and $game_message.xywh.height > 32
      # 強制位置設定/リサイズ
      self.x = $game_message.xywh.x
      self.y = $game_message.xywh.y
      self.width = $game_message.xywh.width
      self.height = $game_message.xywh.height
    elsif @popid != -99 # ポップアップが有効な場合
      # 幅を求める
      w = contents_x[0]
      if contents_x.size > 2
        for i in 1...contents_x.size
          w = contents_x[i] if contents_x[i] > w
        end
      end
      # 数値入力位置修正
      input = ($game_message.num_input_variable_id > 0)
      input_w = 50 + (16 * $game_message.num_input_digits_max)
      if face
        indent = FACE_SIZE[0] + FACE_SPACE
        w += indent
        w = input_w + indent if input and w < input_w + indent
      else
        w = input_w if input and w < input_w
      end
      # リサイズ
      self.width = 32 + w
      self.height = 32 + h
      window_xy_update
    else
      # 通常ウィンドウ(ポップアップ無し)
      h = WINDOW_RECT.height - 32 if 32 + h < WINDOW_RECT.height
      self.width = WINDOW_RECT.width
      self.height = 32 + h
      self.x = WINDOW_RECT.x
      # ポジション別座標設定
      @gold_window.y = 0
      self.y = 0
      case @position
      when 0 ; @gold_window.y = STR22900[1] - 56
      when 1 ; self.y = (STR22900[1] / 2) - (self.height / 2)
      when 2 ; self.y = STR22900[1] - self.height
      end
    end
    # XY座標幅高さの情報格納
    @contents_width = contents_x
    @contents_y_line[0] = []
    @contents_y_line[1] = contents_y
    for i in 0...contents_y.size
      @contents_y_line[0][i] = 0
      for l in 0..i
        @contents_y_line[0][i] += contents_y[l]
      end
    end
    create_contents      # コンテンツ作成
  end
  #--------------------------------------------------------------------------
  # ● メッセージの更新(再定義)
  #--------------------------------------------------------------------------
  def update_message
    loop do
      @wait_count = @text_speed if @wait_count <= 0
      c = @text.slice!(/./m)            # 次の文字を取得
      case c
      when nil                          # 描画すべき文字がない
        finish_message                  # 更新終了
        break
      when "\x00"                       # 改行
        new_line
        if @line_count >= $game_message.maxlineex # 行数が最大のとき
          unless @text.empty?           # さらに続きがあるなら
            self.pause = true           # 入力待ちを入れる
            break
          end
        end
      when "\x06" ;@line_show_fast = true         # \>  (瞬間表示 ON)
      when "\x07" ;@line_show_fast = false        # \<  (瞬間表示 OFF)
      when "\x08" ;@pause_skip = true             # \^  (入力待ちなし)
      when "\x88" ;next                           # \P[-1]
      when "\x91" ;next                           # \PP[-1]
      when "\x92" ;next                           # \PP[-2]
      when "\x13" ;next                           # \FR 
      when "\x14" ;next                           # \FM
      when "\x17" ;@text.sub!(/\[([0-9]+)\]/, "") # \FLC[n]
      when "\x18" ;next                           # \STOP
      when "\xa3" ;next                           # \MOVE
      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 "\x81"                       # \E
        @e_text ^= true
        next
      when "\x82"                       # \FS[n]
        @text.sub!(/\[([0-9]+)\]/, "")
        @font_size = $1.to_i
        next
      when "\xa0"                       # \FS[d]
        @font_size = DEFAULT_SIZE
        next
      when "\x83"                       # \B
        @bold_off = true if @font_bold
        @font_bold ^= true
        next
      when "\x84"                       # \I
        @italic_off = true if @font_italic
        @font_italic ^= true
        next
      when "\x85"                       # \F[n]
        @text.sub!(/\[([0-9]+)\]/, "")
        @font_index = $1.to_i
        next
      when "\x86"                       # \HC[n]
        @text.sub!(/\[([0-9]+)\]/, "")
        @e_color = $1.to_i
        next
      when "\x87"                       # \P[n]
        @text.sub!(/\[([0-9]+)\]/, "")
        next
      when "\x90"                       # \PP[n]
        @text.sub!(/\[([0-9]+)\]/, "")
        next
      when "\x89"                       # \NA[s]
        @text.sub!(/\[([^\[\]\s]*)\]\]/, "")
        next
      when "\x93"                       # \S[n]
        @text.sub!(/\[([0-9]+)\]/, "")
        @text_speed = $1.to_i
        break
      when "\x94"                       # \W[n]
        @text.sub!(/\[([0-9]+)\]/, "")
        @wait_count = $1.to_i
        break
      when "\x95"                       # \UND
        @tx_und ^= true
        @und_on = true if @tx_und
        next
      when "\x96"                       # \STR
        @tx_str ^= true
        @str_on = true if @tx_str
        next
      when "\x97"                       # \SPIX[n]
        @text.sub!(/\[([0-9]+)\]/, "")
        @contents_x += $1.to_i
        next
      when "\xa4"                       # \SH[p,s,d]
        @text.sub!(/\[(\d+),(\d+),(\d+)\]/, "")
        start_shake($1.to_i, $2.to_i, $3.to_i)
        next
       
      when "\xa5"                       # \SW
        @text.sub!(/\[([0-9]+)\]/, "")
        $game_switches[$1.to_i] = true
        $game_map.need_refresh = true
        next
      when "\xa6"                       # \SW
        @text.sub!(/\[([0-9]+)\]/, "")
        $game_switches[$1.to_i] = false
        $game_map.need_refresh = true
        next
      when "\xa7"                       # \SW
        @text.sub!(/\[([0-9]+)\]/, "")
        $game_switches[$1.to_i] ^= true
        $game_map.need_refresh = true
        next
      when "\xa8"                       # \VA
        @text.sub!(/\[([0-9]+),([0-9]+)\]/, "")
        $game_variables[$1.to_i] = $2.to_i
        $game_map.need_refresh = true
        next
      when "\xa9"                       # \VA
        @text.sub!(/\[([0-9]+),([0-9]+)\]/, "")
        $game_variables[$1.to_i] = -($2.to_i)
        $game_map.need_refresh = true
        next
      when "\x10"                       # \IC[n]
        @text.sub!(/\[([0-9]+)\]/, "")
        wlh = @contents_y_line[1][@line_count+1] / 2
        draw_icon($1.to_i, @contents_x, @contents_y + @rb_h[@line_count] + wlh - (STR22009 / 2))
        @contents_x += STR22009
        typese_update
      when "\x11"                       # \A[n,m]
        @text.sub!(/\[([0-9]+)\,([0-9]+)\]/, "")
        case $1.to_i
        when 9999 ; event = $game_player
        when 0    ; event = $game_map.events[$game_message.event_id]
        else      ; event = $game_map.events[$1.to_i]
        end
        event.animation_id = $2.to_i
      when "\xb0"                       # \U[n,m]
        @text.sub!(/\[([0-9]+)\,([0-9]+)\]/, "")
        case $1.to_i
        when 9999 ; event = $game_player
        when 0    ; event = $game_map.events[$game_message.event_id]
        else      ; event = $game_map.events[$1.to_i]
        end
        event.balloon_id = $2.to_i
      when "\x12"                       # \AL[n]
        @text.sub!(/\[([0-9]+)\]/, "")
        next
      when "\xa1"                       # \FC[n,m]
        @text.sub!(/\[([^\"\[\]\s]+)\]\[([0-9]+)\]/, "")
        unless $game_message.face_name.empty?
          @face_sprite.set_face($1, $2.to_i, FACE_SIZE[0], FACE_SIZE[1])
        end
        next
      when "\xa2"                       # \FCM
        @face_sprite.mirror ^= true
        next
      when "\x15"                       # \FA[n]
        @text.sub!(/\[([0-9]+)\]/, "")
        @face_sprite.animation_id = $1.to_i
      when "\x16"                       # \FAL[n]
        @text.sub!(/\[([0-9]+)\]/, "")
        @face_sprite.loop_animation_id = $1.to_i
      when "\x98"                       # \R
        @r_mode = true
        @rbx = @contents_x
        @rbw = 0
        next
      when "\x99"                       # \R
        @r_mode = false
        @text.sub!(/\[([^\[\]\s]+)\]/, "")
        contents.font.name = FONTLIST[@font_index]
        contents.font.size = (@font_size / 2)
        contents.font.bold = @font_bold
        contents.font.italic = @font_italic
        rw = @contents_y_line[1][@line_count+1] / 2
        rby = @contents_y + @rb_h[@line_count] + rw - (contents.font.size * 2)
        unless @e_text
          contents.draw_text(@rbx, rby, @rbw, contents.font.size, $1, 1)
        else
          # 縁取りON
          co = EDGE_COLOR[@e_color]
          contents.draw_text_f(@rbx, rby, @rbw, contents.font.size, $1, 1, co)
        end
        next
      else                              # 普通の文字
        # いろいろ
        @maxtextsize = wlh = @contents_y_line[1][@line_count+1]
        iw = font_w
        yy = @contents_y + @rb_h[@line_count]
        ww = @font_size + 8
        # 内容描画
        draw_message22_text(iw,yy,ww,wlh,c)     # 通常文字の描画
        draw_message22_und(iw,wlh,c) if @tx_und # アンダーライン
        draw_message22_str(iw,wlh,c) if @tx_str # 打ち消し線
        typese_update                           # タイピングSE
        # 幅加算
        contents.font.bold = false
        c_width = contents.text_size(c).width + iw
        @contents_x += c_width
        @rbw += c_width if @r_mode              # ルビ用文字幅
      end
      break unless @show_fast or @line_show_fast
    end
  end
  #--------------------------------------------------------------------------
  # ● 字体別文字幅修正
  #--------------------------------------------------------------------------
  def font_w
    unless @italic_off
      iw = 0
    else
      iw = contents.font.size / STR22000
      @italic_off = false
    end
    if @bold_off
      iw += contents.font.size / STR22001
      @bold_off = false
    end
    return iw
  end
  #--------------------------------------------------------------------------
  # ● 通常文字の描画
  #--------------------------------------------------------------------------
  def draw_message22_text(iw,yy,ww,wlh,c)
    # フォント設定読み込み
    contents.font.name = FONTLIST[@font_index]
    contents.font.size = @font_size
    contents.font.bold = @font_bold
    contents.font.italic = @font_italic
    # 文字描画
    unless @e_text
      contents.draw_text(@contents_x + iw, yy, ww, wlh, c)
    else
      # 縁取りON
      co = EDGE_COLOR[@e_color]
      contents.draw_text_f(@contents_x + iw, yy, ww, wlh, c, 0, co)
    end
  end
  #--------------------------------------------------------------------------
  # ● アンダーラインの描画
  #--------------------------------------------------------------------------
  def draw_message22_und(iw,wlh,c)
    unless @e_text
      rect = Rect.new(@contents_x + iw,@contents_y+(wlh-2),
                      contents.text_size(c).width + iw,1)
      oc = contents.font.color
      r_color = Color.new(oc.red, oc.green, oc.blue, oc.alpha)
      contents.fill_rect(rect, r_color)
      rect.y += 1
      r_color.alpha /= STR22007
      contents.fill_rect(rect, r_color)
    else
      rect = Rect.new(@contents_x + iw + 1,@contents_y+(wlh-3),
                      contents.text_size(c).width + iw,1)
      oc = EDGE_COLOR[@e_color]
      r_color = Color.new(oc.red, oc.green, oc.blue, oc.alpha - 16)
      contents.fill_rect(rect, r_color)
      rect.x -= 1
      rect.y += 1
      if @und_on
        a = rect.width
        rect.width = 1
        contents.fill_rect(rect, r_color)
        rect.width = a
      end
      rect.x += 2
      contents.fill_rect(rect, r_color)
      rect.x -= 1
      rect.y += 1
      contents.fill_rect(rect, r_color)
      rect.y -= 1
      oc = contents.font.color
      r_color = Color.new(oc.red, oc.green, oc.blue, oc.alpha)
      contents.fill_rect(rect, r_color)
    end
    @und_on = false
  end
  #--------------------------------------------------------------------------
  # ● 打ち消し線の描画
  #--------------------------------------------------------------------------
  def draw_message22_str(iw,wlh,c)
    unless @e_text
      rect = Rect.new(@contents_x + iw,@contents_y+(wlh/2),
                      contents.text_size(c).width + iw,1)
      oc = contents.font.color
      r_color = Color.new(oc.red, oc.green, oc.blue, oc.alpha)
      contents.fill_rect(rect, r_color)
      rect.y += 1
      r_color.alpha /= STR22007
      contents.fill_rect(rect, r_color)
    else
      rect = Rect.new(@contents_x + iw + 1,@contents_y+(wlh/2),
                      contents.text_size(c).width + iw,1)
      oc = EDGE_COLOR[@e_color]
      r_color = Color.new(oc.red, oc.green, oc.blue, oc.alpha - 16)
      contents.fill_rect(rect, r_color)
      rect.x -= 1
      rect.y += 1
      if @str_on
        a = rect.width
        rect.width = 1
        contents.fill_rect(rect, r_color)
        rect.width = a
      end
      rect.x += 2
      contents.fill_rect(rect, r_color)
      rect.x -= 1
      rect.y += 1
      contents.fill_rect(rect, r_color)
      rect.y -= 1
      oc = contents.font.color
      r_color = Color.new(oc.red, oc.green, oc.blue, oc.alpha)
      contents.fill_rect(rect, r_color)
    end
    @str_on = false
  end
  #--------------------------------------------------------------------------
  # ● シェイクの開始
  #--------------------------------------------------------------------------
  def start_shake(power, speed, duration)
    @shake_power = power
    @shake_speed = speed
    @shake_duration = duration
  end
  #--------------------------------------------------------------------------
  # ● シェイクリセット
  #--------------------------------------------------------------------------
  def shake_reset
    @shake = @shake_power = 0
    @shake_speed = @shake_duration = 0
    @shake_direction = 1
  end
  #--------------------------------------------------------------------------
  # ● シェイクの更新
  #--------------------------------------------------------------------------
  def update_shake
    if @shake_duration >= 1 or @shake != 0
      delta = (@shake_power * @shake_speed * @shake_direction) / 10.0
      if @shake_duration <= 1 and @shake * (@shake + delta) < 0
        @shake = 0
      else
        @shake += delta
      end
      if @shake > @shake_power * 2
        @shake_direction = -1
      end
      if @shake < - @shake_power * 2
        @shake_direction = 1
      end
      if @shake_duration >= 1
        @shake_duration -= 1
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● ウィンドウを開く
  #--------------------------------------------------------------------------
  def open
    a = [self.openness, @w_opacity][FADE_TYPE]
    @opening = true if a < 255
    @closing = false
  end
  #--------------------------------------------------------------------------
  # ● ウィンドウを閉じる
  #--------------------------------------------------------------------------
  def close
    a = [self.openness, @w_opacity][FADE_TYPE]
    @closing = true if a > 0
    @opening = false
    if a == 0
      t = $game_switches[MESMOVE]
      $game_message.mes_move = $game_switches[MESMOVE] = false
      $game_map.need_refresh = true if t != $game_switches[MESMOVE]
    end
  end
  #--------------------------------------------------------------------------
  # ● 次のメッセージを続けて表示するべきか判定
  #--------------------------------------------------------------------------
  def continue?
    a = [self.openness, @w_opacity][FADE_TYPE]
    return true if $game_message.num_input_variable_id > 0
    return false if $game_message.texts.empty?
    if a > 0 and not $game_temp.in_battle
      return false if @background != $game_message.background
      return false if @position != $game_message.position
    end
    return true
  end
  #--------------------------------------------------------------------------
  # ★ エイリアス
  #--------------------------------------------------------------------------
  alias finish_message_str09m finish_message
  def finish_message
    finish_message_str09m
    @wait_count = F_WAIT
  end
  alias update_message_str09m update_message
  def update_message
    fast = (not $game_switches[PSID] and not $game_switches[FSID] and Input.press?(FAST_B))
    if F_AUTO
      update_message_str09m
      update_message_str09m if @wait_count <= 0 and @text != nil
      update_message_str09m if @wait_count <= 0 and @text != nil and fast
      update_message_str09m if @wait_count <= 0 and @text != nil and fast
    else
      update_message_str09m
      update_message_str09m if @wait_count <= 0 and @text != nil and fast
    end
  end
  #--------------------------------------------------------------------------
  # ● 早送りフラグの更新(再定義)
  #--------------------------------------------------------------------------
  def update_show_fast
    return if $game_switches[PSID]
    id = (not $game_switches[SSID])
    a = [self.openness, @w_opacity][FADE_TYPE]
    if self.pause or a < 255
      @show_fast = false
    elsif (Input.trigger?(Input::C) or (Input.press?(SKIP_B) and id))
      @show_fast = true
    elsif not Input.press?(Input::C)
      @show_fast = false
    end
    @wait_count = 0 if @show_fast and @wait_count > 0
  end
  #--------------------------------------------------------------------------
  # ● 文章送りの入力処理(再定義)
  #--------------------------------------------------------------------------
  def input_pause
    id = (not $game_switches[SSID])
    if Input.trigger?(Input::B) or Input.trigger?(Input::C) or
       (Input.press?(SKIP_B) and id)
      self.pause = false
      if @text != nil and not @text.empty?
        new_page if @line_count >= $game_message.maxlineex
      else
        terminate_message
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● カーソルの更新(再定義)
  #--------------------------------------------------------------------------
  def update_cursor
    if @index >= 0
      x = $game_message.face_name.empty? ? 0 : FACE_SIZE[0] + FACE_SPACE
      y = @contents_y_line[0][$game_message.choice_start + @index]
      h = @contents_y_line[1][$game_message.choice_start + @index + 1]
      self.cursor_rect.set(x, y, contents.width - x, h)
    else
      self.cursor_rect.empty
    end
  end
  #--------------------------------------------------------------------------
  # ● ダミーウィンドウ同期(追加)
  #--------------------------------------------------------------------------
  # リーダー
  def pause
    @pause_window.pause
  end
  def opacity
    if S_WINDOW
      return @slim_window.opacity
    else
      super
    end
  end
  def visible
    if S_WINDOW
      return @slim_window.visible
    else
      super
    end
  end
  # アクセサ
  def windowskin=(a)
    super
    @slim_window.windowskin = a if S_WINDOW
  end
  def viewport=(a)
    super
    @name_d_window.viewport = @pause_window.viewport = a
    @slim_window.viewport = a if S_WINDOW
    @face_sprite.viewport = a
  end
  def active=(a)
    super
    @slim_window.active = a if S_WINDOW
  end
  def visible=(a)
    super
    @pause_window.visible = a if self.visible and @pause_window.pause
    @face_sprite.visible = a
    @slim_window.visible = a if S_WINDOW
  end
  def pause=(a)
    @pause_window.pause = a
  end
  def x=(a)
    a += @shake
    super(a)
    @indent_fx = 0 unless N_WINDOW_IX
    @name_d_window.x = a + N_WINDOW_XY[0] + @indent_fx
    @name_sprite.x = (a + N_WINDOW_XY[0]) + (@name_d_window.width / 2) + @indent_fx
    @slim_window.x = a + (@s_window_w / 2) if S_WINDOW
    case P_WINDOW
    when 0 ; @pause_window.x = a + (self.width / 2) - 12 + P_WINDOW_XY[0]
    when 1 ; @pause_window.x = a + self.width - 12 + P_WINDOW_XY[0]
    end
    case @face_lr
    when 0 ; @face_sprite.x = self.x + 16 + (FACE_SIZE[0] / 2) + FACE_XY[0]
    when 1 ; @face_sprite.x = self.x + self.width - 16 - (FACE_SIZE[0] / 2) + FACE_XY[0]
    end
  end
  def y=(a)
    super
    @name_d_window.y = a + N_WINDOW_XY[1]
    @name_sprite.y = (a + N_WINDOW_XY[1]) + (@name_d_window.height / 2)
    @slim_window.y = a + (@s_window_h / 2) if S_WINDOW
    @pause_window.y = a + self.height - 12 + P_WINDOW_XY[1]
    case FACE_Y
    when 0 ; @face_sprite.y = self.y + 16 + (FACE_SIZE[1] / 2) + FACE_XY[1]
    when 1 ; @face_sprite.y = self.y + (self.height / 2) + FACE_XY[1]
    when 2 ; @face_sprite.y = self.y + self.height - 16 - (FACE_SIZE[1] / 2) + FACE_XY[1]
    end
  end
  def width=(a)
    super
    @slim_window.width = a - @s_window_w if S_WINDOW
  end
  def height=(a)
    super
    @slim_window.height = a - @s_window_h if S_WINDOW
  end
  def z=(a)
    super
    @name_sprite.z = a + 6
    @name_d_window.z = a + 5
    @popup.z = a
    @pause_window.z = a + 10
    @slim_window.z = a - 10 if S_WINDOW
    @face_sprite.z = a + 4
  end
  def opacity=(a)
    if S_WINDOW
      super(0)
      @slim_window.opacity = a
    else
      super
    end
    if N_WINDOW_1V
      @name_d_window.opacity = a * (N_WINDOW_OPC / 100.0)
    elsif @background == 1
      @name_d_window.opacity = @w_opacity
    else
      @name_d_window.opacity = a * (N_WINDOW_OPC / 100.0)
    end
  end
  def back_opacity=(a)
    if S_WINDOW
      super(0)
      @slim_window.back_opacity = a
    else
      super
    end
    @name_d_window.back_opacity = a
  end
  def contents_opacity=(a)
    super
    @name_d_window.contents_opacity = a
    @slim_window.contents_opacity = a if S_WINDOW
    @name_sprite.opacity = @face_sprite.opacity = a
  end
  def openness=(a)
    super
    @name_d_window.openness = a
    @slim_window.openness = a if S_WINDOW
  end
end
#==============================================================================
# ■ Window_BattleMessage
#==============================================================================
class Window_BattleMessage < Window_Message
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  alias initialize_btm_str22 initialize
  def initialize
    initialize_btm_str22
    @mode = BTMESMODE
    @str22maxline = $game_message.maxlineex
    $game_message.maxlineex = 4
    @s_window_w = 0
    @s_window_h = 0
    @slim_window.opacity = 0
    btm_str22resize
  end
  #--------------------------------------------------------------------------
  # ● 解放
  #--------------------------------------------------------------------------
  alias dispose_btm_str22 dispose
  def dispose
    $game_message.maxlineex = @str22maxline
    dispose_btm_str22
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  alias update_str22bt update
  def update
    update_str22bt
    self.openness = 255
    self.opacity = 0 if @mode == 1
    @w_opacity = 255
  end
  #--------------------------------------------------------------------------
  # ● ウィンドウの背景と位置の設定 (無効化)
  #--------------------------------------------------------------------------
  alias reset_window_str22bt reset_window
  def reset_window
    #reset_window_str22bt
    super
    if @b_sprite != nil
      self.x = 0
      self.y = 0
      @position = 0
      self.opacity = 0
    end
    btm_str22resize
    create_contents
  end
  #--------------------------------------------------------------------------
  # ● メッセージの終了
  #--------------------------------------------------------------------------
  alias terminate_message_str22bt terminate_message
  def terminate_message
    terminate_message_str22bt
    btm_str22resize
    @face_sprite.set_face("", 0, FACE_SIZE[0], FACE_SIZE[1])
    @name_sprite.bitmap.dispose if @name_sprite.bitmap != nil
    @name_sprite.bitmap = nil
    @name_d_window.visible = false
  end
  #--------------------------------------------------------------------------
  # ● リサイズ
  #--------------------------------------------------------------------------
  def btm_str22resize
    self.width = Window_Message::STR22900[0]
    self.height = 128
    self.x = 0
    if @mode == 0
      self.y = Window_Message::STR22900[1] - 128
    else
      self.y = 0
    end
  end
end
#==============================================================================
# ■ Window_NumberInput
#==============================================================================
class Window_NumberInput < Window_Base
  def y=(a)
    super(a-24)
  end
end
#==============================================================================
# ■ Window_Base
#==============================================================================
class Window_Base < Window
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  alias update_str22_base update
  def update
    if @mwextpp and @fade_type == 1
      super
      if @opening
        @w_opacity = [[@w_opacity + Window_Message::STR22011, 255].min, 0].max
        @opening = false if @w_opacity == 255
      elsif @closing
        @w_opacity = [[@w_opacity - Window_Message::STR22011, 255].min, 0].max
        @closing = false if @w_opacity == 0
      end
    else
      update_str22_base
    end
  end
end
#==============================================================================
# ■ Bitmap
#==============================================================================
class Bitmap
  #--------------------------------------------------------------------------
  # ● 文字縁取り描画
  #--------------------------------------------------------------------------
  def draw_text_f(x, y, width, height, str, align = 0, color = Color.new(64,32,128))
    shadow = self.font.shadow
    b_color = self.font.color.dup
    font.shadow = false
    font.color = color
    draw_text(x + 1, y, width, height, str, align)
    draw_text(x - 1, y, width, height, str, align)
    draw_text(x, y + 1, width, height, str, align)
    draw_text(x, y - 1, width, height, str, align)
    font.color = b_color
    draw_text(x, y, width, height, str, align)
    font.shadow = shadow
  end
  def draw_text_f_rect(r, str, align = 0, color = Color.new(64,32,128))
    draw_text_f(r.x, r.y, r.width, r.height, str, align = 0, color)
  end
end
#==============================================================================
# ■ Sprite_STRPause
#==============================================================================
class Sprite_STRPause < Sprite
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize(viewport = nil)
    super(viewport)
    w = Cache.system("Window")
    r = [Rect.new(96, 64, 32, 16), Rect.new(96, 80, 32, 16)]
    bitmap = Bitmap.new(64, 16)
    bitmap.blt(0, 0, w, r[0])
    bitmap.blt(32, 0, w, r[1])
    self.ox = -8
    self.oy = -8
    self.bitmap = bitmap
    self.visible = false
    self.src_rect.set(0, 0, 16, 16)
    @count = 0
    @wait = Window_Message::STR22010
  end
  #--------------------------------------------------------------------------
  # ● 解放
  #--------------------------------------------------------------------------
  def dispose
    self.bitmap.dispose
    super
  end
  #--------------------------------------------------------------------------
  # ● ポーズ
  #--------------------------------------------------------------------------
  def pause
    self.visible
  end
  def pause=(a)
    self.visible = a
    @count = 0 unless self.visible
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
    return unless self.visible
    super
    @wait -= 1
    if @wait == 0
      @wait = Window_Message::STR22010
      @count += 1
      @count = 0 if @count * 16 >= self.bitmap.width
      self.src_rect.set(@count * 16, 0, 16, 16)
    end
  end
end
#==============================================================================
# ■ Sprite_STRFase+LoopAnimation
#==============================================================================
class Sprite_STRFace < Sprite_Base
  @@loop_animations = []
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_accessor :no_face
  attr_accessor :animation_id
  attr_accessor :loop_animation_id
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize(viewport)
    super(viewport)
    @animation_id = 0
    @loop_animation_duration = 0
    @loop_animation_id = 0
    @no_face = false
    @face_name = ""
    self.bitmap = Cache.face("")
  end
  #--------------------------------------------------------------------------
  # ● 解放
  #--------------------------------------------------------------------------
  def dispose
    super
    dispose_loop_animation
  end
  #--------------------------------------------------------------------------
  # ● フェイス設定
  #--------------------------------------------------------------------------
  def set_face(name, index, w, h)
    self.bitmap.dispose if self.bitmap != nil and @face_name != name
    @face_name = name
    self.bitmap = Cache.face(@face_name)
    self.src_rect.x = index % 4 * w
    self.src_rect.y = index / 4 * h
    self.src_rect.width = w
    self.src_rect.height = h
    self.ox = w / 2
    self.oy = h / 2
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
    super
    if @no_face
      self.ox = 0
      self.oy = 0
      self.src_rect.set(0,0,0,0)
    end
    set_oxy if @animation != nil
    animation = $data_animations[@loop_animation_id]
    start_loop_animation(animation)
    if @animation_id != 0
      animation = $data_animations[@animation_id]
      start_animation(animation)
      @animation_id = 0
    end
    if @loop_animation != nil
      @loop_animation_duration -= 1
      if @loop_animation_duration % STRRGSS2::STR22_ANSPEED == 0
        set_loop_oxy
        update_loop_animation
      end
    end
    @@loop_animations.clear
  end
  #--------------------------------------------------------------------------
  # ● 通常アニメーションの座標決定
  #--------------------------------------------------------------------------
  def set_oxy
    if @animation.position == 3
      if viewport == nil
        @animation_ox = Window_Message::STR22900[0] / 2
        @animation_oy = Window_Message::STR22900[1] / 2
      else
        @animation_ox = viewport.rect.width / 2
        @animation_oy = viewport.rect.height / 2
      end
    else
      @animation_ox = x - ox + width / 2
      @animation_oy = y - oy + height / 2
      if @animation.position == 0
        @animation_oy -= height / 2
      elsif @animation.position == 2
        @animation_oy += height / 2
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● アニメーションの開始
  #--------------------------------------------------------------------------
  def start_loop_animation(animation)
    return if @loop_animation != nil and @loop_animation.id == animation.id
    dispose_loop_animation
    @loop_animation = animation
    return if @loop_animation == nil
    @loop_animation_mirror = false
    @loop_animation_duration = @loop_animation.frame_max * STRRGSS2::STR22_ANSPEED + 1
    load_loop_animation_bitmap
    @loop_animation_sprites = []
    if @loop_animation.position != 3 or not @@loop_animations.include?(animation)
      if @use_sprite
        for i in 0...STRRGSS2::STR22_MAXCELL
          sprite = ::Sprite.new(viewport)
          sprite.visible = false
          @loop_animation_sprites.push(sprite)
        end
        unless @@loop_animations.include?(animation)
          @@loop_animations.push(animation)
        end
      end
    end
    set_loop_oxy
  end
  #--------------------------------------------------------------------------
  # ● アニメーションの座標決定
  #--------------------------------------------------------------------------
  def set_loop_oxy
    if @loop_animation.position == 3
      if viewport == nil
        @loop_animation_ox = Window_Message::STR22900[0] / 2
        @loop_animation_oy = Window_Message::STR22900[1] / 2
      else
        @loop_animation_ox = viewport.rect.width / 2
        @loop_animation_oy = viewport.rect.height / 2
      end
    else
      @loop_animation_ox = x - ox + width / 2
      @loop_animation_oy = y - oy + height / 2
      if @loop_animation.position == 0
        @loop_animation_oy -= height / 2
      elsif @loop_animation.position == 2
        @loop_animation_oy += height / 2
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● アニメーション グラフィックの読み込み
  #--------------------------------------------------------------------------
  def load_loop_animation_bitmap
    animation1_name = @loop_animation.animation1_name
    animation1_hue = @loop_animation.animation1_hue
    animation2_name = @loop_animation.animation2_name
    animation2_hue = @loop_animation.animation2_hue
    @loop_animation_bitmap1 = Cache.animation(animation1_name, animation1_hue)
    @loop_animation_bitmap2 = Cache.animation(animation2_name, animation2_hue)
    if @@_reference_count.include?(@loop_animation_bitmap1)
      @@_reference_count[@loop_animation_bitmap1] += 1
    else
      @@_reference_count[@loop_animation_bitmap1] = 1
    end
    if @@_reference_count.include?(@loop_animation_bitmap2)
      @@_reference_count[@loop_animation_bitmap2] += 1
    else
      @@_reference_count[@loop_animation_bitmap2] = 1
    end
    Graphics.frame_reset
  end
  #--------------------------------------------------------------------------
  # ● アニメーションの解放(追加)
  #--------------------------------------------------------------------------
  def dispose_loop_animation
    if @loop_animation_bitmap1 != nil
      @@_reference_count[@loop_animation_bitmap1] -= 1
      if @@_reference_count[@loop_animation_bitmap1] == 0
        @loop_animation_bitmap1.dispose
      end
    end
    if @loop_animation_bitmap2 != nil
      @@_reference_count[@loop_animation_bitmap2] -= 1
      if @@_reference_count[@loop_animation_bitmap2] == 0
        @loop_animation_bitmap2.dispose
      end
    end
    if @loop_animation_sprites != nil
      for sprite in @loop_animation_sprites
        sprite.dispose
      end
      @loop_animation_sprites = nil
      @loop_animation = nil
    end
    @loop_animation_bitmap1 = nil
    @loop_animation_bitmap2 = nil
  end
  #--------------------------------------------------------------------------
  # ● アニメーションの更新
  #--------------------------------------------------------------------------
  def update_loop_animation
    if @loop_animation_duration > 0
      f = STRRGSS2::STR22_ANSPEED - 1
      ff = STRRGSS2::STR22_ANSPEED
      frame_index = @loop_animation.frame_max - (@loop_animation_duration + f) / ff
      loop_animation_set_sprites(@loop_animation.frames[frame_index])
      for timing in @loop_animation.timings
        if timing.frame == frame_index
          loop_animation_process_timing(timing)
        end
      end
    else
      @loop_animation_duration = @loop_animation.frame_max * STRRGSS2::STR22_ANSPEED + 1
    end
  end
  #--------------------------------------------------------------------------
  # ● アニメーションスプライトの設定
  #--------------------------------------------------------------------------
  def loop_animation_set_sprites(frame)
    cell_data = frame.cell_data
    for i in 0...STRRGSS2::STR22_MAXCELL
      sprite = @loop_animation_sprites[i]
      next if sprite == nil
      pattern = cell_data[i, 0]
      if pattern == nil or pattern == -1
        sprite.visible = false
        next
      end
      if pattern < 100
        sprite.bitmap = @loop_animation_bitmap1
      else
        sprite.bitmap = @loop_animation_bitmap2
      end
      sprite.visible = true
      sprite.src_rect.set(pattern % 5 * 192,
        pattern % 100 / 5 * 192, 192, 192)
      if @loop_animation_mirror
        sprite.x = @loop_animation_ox - cell_data[i, 1]
        sprite.y = @loop_animation_oy + cell_data[i, 2]
        sprite.angle = (360 - cell_data[i, 4])
        sprite.mirror = (cell_data[i, 5] == 0)
      else
        sprite.x = @loop_animation_ox + cell_data[i, 1]
        sprite.y = @loop_animation_oy + cell_data[i, 2]
        sprite.angle = cell_data[i, 4]
        sprite.mirror = (cell_data[i, 5] == 1)
      end
      sprite.z = self.z + 300 + i
      sprite.ox = 96
      sprite.oy = 96
      sprite.zoom_x = cell_data[i, 3] / 100.0
      sprite.zoom_y = cell_data[i, 3] / 100.0
      sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
      sprite.blend_type = cell_data[i, 7]
    end
  end
  #--------------------------------------------------------------------------
  # ● SE とフラッシュのタイミング処理(追加)
  #--------------------------------------------------------------------------
  def loop_animation_process_timing(timing)
    timing.se.play
    case timing.flash_scope
    when 1
      self.flash(timing.flash_color, timing.flash_duration * STRRGSS2::STR22_ANSPEED)
    when 2
      if viewport != nil
        viewport.flash(timing.flash_color, timing.flash_duration * STRRGSS2::STR22_ANSPEED)
      end
    when 3
      self.flash(nil, timing.flash_duration * STRRGSS2::STR22_ANSPEED)
    end
  end
end
#==============================================================================
# ■ Game_Message
#==============================================================================
class Game_Message
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_accessor :event_id                 # 表示元イベントID
  attr_accessor :xywh                     # 表示位置/座標
  attr_accessor :mapstop                  # マップ更新停止
  attr_accessor :maxlineex                # 最大行数拡張
  attr_accessor :mes_move                 # メッセージ中移動可能
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化(エイリアス)
  #--------------------------------------------------------------------------
  alias initialize_str22 initialize
  def initialize
    initialize_str22
    @xywh = Rect.new(0, 0, 32, 32)
    @mapstop = false
    @maxlineex = 4
  end
  def visible=(a)
    @visible = a
    @mapstop = a unless a
  end
  #--------------------------------------------------------------------------
  # ● クリア(エイリアス)
  #--------------------------------------------------------------------------
  alias clear_str22 clear
  def clear
    clear_str22
    @event_id = 0
    @mes_move = false
  end
  #--------------------------------------------------------------------------
  # ● 改ページ
  #--------------------------------------------------------------------------
  def new_page
    while @texts.size % @maxlineex > 0
      @texts.push("")
    end
  end
end
#==============================================================================
# ■ Game_Map
#==============================================================================
class Game_Map
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  alias update_str22 update
  def update
    return if $game_message.visible and $game_message.mapstop
    update_str22
  end
  #--------------------------------------------------------------------------
  # ★ マップネーム取得(追加)
  #--------------------------------------------------------------------------
  def map_name_strextpp
    map = load_data("Data/MapInfos.rvdata")
    if map[@map_id].name["#"] != nil
      return map[@map_id].name.sub!(/(\S*)\#\S*/) { "#{$1}" }
    else
      return map[@map_id].name
    end
  end
end
#==============================================================================
# ■ Game_Player
#==============================================================================
class Game_Player < Game_Character
  #--------------------------------------------------------------------------
  # ● 方向ボタン入力による移動処理(再定義)
  #--------------------------------------------------------------------------
  def move_by_input
    return unless movable?
    # 条件変更
    return if $game_map.interpreter.running? and $game_message.mes_move == false
    case Input.dir4
    when 2;  move_down
    when 4;  move_left
    when 6;  move_right
    when 8;  move_up
    end
  end
  #--------------------------------------------------------------------------
  # ● 移動可能判定(再定義)
  #--------------------------------------------------------------------------
  def movable?
    return false if moving?                     # 移動中
    return false if @move_route_forcing         # 移動ルート強制中
    return false if @vehicle_getting_on         # 乗る動作の途中
    return false if @vehicle_getting_off        # 降りる動作の途中
    # 条件変更
    return false if $game_message.visible and $game_message.mes_move == false
    return false if in_airship? and not $game_map.airship.movable?
    return true
  end
end
#==============================================================================
# ■ Game_Interpreter
#==============================================================================
class Game_Interpreter
  #--------------------------------------------------------------------------
  # ● 文章の表示(再定義)
  #--------------------------------------------------------------------------
  def command_101
    unless $game_message.busy
      # イベントIDを渡す
      $game_message.event_id = @event_id
      #
      $game_message.face_name = @params[0]
      $game_message.face_index = @params[1]
      $game_message.background = @params[2]
      $game_message.position = @params[3]
      # オーバーライン
      next_mes = true
      loop do
        if @list[@index].code == 101 and next_mes and
           $game_message.maxlineex > $game_message.texts.size
          @index += 1
        else
          break
        end
        next_mes = false
        while @list[@index].code == 401       # 文章データ
          next_mes = true if @list[@index].parameters[0][/\\NEXT/i] != nil
          if $game_message.maxlineex > $game_message.texts.size
            $game_message.texts.push(@list[@index].parameters[0])
          end
          @index += 1
        end
      end
      #
      if @list[@index].code == 102          # 選択肢の表示
        setup_choices(@list[@index].parameters)
      elsif @list[@index].code == 103       # 数値入力の処理
        setup_num_input(@list[@index].parameters)
      end
      set_message_waiting                   # メッセージ待機状態にする
    end
    return false
  end
  #--------------------------------------------------------------------------
  # ● 選択肢のセットアップ(再定義)
  #--------------------------------------------------------------------------
  def setup_choices(params)
    if $game_message.texts.size <= $game_message.maxlineex - params[0].size
      # イベントIDを渡す
      $game_message.event_id = @event_id
      #
      $game_message.choice_start = $game_message.texts.size
      $game_message.choice_max = params[0].size
      for s in params[0]
        $game_message.texts.push(s)
      end
      $game_message.choice_cancel_type = params[1]
      $game_message.choice_proc = Proc.new { |n| @branch[@indent] = n }
      @index += 1
    end
  end
  #--------------------------------------------------------------------------
  # ● 数値入力のセットアップ(再定義)
  #--------------------------------------------------------------------------
  def setup_num_input(params)
    if $game_message.texts.size < $game_message.maxlineex
      # 行追加(ポップアップ時のサイズ不足対策)
      $game_message.texts.push("")
      #
      $game_message.num_input_variable_id = params[0]
      $game_message.num_input_digits_max = params[1]
      @index += 1
    end
  end
end


#==============================================================================
# ★RGSS2
# STR23_アイテムセレクト v1.0 08/02/13
# サポート:http://otsu.cool.ne.jp/strcatyou/
#
# ・所持アイテムを選択するイベントを作れるようになります。
# ・「そそそれはエリクサー!?私どもにくださるというのですか・・・!」
#
# <<使用方法>>
# 以下のスクリプトをイベントコマンドのスクリプト等で実行します。
#
# $game_temp.itemselect = n
#
# n に選択されたアイテムIDを格納する、変数IDを指定することで
# アイテムセレクトウィンドウを開きます。
# 格納される値はアイテムの種類によって変わります。
#
#  種類    格納値
# アイテム → アイテムID(そのまま)
#   武器 → 1000 + 武器ID
#   防具 → 2000 + 防具ID
#
#==============================================================================
# ■ STRRGSS2
#==============================================================================
module STRRGSS2
  # ヘルプウィンドウを表示するか
  STR23HELP   = false
  # ウィンドウサイズ    (x, y, width, height)
  STR23RECT_H = Rect.new(   0,   0, 544,  56) # ヘルプウィンドウ矩形
  STR23RECT_I = Rect.new(   0, 288, 544, 128) # アイテムウィンドウ矩形
  # ウィンドウフェードスピード
  STR23FADE   = 48
end
#==============================================================================
# ■ Scene_Map_Itemselect
#==============================================================================
class Scene_Map_Itemselect
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_reader   :item_id
  attr_reader   :scene_end
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize
    @item_id = 0
    @scene_end = false
    @viewport = Viewport.new(0, 0, 544, 416)
    @viewport.z = 10000
    if STRRGSS2::STR23HELP
      @help_window = Window_Help.new
      r = STRRGSS2::STR23RECT_H
      @help_window.x = r.x
      @help_window.y = r.y
      @help_window.width = r.width
      @help_window.height = r.height
      @help_window.create_contents
      @help_window.viewport = @viewport
      @help_window.opacity = 0
      @help_window.contents_opacity = 0
    end
    r = STRRGSS2::STR23RECT_I
    @item_window = Window_Itemselect.new(r.x, r.y, r.width, r.height)
    @item_window.viewport = @viewport
    @item_window.help_window = @help_window if STRRGSS2::STR23HELP
    @item_window.opacity = 0
    @item_window.contents_opacity = 0
    Graphics.frame_reset
  end
  #--------------------------------------------------------------------------
  # ● 開放
  #--------------------------------------------------------------------------
  def dispose
    @item = @item_window.item
    @item_id = @item.id
    if @item.is_a?(RPG::Weapon)
      @item_id += 1000
    elsif @item.is_a?(RPG::Armor)
      @item_id += 2000
    end
    @close = true
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
    if @close
      if STRRGSS2::STR23HELP
        @help_window.opacity -= STRRGSS2::STR23FADE
        @help_window.contents_opacity -= STRRGSS2::STR23FADE
      end
      @item_window.opacity -= STRRGSS2::STR23FADE
      @item_window.contents_opacity -= STRRGSS2::STR23FADE
      if @item_window.opacity == 0
        @viewport.dispose
        @help_window.dispose if STRRGSS2::STR23HELP
        @item_window.dispose
        @scene_end = true
      end
      return
    elsif @item_window.opacity != 255
      if STRRGSS2::STR23HELP
        @help_window.opacity += STRRGSS2::STR23FADE
        @help_window.contents_opacity += STRRGSS2::STR23FADE
      end
      @item_window.opacity += STRRGSS2::STR23FADE
      @item_window.contents_opacity += STRRGSS2::STR23FADE
      return
    end
    @help_window.update if STRRGSS2::STR23HELP
    @item_window.update
    if Input.trigger?(Input::B)
      Sound.play_cancel
      dispose
      @item_id = 0
    elsif Input.trigger?(Input::C)
      Sound.play_decision
      dispose
    end
  end
end
#==============================================================================
# ■ Window_Itemselect
#==============================================================================
class Window_Itemselect < Window_Item
  #--------------------------------------------------------------------------
  # ● アイテムを許可状態で表示するかどうか
  #--------------------------------------------------------------------------
  def enable?(item)
    return true
  end
end
#==============================================================================
# ■ Scene_Map
#==============================================================================
class Scene_Map < Scene_Base
  #--------------------------------------------------------------------------
  # ● フレーム更新(エイリアス)
  #--------------------------------------------------------------------------
  alias update_str23 update
  def update
    if $game_temp.itemselect > 0
      s_itemselect = Scene_Map_Itemselect.new
      while s_itemselect.scene_end != true
        Graphics.update             # ゲーム画面を更新
        Input.update                # 入力情報を更新
        s_itemselect.update         # アイテムセレクト更新
        $game_map.update            # マップを更新
        $game_player.update         # プレイヤーを更新
        $game_system.update         # タイマーを更新
        @spriteset.update           # スプライトセットを更新
        @message_window.update      # メッセージウィンドウを更新
      end
      $game_variables[$game_temp.itemselect] = s_itemselect.item_id
      $game_temp.itemselect = 0
    end
    update_str23
  end
end
#==============================================================================
# ■ Game_Temp
#==============================================================================
class Game_Temp
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_accessor :itemselect
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化(エイリアス)
  #--------------------------------------------------------------------------
  alias initialize_str23 initialize
  def initialize
    initialize_str23
    @itemselect = 0
  end
end

이런 스크립트입니다. 이 스크립트를 사용하기만 하면 이런 오류가 뜹니다.

이 스크립트 외에는 아무것도 사용하지 않았는데...

왜 그런지 알려주세요!

Comment '1'
  • profile
    습작 2012.05.07 00:28
    해당 스크립트 자체는 크게 무리가 없는 스크립트 입니다. 혹여나 다른 스크립트와의 충돌여부가 있을 수 있으니 백업하신 다음 스크립트를 가감하여 테스트 해보시기 바랍니다.

List of Articles
종류 분류 제목 글쓴이 날짜 조회 수
공지 묻고 답하기 가이드 습작 2014.06.14 12398
RMVX SRPG 스크립트를 쓰는데 편성화면 뜨기전에 오류납니다. file 잡초더미 2012.05.10 2517
RMVX 말풍선 효과 스크립트 오류 1 file 아브렐라 2012.05.06 886
RMVX KGC드랍아이템확장스크립트 질문요..ㅠ 3 반내림 2012.05.06 2381
RMVX 아이템 이름 바꾸기 and 요청 1 file ㅓ나ㅣ러마니어 2012.05.04 2631
RMVX 특수 스킬 사용시 속성 부여에 관하여 질문 드립니다. 1 킴마유 2012.04.28 2391
RMVX 스킬 사용시 나오는 문장 질문. 2 킴마유 2012.04.27 2468
RMVX 이벤트가 플레이어에게 접촉시 발동하는 법... 4 file Cloudy 2012.04.27 2597
RMVX 그림 자체에 애니메이션을 부여하고 싶습니다. 2 regidia89 2012.04.24 2778
RMVX 분명히 만들땐 따라가기 스크립트가 적용이 되어있는데 배포로 만드니까 종범 춰억헐릿 2012.04.22 2638
RMVX 도와주세요 ~~ 테스트 도중 오류가 납니다. 2 file GreatSH 2012.04.22 2369
RMVX 소지금이 OO이상일때 진행되는 이벤트를 만들려면 2 춰억헐릿 2012.04.20 2273
RMVX 정수로 id와 pw만들기 3 FNS키리토 2012.04.20 1819
RMVX 캐릭터의 기본공격이 다른 캐릭의 스킬로 멋대로 바뀌었네요 6 file 친구뿐인삶 2012.04.19 1770
RMVX rpg만들기 툴 어느걸 추천하시나요? 2 stonesoup 2012.04.18 2458
RMVX 까까까님이 예전에 올리신 "역동적인 타이틀 만들기" 에 관해서 3 TheEK 2012.04.18 4210
RMVX RPGVX로 SRPG게음을 만들떄 민첩순위로 한턴당 한캐릭터만 움직일수 있게 만들수 있나요? 1 August_Wish 2012.04.16 2900
RMVX 게임 시작전 부터 특정 스위치를 on시켜놓는 전제하에 시작하게 만들기 3 라이루 2012.04.14 2557
RMVX RPG VX 5 윤파카 2012.04.12 2397
RMVX SBS 3.4 사이드뷰 적 기본공격 2 잭무기 2012.04.12 2643
RMVX 응??? 타일셋 늘리는 스크립트 나와있던것 같던데... 2 난현이라는 2012.04.04 2771
Board Pagination Prev 1 ... 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 ... 127 Next
/ 127