查看: 1965|回复: 2

[已经解决] 請問如何更改選擇窗口?

[复制链接]
梦石
0
星屑
50
在线时间
32 小时
注册时间
2014-2-8
回帖
5
发表于 2014-8-16 12:22:44 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
6775_4.jpg
7308_2.jpg

圖有點小,請見諒

請問如何將選擇窗口更改位置,如上圖的位置?


点评

第二个选择框位置,你可以试试VA  发表于 2014-8-16 16:04
梦石
0
星屑
76
在线时间
1379 小时
注册时间
2012-7-5
回帖
1643

开拓者

发表于 2014-8-16 14:16:14 | 显示全部楼层
食用姿势 :
  • 事件-注释> 選択肢[3]:选项1|选项2 (3代表将窗口放中间)
  • 事件-条件分歧> 变量0001 == 1 (选了选项1的情况)

我才不会说这个脚本是魔女之家里面的呢
以及这个脚本有很多强大的功能, 希望有人有空汉化一下
脚本在这里
  1. #==============================================================================
  2. #
  3. # ■選択肢機能拡張 □Ver.3.21 □製作者:月紳士
  4. #  
  5. # ・RPGツクールVX用 RGSS2スクリプト
  6. #
  7. #    ●…書き換えメソッド(競合注意) ◎…メソッドのエイリアス ○…新規メソッド
  8. #
  9. #  ※二次配布禁止!配布元には利用規約があります。必ずそちらを見てください。
  10. #------------------------------------------------------------------------------
  11. # 更新履歴
  12. #   Ver3.21  ○選択肢準備直下の追加選択肢使用時の挙動修正。
  13. #            ○場所移動とフェードアウト使用時に関する動作の修正。
  14. #==============================================================================
  15. =begin

  16.   このスクリプトでは主に以下の事が出来る様になります。

  17.   ○ 5項目以上の選択肢を表示することが出来るようになります。
  18.     ※5項目以上の選択肢はアイテム欄などのように
  19.      ウインドウ内のスクロールにて表示されます。

  20.   ○ メッセージウインドウとは別枠で表示される
  21.     特別な選択肢を表示することが出来ます。

  22.   ○ 現在のパーティーを対象とするような動的な選択肢を作ることができます。
  23.     
  24.    ※ Ver.3.00よりダミーアクター機能が別スクリプトとなりました。
  25.      Ver.3.00以前の物と同様の使い方をするには別途
  26.      ダミーアクター・スクリプトの導入が必要です。

  27.   詳しい設定の仕方はマニュアルをご覧ください。

  28. =end
  29. #==============================================================================
  30. # □ 選択肢機能拡張・モジュール(カスタマイズ項目)
  31. #==============================================================================

  32. module Expansion_Choices

  33.   CHOICE_RESUIT_VARIABLES = 1
  34.    # 選択肢を選んだ結果を納める変数を指定します。
  35.    # プレイヤーが選んだ選択肢の項目番号が、この番号の変数へ納められます。
  36.   
  37.   TARGET_ACTOR_ID_VARIABLES = 2
  38.    # アクターを対象にした選択肢の結果を納める変数を指定します。
  39.    # 選んだアクターのID番号が、この番号の変数へ納められます。
  40.    # (ダミーアクター・スクリプト併用時は
  41.    #  ダミーアクター・スクリプトのACTOR_ID_VARIABLESと
  42.    #  揃えることを推奨します。)
  43.    
  44.    
  45.   EX_CHOICES_DELAY = 25
  46.    # 別枠選択肢が表示されてから、決定・キャンセル入力を受け付けるまでの
  47.    # 延滞時間をフレーム数で設定します。
  48.   
  49. end

  50. #==============================================================================
  51. # □ Game_Choices
  52. #------------------------------------------------------------------------------
  53. #  特殊選択肢の情報を管理するクラスです。
  54. #==============================================================================

  55. class Game_Choices
  56.   #--------------------------------------------------------------------------
  57.   # ○ 定数
  58.   #--------------------------------------------------------------------------
  59.     CHOICE_V = Expansion_Choices::CHOICE_RESUIT_VARIABLES
  60.     TARGET_V = Expansion_Choices::TARGET_ACTOR_ID_VARIABLES
  61.   #--------------------------------------------------------------------------
  62.   # ○ 公開インスタンス変数
  63.   #--------------------------------------------------------------------------
  64.   attr_accessor :choices                   # 選択肢
  65.   attr_accessor :actor_id                  # アクターID
  66.   attr_accessor :help_text                 # 選択肢ヘルプテキスト
  67.   attr_accessor :window_type               # 表示ウインドウタイプ
  68.   attr_accessor :column                    # 選択肢の横ならび表示
  69.   attr_accessor :cancel_type               # キャンセル時項目
  70.   attr_accessor :choice_cancel             # 選択肢が一つの際の自動選択
  71.   attr_accessor :choice_show_fast          # 選択肢を一度に線画
  72.   attr_accessor :choices_check             # 選択肢チェック
  73.   attr_accessor :choices_ready             # 選択肢準備
  74.   attr_accessor :can_not_select            # 選択不能の選択肢
  75.   attr_accessor :choice_hide               # 隠す選択肢
  76.   attr_accessor :icon                      # 選択肢アイコン
  77.   attr_accessor :price                     # 選択肢価格
  78.   attr_accessor :pick_up                   # ピックアップする選択肢
  79.   attr_accessor :pick_up_result            # ピックアップ結果を残すグループ(ID)
  80.   attr_accessor :pick_up_limit             # ピックアップ数
  81.   attr_accessor :pick_up_canstop           # ピックアップの中断許可
  82.   attr_accessor :face_name                 # フェイス画像ファイル名
  83.   attr_accessor :face_index                # フェイス画像インデックス
  84.   attr_accessor :re_face                   # フェイス画像の逆位置表示
  85.   #--------------------------------------------------------------------------
  86.   # ○ オブジェクト初期化
  87.   #--------------------------------------------------------------------------
  88.   def initialize
  89.     clear
  90.   end
  91.   #--------------------------------------------------------------------------
  92.   # ○ クリア
  93.   #--------------------------------------------------------------------------
  94.   def clear
  95.     @cancel_type = -1
  96.     @choices = []
  97.     @actor_id = []
  98.     @help_text = []
  99.     @window_type = -1
  100.     @column = false
  101.     @choice_cancel = false
  102.     @choice_show_fast = false
  103.     @choices_check = false
  104.     @choices_ready = false
  105.     @can_not_select = []
  106.     @choice_hide = []
  107.     @icon = []
  108.     @price = []
  109.     @pick_up = nil
  110.     @pick_up_result = 0
  111.     @pick_up_limit = 0
  112.     @pick_up_canstop = false
  113.     @face_name = ""
  114.     @face_index = 0
  115.     @re_face = false
  116.     @item_name_memory = false
  117.   end
  118.   #--------------------------------------------------------------------------
  119.   # ○ アクター選択肢か?
  120.   #--------------------------------------------------------------------------
  121.   def actor_choice?
  122.     return false if @actor_id.empty?
  123.     return true
  124.   end
  125.   #--------------------------------------------------------------------------
  126.   # ○ 表示すべき選択肢項目のインデックス取得
  127.   #--------------------------------------------------------------------------
  128.   def display_item_index
  129.     array = []
  130.     @choices.size.times do |i|
  131.       next if @choice_hide.include?(i)
  132.       next if @pick_up and @pick_up.include?(i)
  133.       array.push(i)
  134.     end
  135.     return array
  136.   end
  137.   #--------------------------------------------------------------------------
  138.   # ○ 表示すべき選択肢項目の取得
  139.   #--------------------------------------------------------------------------
  140.   def item
  141.     array = []
  142.     display_item_index.each{|i|array.push(@choices[i])}
  143.     return array
  144.   end
  145.   #--------------------------------------------------------------------------
  146.   # ○ 表示すべき選択肢の項目数
  147.   #--------------------------------------------------------------------------
  148.   def size
  149.     return display_item_index.size
  150.   end
  151.   #--------------------------------------------------------------------------
  152.   # ○ 選択可能な選択肢項目のインデックス取得
  153.   #--------------------------------------------------------------------------
  154.   def active_item_index
  155.     array = []
  156.     @choices.size.times do |i|
  157.       next if @choice_hide.include?(i)
  158.       next if @pick_up and @pick_up.include?(i)
  159.       next if @can_not_select.include?(i)
  160.       array.push(i)
  161.     end
  162.     return array
  163.   end
  164.   #--------------------------------------------------------------------------
  165.   # ○ 選択不可項目のインデックス取得(非表示項目を除外して再編)
  166.   #--------------------------------------------------------------------------
  167.   def can_not_select_active
  168.     array = []
  169.     n = 0
  170.     @choices.size.times do |i|
  171.       next if @choice_hide.include?(i)
  172.       next if @pick_up and @pick_up.include?(i)
  173.       array.push(n) if @can_not_select.include?(i)
  174.       n += 1
  175.     end
  176.     return array
  177.   end
  178.   #--------------------------------------------------------------------------
  179.   # ○ 選択時コールバックの設定
  180.   #--------------------------------------------------------------------------
  181.   def proc
  182.     choice_proc = Proc.new{|n|
  183.       if n < 0                # 拡張選択肢キャンセル時(の特殊な返り値)の場合
  184.         if @cancel_type == -1 # キャンセル項目未設定
  185.           $game_variables[CHOICE_V] = 0
  186.         else                  # キャンセル項目指定あり
  187.           $game_variables[CHOICE_V] = @cancel_type
  188.           $game_variables[TARGET_V] = @actor_id[@cancel_type-1] if actor_choice?
  189.         end
  190.       else
  191.         index = display_item_index[n]
  192.         $game_variables[CHOICE_V] = index + 1
  193.         $game_variables[TARGET_V] = @actor_id[index] if actor_choice?
  194.         $game_temp.last_select_choice = @choices[index] if @item_name_memory
  195.       end
  196.     }
  197.     return choice_proc
  198.   end
  199.   #--------------------------------------------------------------------------
  200.   # ○ テキストからのオプション取得
  201.   #--------------------------------------------------------------------------
  202.   def get_option(text)
  203.     @column = true if /[\##]/i =~ text            # 選択肢の横ならび表示の取得
  204.     @item_name_memory = true if /[\@@]/i =~ text  # 選択項目名の記憶
  205.     @choice_cancel = true if /[\'’]/ =~ text      # 選択肢が一つの際の自動選択
  206.     @choice_show_fast = true if /[\>>]/ =~ text   # 選択肢を一度に線画
  207.     if /\[(\d+)\]/ =~ text                         # ウインドウタイプの取得
  208.       @window_type = $1.to_i
  209.     else
  210.       @window_type = -1
  211.     end
  212.     if /[\((](\d+)[\))]/ =~ text                 # キャンセル時項目の取得
  213.       @cancel_type = $1.to_i
  214.     elsif /[\((][\**][\))]/ =~ text             # キャンセル不能の取得
  215.       @cancel_type = 0
  216.     else
  217.       @cancel_type = -1
  218.     end
  219.     if /face\{(\w+)\/([0-7])\}/i =~ text
  220.       @face_name = $1
  221.       @face_index = $2.to_i
  222.       if /re_face\{/i =~ text
  223.         @re_face = true
  224.       end
  225.     elsif /face\{top_actor\}/i =~ text
  226.       actor = $game_party.members[0]
  227.       @face_name = actor.face_name
  228.       @face_index = actor.face_index
  229.       if /re_face\{/i =~ text
  230.         @re_face = true
  231.       end
  232.     end
  233.   end
  234.   #--------------------------------------------------------------------------
  235.   # ○ テキストから自由選択肢を生成
  236.   #--------------------------------------------------------------------------
  237.   def create_free_choices(text)
  238.     choices = text.split(/[\|\s]/)
  239.     choices.delete("")
  240.     for i in choices
  241.       i.gsub!(/\\V\[([0-9]+)\]/i) { $game_variables[$1.to_i] }
  242.       i.gsub!(/\<cns\>/i, "")
  243.       if $&
  244.         @can_not_select.push(@choices.size)
  245.       end
  246.       i.gsub!(/\<ch\>/i, "")
  247.       if $&
  248.         @choice_hide.push(@choices.size)
  249.       end
  250.       i.gsub!(/\\i\[([0-9]+)\]/i, "")
  251.       if $&
  252.         @icon[@choices.size] = $1.to_i
  253.       end
  254.       i.gsub!(/\\g\[([0-9]+)\]/i, "")
  255.       if $&
  256.         @price[@choices.size] = $1.to_i
  257.       end
  258.       @choices.push(i)
  259.     end
  260.   end
  261.   #--------------------------------------------------------------------------
  262.   # ○ テキストからヘルプを生成
  263.   #--------------------------------------------------------------------------
  264.   def set_help(text, index = nil)
  265.     if index
  266.       @help_text[index] = text
  267.     else
  268.       @help_text.push(text)
  269.     end
  270.   end
  271.   #--------------------------------------------------------------------------
  272.   # ○ アクター選択肢の調整
  273.   #--------------------------------------------------------------------------
  274.   def actor_choice_addition(addition_type, addition_id, icon_index = nil)
  275.     return unless actor_choice?
  276.     if addition_type == 1 or addition_type == 3
  277.       addition_id = @actor_id - addition_id
  278.     end
  279.     for i in addition_id.compact
  280.       ind = @actor_id.index(i)
  281.       next if ind.nil?
  282.       case addition_type
  283.       when 0, 1
  284.         @can_not_select.push(ind)
  285.       when 2, 3
  286.         @choice_hide.push(ind)
  287.       when 4
  288.         @icon[ind] = icon_index
  289.       end
  290.     end
  291.   end
  292. end

  293. #==============================================================================
  294. # ■ Game_Temp
  295. #------------------------------------------------------------------------------
  296. #  セーブデータに含まれない、一時的なデータを扱うクラスです。このクラスのイン
  297. # スタンスは $game_temp で参照されます。
  298. #==============================================================================

  299. class Game_Temp
  300.   #--------------------------------------------------------------------------
  301.   # ○ 公開インスタンス変数
  302.   #--------------------------------------------------------------------------
  303.   attr_accessor :choices
  304.   attr_accessor :last_select_choice
  305.   #--------------------------------------------------------------------------
  306.   # ◎ オブジェクト初期化
  307.   #--------------------------------------------------------------------------
  308.   alias tig_ec_initialize initialize
  309.   def initialize
  310.     tig_ec_initialize
  311.     @choices = Game_Choices.new
  312.     @last_select_choice = ""
  313.   end
  314. end

  315. #==============================================================================
  316. # ■ Game_Message
  317. #------------------------------------------------------------------------------
  318. #  文章や選択肢などを表示するメッセージウィンドウの状態を扱うクラスです。この
  319. # クラスのインスタンスは $game_message で参照されます。
  320. #==============================================================================

  321. class Game_Message
  322.   #--------------------------------------------------------------------------
  323.   # ○ 公開インスタンス変数
  324.   #--------------------------------------------------------------------------
  325.   attr_accessor :can_not_select             # 選択禁止するindex
  326.   attr_accessor :last_face_name             # face_name 履歴
  327.   attr_accessor :last_face_index            # face_index 履歴
  328.   attr_accessor :last_background            # background 履歴
  329.   attr_accessor :last_position              # position 履歴
  330.   attr_accessor :cancel_input               # 文章送り時 キャンセル取得するか?
  331.   attr_accessor :show_ex_choices
  332.   #--------------------------------------------------------------------------
  333.   # ◎ クリア
  334.   #--------------------------------------------------------------------------
  335.   alias tig_ec_clear clear
  336.   def clear
  337.     tig_ec_clear
  338.     @cancel_input = false
  339.     @can_not_select = []
  340.     @show_ex_choices = nil
  341.   end
  342. end

  343. #==============================================================================
  344. # ■ Game_Party
  345. #------------------------------------------------------------------------------
  346. #  パーティを扱うクラスです。ゴールドやアイテムなどの情報が含まれます。このク
  347. # ラスのインスタンスは $game_party で参照されます。
  348. #==========================================================================

  349. class Game_Party < Game_Unit
  350.   #--------------------------------------------------------------------------
  351.   # ○ 公開インスタンス変数
  352.   #--------------------------------------------------------------------------
  353.   attr_accessor :group                                # アクターIDグループ
  354.   attr_accessor :reserve_choice_id                    # 選択アクターの予備
  355.   #--------------------------------------------------------------------------
  356.   # ○ パーティーが最大人数に達しているか?
  357.   #--------------------------------------------------------------------------
  358.   def max?
  359.     return @actors.size >= MAX_MEMBERS
  360.   end
  361. end

  362. #==============================================================================
  363. # ■ Game_Event
  364. #------------------------------------------------------------------------------
  365. #  イベントを扱うクラスです。条件判定によるイベントページ切り替えや、並列処理
  366. # イベント実行などの機能を持っており、Game_Map クラスの内部で使用されます。
  367. #==============================================================================

  368. class Game_Event < Game_Character
  369.   #--------------------------------------------------------------------------
  370.   # ◎ イベントページの条件合致判定
  371.   #--------------------------------------------------------------------------
  372.   alias tig_ec_conditions_met? conditions_met?
  373.   def conditions_met?(page)
  374.     c = page.condition
  375.     if c.actor_valid and c.variable_valid and
  376.                    c.variable_id == Expansion_Choices::CHOICE_RESUIT_VARIABLES
  377.       return $game_party.group[c.variable_value].include?(c.actor_id)
  378.     end

  379.     return tig_ec_conditions_met?(page)
  380.   end
  381. end

  382. #==============================================================================
  383. # ■ Game_Interpreter
  384. #------------------------------------------------------------------------------
  385. #  イベントコマンドを実行するインタプリタです。このクラスは Game_Map クラス、
  386. # Game_Troop クラス、Game_Event クラスの内部で使用されます。
  387. #==============================================================================

  388. class Game_Interpreter
  389.   #--------------------------------------------------------------------------
  390.   # ○ 定数
  391.   #--------------------------------------------------------------------------
  392.     MAX_LINE = 4                            # メッセージウインドウの最大行数
  393.   
  394.     CHOICE_V = Expansion_Choices::CHOICE_RESUIT_VARIABLES
  395.     TARGET_V = Expansion_Choices::TARGET_ACTOR_ID_VARIABLES
  396.   #--------------------------------------------------------------------------
  397.   # ◎ クリア
  398.   #--------------------------------------------------------------------------
  399.   alias tig_ec_clear clear
  400.   def clear
  401.     tig_ec_clear
  402.     $game_message.last_face_name = ""
  403.     $game_message.last_face_index = 0
  404.     $game_message.last_background = 0
  405.     $game_message.last_position = 2
  406.     if $game_party.group.nil?
  407.       $game_party.group = [[], [], [], [], [], []] # index0~5をあらかじめ初期化
  408.     end
  409.     $game_party.reserve_choice_id = 1
  410.   end
  411.   #--------------------------------------------------------------------------
  412.   # ◎ 選択肢のセットアップ
  413.   #--------------------------------------------------------------------------
  414.   alias tig_ec_setup_choices setup_choices
  415.   def setup_choices(params)
  416.     $game_temp.choices.clear
  417.     tig_ec_setup_choices(params)
  418.   end
  419.   #--------------------------------------------------------------------------
  420.   # ○ 特殊選択肢か?
  421.   #--------------------------------------------------------------------------
  422.   def expansion_choice?(index = nil)
  423.     index = @index unless index
  424.     return false if @list[index].code != 108
  425.     return /\A選択肢/ =~ @list[index].parameters[0]
  426.   end
  427.   #--------------------------------------------------------------------------
  428.   # ◎ イベントコマンドの実行
  429.   #  ※ 拡張選択肢の実行と特殊コマンドの実行処理の割り込み
  430.   #--------------------------------------------------------------------------
  431.   alias tig_ec_execute_command execute_command
  432.   def execute_command
  433.     if @index >= @list.size-1
  434.       command_end
  435.       return true
  436.     else
  437.       if expansion_choice?
  438.         return setup_expansion_choice
  439.       elsif choices_command
  440.         return true
  441.       end
  442.     end
  443.     return tig_ec_execute_command
  444.   end
  445.   #--------------------------------------------------------------------------
  446.   # ◎ メッセージ待機中フラグおよびコールバックの設定
  447.   #  ※ 文章に続けて選択肢を表示する時の為に拡張選択肢の処理を割り込ませる
  448.   #--------------------------------------------------------------------------
  449.   alias tig_ec_set_message_waiting set_message_waiting
  450.   def set_message_waiting
  451.     unless $game_message.texts.size == 0
  452.       unless @list[(@index - 1)].code == 102 or @list[(@index - 1)].code == 103
  453.         setup_expansion_choice if expansion_choice?
  454.       end
  455.     end
  456.    
  457.     tig_ec_set_message_waiting
  458.   end
  459.   #--------------------------------------------------------------------------
  460.   # ○ 特殊選択肢のセットアップへの処理振り分け
  461.   #--------------------------------------------------------------------------
  462.   def setup_expansion_choice
  463.     text = @list[@index].parameters[0]
  464.     if /\A選択肢開始/ =~ text
  465.       @index += 1 if start_display_choices
  466.       return false
  467.     elsif /\A選択肢ピックアップ/ =~ text
  468.       $game_temp.choices.pick_up = []
  469.       $game_temp.choices.pick_up_result = -1
  470.       $game_temp.choices.pick_up_limit = 3
  471.       if /\[(\d+)\]/ =~ text
  472.         $game_temp.choices.pick_up_result = $1.to_i
  473.       end
  474.       if /\((\d+)\)/ =~ text
  475.         $game_temp.choices.pick_up_limit = [[$1.to_i, $game_temp.choices.choices.size].min, 1].max
  476.       else
  477.         $game_temp.choices.pick_up_limit = $game_temp.choices.choices.size
  478.       end
  479.       if /[\'’]/ =~ text
  480.         $game_temp.choices.pick_up_canstop = true
  481.       end
  482.       $game_temp.choices.window_type = -1
  483.       @index += 1 if start_display_choices
  484.       return false
  485.     elsif /\A選択肢の?初期化/ =~ text
  486.       $game_temp.choices.clear
  487.       return true
  488.     elsif /[::]パーティー/ =~ text
  489.       return command_setup_actor_choice
  490.     elsif /[::]グループ\[(\d+)\]/ =~ text
  491.       return command_setup_actor_choice($1.to_i)
  492.     else
  493.       return command_setup_free_choice
  494.     end
  495.   end
  496.   #--------------------------------------------------------------------------
  497.   # ○ アクター選択肢(コマンド)
  498.   #  ※ このメソッドはイベントコマンドの実行に類するメソッドです。
  499.   #     実行しながら@indexを進ませています。
  500.   #     ただし、test_indexが与えられている場合は選択肢を生成し、
  501.   #     結果として返えすのみで、@indexは進めません。
  502.   #--------------------------------------------------------------------------
  503.   def command_setup_actor_choice(group_id = nil, test_index = nil)
  504.     index = test_index ? test_index : @index
  505.     if group_id
  506.       choices = setup_group_choice(group_id)
  507.     else
  508.       choices = setup_party_choice
  509.     end
  510.    
  511.     unless /[::]/ =~ @list[index].parameters[0]
  512.       if test_index
  513.         return choices
  514.       else
  515.         return
  516.       end
  517.     end
  518.    
  519.     option_text = $`
  520.     choices.get_option(option_text)
  521.    
  522.     index += 1
  523.     while @list[index].code == 408
  524.       index += 1
  525.       texts = @list[index-1].parameters[0].split(/[\|\s]/)
  526.       for text in texts
  527.         if /[::]/ =~ text
  528.           addition_type_text = $`
  529.           addition_id_text = $'
  530.           # 調整する方法の取得
  531.           if /\A選択不能/ =~ addition_type_text
  532.             addition_type = 0
  533.           elsif /\A選択限定/ =~ addition_type_text
  534.             addition_type = 1
  535.           elsif /\A除外/ =~ addition_type_text
  536.             addition_type = 2
  537.           elsif /\A共通/ =~ addition_type_text
  538.             addition_type = 3
  539.           elsif /\Aアイコン付加\[(\d+)\]/ =~ addition_type_text
  540.             addition_type = 4
  541.             icon_index = $1.to_i
  542.           else
  543.             next
  544.           end
  545.           # 調整するID郡の取得
  546.           if /\Aパーティー/ =~ addition_id_text
  547.             addition_id = actor_choice_addition_party
  548.           elsif /\Aグループ\[(\d+)\]/ =~ addition_id_text
  549.             addition_id = actor_choice_addition_group($1.to_i)
  550.           elsif /\Aステート\[(\d+)\]/ =~ addition_id_text
  551.             addition_id = actor_choice_addition_state($1.to_i)
  552.           elsif /\Aレベル\[(\d+)\]/ =~ addition_id_text
  553.             addition_id = actor_choice_addition_level($1.to_i)
  554.           elsif /\A負傷者/ =~ addition_id_text
  555.             addition_id = actor_choice_addition_injure
  556.           else
  557.             next
  558.           end
  559.         end
  560.         choices.actor_choice_addition(addition_type, addition_id, icon_index)
  561.       end
  562.     end
  563.    
  564.     if test_index
  565.       return choices
  566.     else
  567.       $game_temp.choices = choices
  568.       if choices_check?(option_text)                   # 選択肢チェックの場合
  569.         $game_variables[Expansion_Choices::CHOICE_RESUIT_VARIABLES] = $game_temp.choices.active_item_index.size
  570.         return true
  571.       elsif $game_temp.choices.active_item_index.size == 0       # 選択肢が無効の場合
  572.         $game_variables[Expansion_Choices::CHOICE_RESUIT_VARIABLES] = -1
  573.         return true
  574.       elsif $game_temp.choices.size == 1 and choices_one?(option_text)
  575.                                                        # 択一自動選択の場合
  576.         $game_temp.choices.proc.call($game_temp.choices.active_item_index[0])
  577.         return true
  578.       elsif choices_start?(option_text)                # 選択肢開始
  579.         if start_display_choices
  580.           @index = index
  581.           return false
  582.         else
  583.           return true
  584.         end
  585.       end
  586.     end
  587.   end
  588.   #--------------------------------------------------------------------------
  589.   # ○ 自由選択肢(コマンド)
  590.   #  ※ このメソッドはイベントコマンドの実行に類するメソッドです。
  591.   #     実行しながら@indexを進ませています。
  592.   #     ただし、test_indexが与えられている場合は選択肢を生成し、
  593.   #     結果として返えすのみで、@indexは進めません。
  594.   #--------------------------------------------------------------------------
  595.   def command_setup_free_choice(test_index = nil)
  596.     index = test_index ? test_index : @index
  597.     choices = Game_Choices.new
  598.    
  599.     unless /[::]/ =~ @list[index].parameters[0]
  600.       if test_index
  601.         return choices
  602.       else
  603.         return
  604.       end
  605.     end
  606.    
  607.     option_text = $`
  608.     choices.get_option(option_text)
  609.     text = conversion_choices_switch_data($')
  610.     choices.create_free_choices(text)
  611.    
  612.     index += 1
  613.     while @list[index].code == 408           # 注釈データから追加
  614.       text = conversion_choices_switch_data(@list[index].parameters[0])
  615.       choices.create_free_choices(text)
  616.       index += 1
  617.     end
  618.     unless option_text.include?("準備")
  619.       while @list[index].code == 108 and     # 追加選択肢を追加
  620.             (/\A追加選択肢\s?[::]/ =~ @list[index].parameters[0])
  621.         text = conversion_choices_switch_data($')
  622.         choices.create_free_choices(text)
  623.         index += 1
  624.         while @list[index].code == 408       # さらに注釈データから追加
  625.           text = conversion_choices_switch_data(@list[index].parameters[0])
  626.           choices.create_free_choices(text)
  627.           index += 1
  628.         end
  629.       end
  630.     end
  631.    
  632.     if test_index
  633.       return choices
  634.     else
  635.       $game_temp.choices = choices
  636.       if choices_check?(option_text)                   # 選択肢チェックの場合
  637.         $game_variables[Expansion_Choices::CHOICE_RESUIT_VARIABLES] = $game_temp.choices.active_item_index.size
  638.         return true
  639.       elsif $game_temp.choices.active_item_index.size == 0       # 選択肢が無効の場合
  640.         $game_variables[Expansion_Choices::CHOICE_RESUIT_VARIABLES] = -1
  641.         return true
  642.       elsif $game_temp.choices.size == 1 and choices_one?(option_text)
  643.                                                        # 択一自動選択の場合
  644.         $game_temp.choices.proc.call($game_temp.choices.active_item_index[0])
  645.         return true
  646.       elsif choices_start?(option_text)                # 選択肢開始
  647.         if start_display_choices
  648.           @index = index
  649.           return false
  650.         else
  651.           return true
  652.         end
  653.       end
  654.     end
  655.   end
  656.   #--------------------------------------------------------------------------
  657.   # ○ 自由選択肢内のスイッチデータをコードに変換
  658.   #--------------------------------------------------------------------------
  659.   def conversion_choices_switch_data(text)
  660.    
  661.     # スイッチから非表示を取得
  662.     while text =~ /\\S\[([0-9]+)\]/i
  663.       if $game_switches[$1.to_i] # スイッチonなら表示
  664.         text = text.sub(/\\S\[#{$1.to_i}\]/i, "")
  665.       else                       # スイッチoffなら非表示
  666.         text = text.sub(/\\S\[#{$1.to_i}\]/i, "<ch>")
  667.       end
  668.     end
  669.    
  670.     # セルフスイッチから非表示を取得
  671.     while text =~ /\\S\[([A-D])\]/i
  672.       if @original_event_id > 0          # マップイベントでない?
  673.         key = [@map_id, @original_event_id, $1.upcase]
  674.         unless $game_self_switches[key]  # セルフスイッチoffなら非表示
  675.           text = text.sub(/\\S\[#{$1}\]/i, "<ch>")
  676.         end
  677.       end
  678.       text = text.sub(/\\S\[#{$1}\]/i, "") # 該当しなければ表示
  679.     end
  680.    
  681.     # スイッチから選択不可を取得
  682.     while text =~ /\\S\'\[([0-9]+)\]/i
  683.       if $game_switches[$1.to_i] # スイッチonなら選択可
  684.         text = text.sub(/\\S\'\[#{$1.to_i}\]/i, "")
  685.       else                       # スイッチoffなら選択不可
  686.         text = text.sub(/\\S\'\[#{$1.to_i}\]/i, "<cns>")
  687.       end
  688.     end
  689.    
  690.     # セルフスイッチから選択不可を取得
  691.     while text =~ /\\S\'\[([A-D])\]/i
  692.       if @original_event_id > 0          # マップイベントでない?
  693.         key = [@map_id, @original_event_id, $1.upcase]
  694.         unless $game_self_switches[key]  # セルフスイッチoffなら選択不可
  695.           text = text.sub(/\\S\'\[#{$1}\]/i, "<cns>")
  696.         end
  697.       end
  698.       text = text.sub(/\\S\'\[#{$1}\]/i, "") # 該当しなければ選択可
  699.     end
  700.     return text
  701.   end
  702.   #--------------------------------------------------------------------------
  703.   # ○ パーティー選択肢の生成
  704.   #--------------------------------------------------------------------------
  705.   def setup_party_choice
  706.     choices = Game_Choices.new
  707.     for i in 0...$game_party.members.size
  708.       actor = $game_party.members[i]
  709.       choices.choices.push(actor.name)
  710.       choices.actor_id.push(actor.id)
  711.     end
  712.     return choices
  713.   end
  714.   #--------------------------------------------------------------------------
  715.   # ○ グループ選択肢の生成
  716.   #--------------------------------------------------------------------------
  717.   def setup_group_choice(group_id)
  718.     choices = Game_Choices.new
  719.     unless $game_party.group[group_id].nil?
  720.       for i in 0...$game_party.group[group_id].size
  721.         actor = $game_actors[$game_party.group[group_id][i]]
  722.         choices.choices.push(actor.name)
  723.         choices.actor_id.push(actor.id)
  724.       end
  725.     end
  726.     return choices
  727.   end
  728.   #--------------------------------------------------------------------------
  729.   # ○ パーティーIDの取得
  730.   #--------------------------------------------------------------------------
  731.   def actor_choice_addition_party
  732.     array = []
  733.     for actor in $game_party.members
  734.       array.push(actor.id)
  735.     end
  736.     return array
  737.   end
  738.   #--------------------------------------------------------------------------
  739.   # ○ グループIDの取得
  740.   #--------------------------------------------------------------------------
  741.   def actor_choice_addition_group(group_id)
  742.     return [] if $game_party.group[group_id].nil?
  743.     array = $game_party.group[group_id]
  744.     return array
  745.   end
  746.   #--------------------------------------------------------------------------
  747.   # ○ ステート付加者IDの取得
  748.   #--------------------------------------------------------------------------
  749.   def actor_choice_addition_state(state_id)
  750.     array = []
  751.     for i in 1...$data_actors.size
  752.       actor = $game_actors[i]
  753.       array.push(i) if actor.state?(state_id)
  754.     end
  755.     return array
  756.   end
  757.   #--------------------------------------------------------------------------
  758.   # ○ レベル到達者の取得
  759.   #--------------------------------------------------------------------------
  760.   def actor_choice_addition_level(level)
  761.     array = []
  762.     for i in 1...$data_actors.size
  763.       actor = $game_actors[i]
  764.       array.push(i) if actor.level >= level
  765.     end
  766.     return array
  767.   end
  768.   #--------------------------------------------------------------------------
  769.   # ○ 負傷者IDの取得
  770.   #--------------------------------------------------------------------------
  771.   def actor_choice_addition_injure
  772.     array = []
  773.     for i in 1...$data_actors.size
  774.       actor = $game_actors[i]
  775.       array.push(i) if actor.hp < actor.maxhp
  776.     end
  777.     return array
  778.   end
  779.   #--------------------------------------------------------------------------
  780.   # ○ 選択肢の表示
  781.   #--------------------------------------------------------------------------
  782.   def start_display_choices
  783.     return true if $game_temp.choices.size == 0
  784.     if $game_temp.choices.window_type != -1 or
  785.        $game_temp.choices.pick_up or
  786.        $game_message.texts.size == 0 or
  787.        $game_message.texts.size + $game_temp.choices.size <= MAX_LINE

  788.       $game_message.face_name = $game_message.last_face_name
  789.       $game_message.face_index = $game_message.last_face_index
  790.       $game_message.background = $game_message.last_background
  791.       $game_message.position = $game_message.last_position
  792.       $game_message.choice_start = $game_message.texts.size
  793.       $game_message.can_not_select = $game_temp.choices.can_not_select_active
  794.             
  795.       if $game_temp.choices.window_type != -1 or $game_temp.choices.pick_up
  796.         $game_message.choice_max = 4
  797.         $game_message.show_ex_choices = $game_temp.choices
  798.       else
  799.         $game_message.choice_max = $game_temp.choices.size
  800.         for i in 0...$game_temp.choices.size
  801.           text = $game_temp.choices.item[i]
  802.           text = "\x06" + text if $game_temp.choices.choice_show_fast
  803.           if $game_message.can_not_select.include?(i)
  804.             text = "\x01[#{8}]" + text + "\x01[#{0}]"
  805.           end
  806.           $game_message.texts.push(text)
  807.         end
  808.       end

  809.       if $game_temp.choices.cancel_type == 0
  810.         $game_message.choice_cancel_type = 0
  811.       else
  812.         $game_message.choice_cancel_type = -1
  813.       end
  814.       
  815.       $game_message.choice_proc = $game_temp.choices.proc
  816.       tig_ec_set_message_waiting
  817.       return true
  818.     end
  819.     return false
  820.   end
  821.   #--------------------------------------------------------------------------
  822.   # ○ オプション用テキストから即実行すべき選択肢か判別
  823.   #--------------------------------------------------------------------------
  824.   def choices_start?(option_text)
  825.     return false if option_text.include?("準備")         # 選択肢準備のみの取得
  826.     return false if choices_check?(option_text)          # 選択肢チェックの場合
  827.     return true
  828.   end
  829.   #--------------------------------------------------------------------------
  830.   # ○ オプション用テキストから選択肢チェックか判別
  831.   #--------------------------------------------------------------------------
  832.   def choices_check?(option_text)
  833.     return true if option_text.include?("チェック")     # 選択肢チェックの取得
  834.     return false
  835.   end
  836.   #--------------------------------------------------------------------------
  837.   # ○ オプション用テキストから選択肢が一つの際の自動選択か判別
  838.   #--------------------------------------------------------------------------
  839.   def choices_one?(option_text)
  840.     return true if /[\'’]/ =~ option_text        # 選択肢が一つの際の自動選択
  841.     return false
  842.   end
  843.   #--------------------------------------------------------------------------
  844.   # ○ 注釈を使用したその他の選択肢コマンドへの振り分け
  845.   #--------------------------------------------------------------------------
  846.   def choices_command
  847.     return false if @list[@index].code != 108
  848.     text = @list[@index].parameters[0]
  849.     if /\A追加選択肢\s?[::]/ =~ text
  850.       additional_choices
  851.       return true
  852.     elsif /\Aオプションを?取得[::]/ =~ text
  853.       $game_temp.choices.get_option($')
  854.       return true
  855.     elsif /\Aヘルプ/ =~ text
  856.       if /[::]/ =~ text
  857.         text = $'
  858.         if /\[(\d+)\]/ =~ $`
  859.           index = $1.to_i - 1
  860.         else
  861.           index = nil
  862.         end
  863.         $game_temp.choices.set_help(text, index)
  864.       end
  865.       return true
  866.     elsif /\A有効な?選択肢数を?取得/ =~ text
  867.       $game_variables[Expansion_Choices::CHOICE_RESUIT_VARIABLES] = $game_temp.choices.active_item_index.size
  868.       return true
  869.     elsif /\Aグループ\[/ =~ text or /\AG\[/i =~ text
  870.       if /\[(\d+)\]を?初期化/ =~ text
  871.         $game_party.group[$1.to_i] = []
  872.         $game_map.need_refresh = true
  873.         return true
  874.       elsif /\[(\d+)\]を?作成[::]/ =~ text
  875.         group_number = $1.to_i
  876.         crowd = $'
  877.         $game_party.group[group_number] = []
  878.         if /\Aパーティー/ =~ crowd
  879.           for actor in $game_party.members
  880.             $game_party.group[group_number].push(actor.id)
  881.           end
  882.         else
  883.           before_group = crowd.split(/[\|\s]/)
  884.           before_group.delete("")
  885.           for i in before_group
  886.             $game_party.group[group_number].push(i.to_i)
  887.           end
  888.         end
  889.         $game_map.need_refresh = true
  890.         return true
  891.       elsif /\[(\d+)\]に?[\((](\d+)[\))]を?追加/ =~ text
  892.         $game_party.group[$1.to_i] = [] if $game_party.group[$1.to_i].nil?
  893.         unless $game_party.group[$1.to_i].include?($2.to_i)
  894.           $game_party.group[$1.to_i].push($2.to_i)
  895.         end
  896.         $game_map.need_refresh = true
  897.         return true
  898.       elsif /\[(\d+)\]に?選択アクターを?追加/ =~ text
  899.         $game_party.group[$1.to_i] = [] if $game_party.group[$1.to_i].nil?
  900.         unless $game_party.group[$1.to_i].include?($game_variables[TARGET_V])
  901.           $game_party.group[$1.to_i].push($game_variables[TARGET_V])
  902.         end
  903.         $game_map.need_refresh = true
  904.         return true
  905.       elsif /\[(\d+)\]か?ら?[\((](\d+)[\))]を?削除/ =~ text
  906.         $game_party.group[$1.to_i] = [] if $game_party.group[$1.to_i].nil?
  907.         $game_party.group[$1.to_i].delete($2.to_i)
  908.         $game_map.need_refresh = true
  909.         return true
  910.       elsif /\[(\d+)\]か?ら?選択アクターを?削除/ =~ text
  911.         $game_party.group[$1.to_i] = [] if $game_party.group[$1.to_i].nil?
  912.         $game_party.group[$1.to_i].delete($game_variables[TARGET_V])
  913.         $game_map.need_refresh = true
  914.         return true
  915.       elsif /\[(\d+)\]へ?に?パーティーを?変更/ =~ text
  916.         $game_party.group[$1.to_i] = [] if $game_party.group[$1.to_i].nil?
  917.         return true if $game_party.group[$1.to_i].empty?
  918.         for m in $game_party.members
  919.           $game_party.remove_actor(m.id)
  920.         end
  921.         for i in $game_party.group[$1.to_i]
  922.           $game_party.add_actor(i)
  923.         end
  924.         $game_map.need_refresh = true
  925.         return true
  926.       end
  927.     elsif /\A選択アクターを?予備に?へ?格納/ =~ text
  928.       $game_party.reserve_choice_id = $game_variables[TARGET_V]
  929.     elsif /\A選択アクターを?予備か?ら?[習取]得/ =~ text
  930.       $game_variables[TARGET_V] = $game_party.reserve_choice_id
  931.     end
  932.     return false
  933.   end
  934.   #--------------------------------------------------------------------------
  935.   # ○ 追加選択肢の登録
  936.   #  ※ このメソッドはイベントコマンドの実行に類するメソッドではなく、
  937.   #     あくまで注釈として扱われます。
  938.   #     このメソッド自体には@indexを進ませる処理はありません。
  939.   #--------------------------------------------------------------------------
  940.   def additional_choices
  941.     return unless /[::]/ =~ @list[@index].parameters[0]
  942.     text = conversion_choices_switch_data($')
  943.     $game_temp.choices.create_free_choices(text)
  944.     temp_index = 1
  945.     while @list[@index+temp_index].code == 408 # さらに注釈データから追加
  946.       text = conversion_choices_switch_data(@list[@index+temp_index].parameters[0])
  947.       $game_temp.choices.create_free_choices(text)
  948.       temp_index += 1
  949.     end
  950.   end
  951.   #--------------------------------------------------------------------------
  952.   # ○ 次の選択肢の取得
  953.   #--------------------------------------------------------------------------
  954.   def next_choices_search
  955.     index = @index + 1
  956.     while @list[index].code == 401 or
  957.           @list[index].code == 355 or @list[index].code == 655
  958.       index += 1
  959.     end
  960.     return nil if index >= @list.size - 1
  961.     return nil unless @list[index].code == 108
  962.     return nil if /\A選択肢開始/ =~ @list[index].parameters[0]
  963.     return index if /\A選択肢/ =~ @list[index].parameters[0]
  964.     return nil
  965.   end
  966.   #--------------------------------------------------------------------------
  967.   # ◎ 文章の表示
  968.   #--------------------------------------------------------------------------
  969.   alias tig_ec_command_101 command_101
  970.   def command_101
  971.    
  972.     # 無効な選択肢&択一選択肢の、前置き文章を非表示にする処理
  973.     if /\\\*/ =~ @list[@index + 1].parameters[0]
  974.       next_choices_index = next_choices_search
  975.       unless next_choices_index.nil?
  976.         text = @list[next_choices_index].parameters[0]
  977.         if /[::]パーティー/ =~ text
  978.           choices = command_setup_actor_choice(nil, next_choices_index)
  979.         elsif /[::]グループ\[(\d+)\]/ =~ text
  980.           choices = command_setup_actor_choice($1.to_i, next_choices_index)
  981.         else
  982.           choices = command_setup_free_choice(next_choices_index)
  983.         end
  984.         return true if choices.size == 1 or choices.active_item_index.size == 0
  985.       end
  986.     end
  987.    
  988.     $game_message.last_face_name = @params[0]
  989.     $game_message.last_face_index = @params[1]
  990.     $game_message.last_background = @params[2]
  991.     $game_message.last_position = @params[3]
  992.     return tig_ec_command_101
  993.   end
  994.   #--------------------------------------------------------------------------
  995.   # ◎ 選択肢の表示
  996.   #--------------------------------------------------------------------------
  997.   alias tig_ec_command_102 command_102
  998.   def command_102                      # バックグラウンドと表示位置を取得させる
  999.     $game_message.face_name = $game_message.last_face_name
  1000.     $game_message.face_index = $game_message.last_face_index
  1001.     $game_message.background = $game_message.last_background
  1002.     $game_message.position = $game_message.last_position
  1003.     return tig_ec_command_102
  1004.   end
  1005.   #--------------------------------------------------------------------------
  1006.   # ○ 文章表示のパラメーター履歴初期化
  1007.   #  ※ 選択肢へパラメーターを継続させたくない場合に
  1008.   #     イベントコマンド・スクリプトで実行。
  1009.   #--------------------------------------------------------------------------
  1010.   def last_parameters_clear
  1011.     $game_message.last_face_name = ""
  1012.     $game_message.last_face_index = 0
  1013.     $game_message.last_background = 0
  1014.     $game_message.last_position = 2
  1015.   end
  1016. end

  1017. #==============================================================================
  1018. # ■ Window_Message
  1019. #------------------------------------------------------------------------------
  1020. #  文章表示に使うメッセージウィンドウです。
  1021. #==============================================================================

  1022. class Window_Message < Window_Selectable
  1023.   #--------------------------------------------------------------------------
  1024.   # ◎ オブジェクト初期化
  1025.   #--------------------------------------------------------------------------
  1026.   alias tig_ec_initialize initialize
  1027.   def initialize
  1028.     tig_ec_initialize
  1029.     create_frame_choices_window
  1030.   end
  1031.   #--------------------------------------------------------------------------
  1032.   # ◎ 解放
  1033.   #--------------------------------------------------------------------------
  1034.   alias tig_ec_dispose dispose
  1035.   def dispose
  1036.     tig_ec_dispose
  1037.     dispose_frame_choices_window
  1038.   end
  1039.   #--------------------------------------------------------------------------
  1040.   # ○ 別枠選択肢ウインドウの作成
  1041.   #--------------------------------------------------------------------------
  1042.   def create_frame_choices_window
  1043.     @frame_choices_window = Window_Choice.new
  1044.     @frame_choices_window.z = self.z
  1045.     @frame_choices_window.openness = 0
  1046.     @frame_choices_pickup_window = Window_Pickup.new(@frame_choices_window)
  1047.     @frame_choices_pickup_window.visible = false
  1048.   end
  1049.   #--------------------------------------------------------------------------
  1050.   # ○ 別枠選択肢ウインドウの解放
  1051.   #--------------------------------------------------------------------------
  1052.   def dispose_frame_choices_window
  1053.     @frame_choices_window.dispose
  1054.     @frame_choices_pickup_window.dispose
  1055.   end
  1056.   #--------------------------------------------------------------------------
  1057.   # ◎ フレーム更新
  1058.   #--------------------------------------------------------------------------
  1059.   alias tig_ec_update update
  1060.   def update
  1061.     update_frame_choices_window
  1062.     tig_ec_update
  1063.     unless @opening or @closing
  1064.       if self.openness == 0
  1065.         if $game_message.show_ex_choices and @frame_choices_window.openness == 0
  1066.           start_ex_choice
  1067.         end
  1068.       end
  1069.     end
  1070.     unless @face_sprite.nil?
  1071.       @face_sprite.visible = self.openness == 255 unless @face_sprite.disposed?
  1072.     end
  1073.   end
  1074.   #--------------------------------------------------------------------------
  1075.   # ○ 別枠選択肢ウインドウの更新
  1076.   #--------------------------------------------------------------------------
  1077.   def update_frame_choices_window
  1078.     @frame_choices_window.update
  1079.     @frame_choices_pickup_window.update
  1080.   end
  1081.   #--------------------------------------------------------------------------
  1082.   # ◎ 選択肢の開始
  1083.   #--------------------------------------------------------------------------
  1084.   alias tig_ec_start_choice start_choice
  1085.   def start_choice
  1086.     return start_ex_choice if $game_message.show_ex_choices
  1087.     tig_ec_start_choice
  1088.   end
  1089.   #--------------------------------------------------------------------------
  1090.   # ○ 別枠ウインドウ選択肢の開始
  1091.   #--------------------------------------------------------------------------
  1092.   def start_ex_choice
  1093.     self.active = true
  1094.     self.index = -1
  1095.     @frame_choices_window.setting($game_message.show_ex_choices)
  1096.     @frame_choices_window.open
  1097.     @frame_choices_window.index = 0
  1098.     @frame_choices_pickup_window.refresh
  1099.   end
  1100.   #--------------------------------------------------------------------------
  1101.   # ◎ メッセージの終了
  1102.   #--------------------------------------------------------------------------
  1103.   alias tig_ec_terminate_message terminate_message
  1104.   def terminate_message
  1105.     tig_ec_terminate_message
  1106.     $game_message.show_ex_choices = nil
  1107.     @frame_choices_window.close
  1108.     @frame_choices_window.index = -1
  1109.     @frame_choices_pickup_window.visible = false
  1110.   end
  1111.   #--------------------------------------------------------------------------
  1112.   # ● 選択肢の入力処理
  1113.   #--------------------------------------------------------------------------
  1114.   def input_choice
  1115.     return input_pick_up if $game_temp.choices.pick_up ###
  1116.     if $game_message.show_ex_choices                   ###
  1117.       return if @frame_choices_window.delay != 0
  1118.       index = @frame_choices_window.index              ### 追加部分
  1119.     else                                               ###
  1120.       index = self.index                               ###
  1121.     end                                                ###
  1122.       
  1123.     if Input.trigger?(Input::B)
  1124.       Sound.play_cancel                                ### 追加部分
  1125.       if $game_message.choice_cancel_type != 0         ### 変更部分  > → !=
  1126.         #Sound.play_cancel                             ### コメントアウト
  1127.         scroll_contents_clear                          ### 追加部分
  1128.         $game_message.choice_proc.call($game_message.choice_cancel_type - 1)
  1129.         terminate_message
  1130.       end
  1131.     elsif Input.trigger?(Input::C)
  1132.       return if can_not_select?(index)                 ### 追加・変更部分
  1133.       Sound.play_decision
  1134.       scroll_contents_clear                            ### 追加部分
  1135.       $game_message.choice_proc.call(index)            ### 変更部分
  1136.       terminate_message
  1137.     end
  1138.   end
  1139.   #--------------------------------------------------------------------------
  1140.   # ○ 選択肢ピックアップの処理
  1141.   #--------------------------------------------------------------------------
  1142.   def input_pick_up
  1143.     if Input.trigger?(Input::B)
  1144.       Sound.play_cancel
  1145.       if $game_message.show_ex_choices.pick_up.empty?
  1146.         $game_variables[Expansion_Choices::CHOICE_RESUIT_VARIABLES] = 0
  1147.         scroll_contents_clear
  1148.         $game_message.show_ex_choices.pick_up = nil
  1149.         $game_message.show_ex_choices.pick_up_result = -1
  1150.         terminate_message
  1151.       else
  1152.         $game_message.show_ex_choices.pick_up.pop
  1153.         @frame_choices_window.index = [@frame_choices_window.index, 0].max
  1154.         @frame_choices_window.refresh
  1155.         @frame_choices_pickup_window.refresh
  1156.       end
  1157.     elsif $game_message.show_ex_choices.pick_up_canstop and Input.trigger?(Input::A)
  1158.       if $game_message.show_ex_choices.pick_up.size == 0
  1159.         Sound.play_buzzer
  1160.       else
  1161.         Sound.play_decision unless @frame_choices_window.index == -1
  1162.         @frame_choices_window.index = -1
  1163.       end
  1164.     elsif Input.trigger?(Input::C)
  1165.       if @frame_choices_window.index == -1
  1166.         Sound.play_decision
  1167.         if $game_message.show_ex_choices.actor_choice?
  1168.           array = []
  1169.           for i in $game_message.show_ex_choices.pick_up
  1170.             array.push($game_message.show_ex_choices.actor_id[i])
  1171.           end
  1172.           if $game_message.show_ex_choices.pick_up_result >= 0
  1173.             $game_party.group[$game_message.show_ex_choices.pick_up_result] = array
  1174.           end
  1175.         else
  1176.           array = []
  1177.           for i in $game_message.show_ex_choices.pick_up
  1178.             array.push(i + 1)
  1179.           end
  1180.           if $game_message.show_ex_choices.pick_up_result >= 0
  1181.             $game_party.group[$game_message.show_ex_choices.pick_up_result] = $game_message.show_ex_choices.pick_up
  1182.           end  
  1183.         end
  1184.         $game_variables[Expansion_Choices::CHOICE_RESUIT_VARIABLES] = $game_party.group[$game_message.show_ex_choices.pick_up_result][0]
  1185.         scroll_contents_clear
  1186.         $game_message.show_ex_choices.pick_up = nil
  1187.         $game_message.show_ex_choices.pick_up_result = 0
  1188.         terminate_message
  1189.       else
  1190.         return if can_not_select?(@frame_choices_window.index)
  1191.         Sound.play_decision
  1192.         $game_message.show_ex_choices.pick_up.push($game_message.show_ex_choices.display_item_index[@frame_choices_window.index])
  1193.         @frame_choices_window.refresh
  1194.         @frame_choices_pickup_window.refresh
  1195.         if $game_message.show_ex_choices.pick_up_limit == $game_message.show_ex_choices.pick_up.size
  1196.           @frame_choices_window.index = -1
  1197.         end
  1198.       end
  1199.     end
  1200.   end
  1201.   #--------------------------------------------------------------------------
  1202.   # ○ 選択不能項目を選択した場合の処理
  1203.   #  ※ 選択肢が選択不能だった場合、真(true)の結果を返すと共にブザー音を鳴らす。
  1204.   #--------------------------------------------------------------------------
  1205.   def can_not_select?(index)
  1206.     return false if $game_temp.choices.display_item_index.empty?
  1207.     if $game_temp.choices.can_not_select_active.include?(index)
  1208.       Sound.play_buzzer
  1209.       return true
  1210.     elsif $game_temp.choices.price[$game_temp.choices.display_item_index[index]]
  1211.       if $game_temp.choices.price[$game_temp.choices.display_item_index[index]] > $game_party.gold
  1212.         Sound.play_buzzer
  1213.         return true
  1214.       end
  1215.     end
  1216.     return false
  1217.   end
  1218.   #--------------------------------------------------------------------------
  1219.   # ○ 4項目を超える選択肢後のウインドウ内項目の初期化
  1220.   #--------------------------------------------------------------------------
  1221.   def scroll_contents_clear  
  1222.     if $game_message.choice_max > MAX_LINE
  1223.       @item_max = 0
  1224.       self.oy = 0
  1225.       create_contents
  1226.     end
  1227.   end
  1228.   #--------------------------------------------------------------------------
  1229.   # ◎ 特殊文字の変換
  1230.   #--------------------------------------------------------------------------
  1231.   alias tig_ec_convert_special_characters convert_special_characters
  1232.   def convert_special_characters
  1233.     @text.gsub!(/\\N\[選択アクター\]/i) { $game_actors[$game_variables[Expansion_Choices::TARGET_ACTOR_ID_VARIABLES]].name }
  1234.     @text.gsub!(/\\N\[選択\]/i) { $game_actors[$game_variables[Expansion_Choices::TARGET_ACTOR_ID_VARIABLES]].name }
  1235.     @text.gsub!(/\\N\[choice\]/i) { $game_actors[$game_variables[Expansion_Choices::TARGET_ACTOR_ID_VARIABLES]].name }
  1236.     @text.gsub!(/\\N\[予備アクター\]/i) { $game_actors[$game_party.reserve_choice_id].name }
  1237.     @text.gsub!(/\\N\[予備\]/i) { $game_actors[$game_party.reserve_choice_id].name }
  1238.     @text.gsub!(/\\N\[reserve\]/i) { $game_actors[$game_party.reserve_choice_id].name }
  1239.     @text.gsub!(/\\N\[選択項目\]/i) { $game_temp.last_select_choice }
  1240.     @text.gsub!(/\\\*/){ "" }   
  1241.     tig_ec_convert_special_characters
  1242.   end
  1243.   #--------------------------------------------------------------------------
  1244.   # ◎ メッセージの開始
  1245.   #--------------------------------------------------------------------------
  1246.   alias tig_ec_start_message start_message
  1247.   def start_message
  1248.     face_sprite_dispose
  1249.     tig_ec_start_message
  1250.     if @item_max > MAX_LINE
  1251.       create_contents        # 最大項目以上の選択肢の際に項目をすべて線画させる
  1252.       unless $game_message.face_name.empty?
  1253.         draw_face_sprite($game_message.face_name, $game_message.face_index)
  1254.       end
  1255.     end
  1256.   end
  1257.   #--------------------------------------------------------------------------
  1258.   # ◎ 改ページ処理
  1259.   #--------------------------------------------------------------------------
  1260.   alias tig_ec_new_page new_page
  1261.   def new_page
  1262.     tig_ec_new_page
  1263.     if @item_max > 4
  1264.       @line_count = 4 - @item_max
  1265.     end
  1266.   end
  1267.   #--------------------------------------------------------------------------
  1268.   # ○ 顔グラフィック(スプライト)の描画
  1269.   #     face_name  : 顔グラフィック ファイル名
  1270.   #     face_index : 顔グラフィック インデックス
  1271.   #     size       : 表示サイズ
  1272.   #--------------------------------------------------------------------------
  1273.   def draw_face_sprite(face_name, face_index, size = 96)
  1274.     rect = Rect.new(0, 0, 0, 0)
  1275.     rect.x = face_index % 4 * 96 + (96 - size) / 2
  1276.     rect.y = face_index / 4 * 96 + (96 - size) / 2
  1277.     rect.width = size
  1278.     rect.height = size
  1279.     @face_sprite = Sprite.new
  1280.     @face_sprite.bitmap = Cache.face(face_name)
  1281.     @face_sprite.src_rect = rect
  1282.     @face_sprite.z = 200
  1283.     @face_sprite.x = self.x + 16
  1284.     @face_sprite.y = self.y + 16
  1285.   end
  1286.   #--------------------------------------------------------------------------
  1287.   # ○ 顔グラフィック(スプライト)の開放
  1288.   #--------------------------------------------------------------------------
  1289.   def face_sprite_dispose
  1290.     unless @face_sprite.nil?
  1291.       @face_sprite.dispose unless @face_sprite.disposed?
  1292.     end
  1293.   end
  1294.   #--------------------------------------------------------------------------
  1295.   # ○ 開放
  1296.   #--------------------------------------------------------------------------
  1297.   def dispose
  1298.     super
  1299.     face_sprite_dispose
  1300.   end
  1301.   #--------------------------------------------------------------------------
  1302.   # ○ ウィンドウを閉じる
  1303.   #--------------------------------------------------------------------------
  1304.   def close
  1305.     super
  1306.     face_sprite_dispose
  1307.   end
  1308.   #--------------------------------------------------------------------------
  1309.   # ● カーソルの更新
  1310.   #--------------------------------------------------------------------------
  1311.   def update_cursor
  1312.     if @index < 0                   # カーソル位置が 0 未満の場合
  1313.       self.cursor_rect.empty        # カーソルを無効とする
  1314.     else                            # カーソル位置が 0 以上の場合
  1315.       row = @index / @column_max    # 現在の行を取得
  1316.       if row < top_row              # 表示されている先頭の行より前の場合
  1317.         self.top_row = row          # 現在の行が先頭になるようにスクロール
  1318.       end
  1319.       if row > bottom_row           # 表示されている末尾の行より後ろの場合
  1320.         self.bottom_row = row       # 現在の行が末尾になるようにスクロール
  1321.       end
  1322.       x = $game_message.face_name.empty? ? 0 : 112
  1323.       y = ($game_message.choice_start + @index) * WLH
  1324.       y -= self.oy
  1325.       self.cursor_rect.set(x, y, contents.width - x, WLH)
  1326.     end
  1327.   end
  1328.   #--------------------------------------------------------------------------
  1329.   # ◎ 文章送りの入力処理
  1330.   #--------------------------------------------------------------------------
  1331.   alias tig_ec_input_pause input_pause
  1332.   def input_pause
  1333.     if $game_message.cancel_input
  1334.       if Input.trigger?(Input::B)
  1335.         Sound.play_cancel
  1336.         $game_variables[Expansion_Choices::CHOICE_RESUIT_VARIABLES] = 0
  1337.       elsif Input.trigger?(Input::C)
  1338.         Sound.play_decision
  1339.         $game_variables[Expansion_Choices::CHOICE_RESUIT_VARIABLES] = -1
  1340.       end
  1341.     end
  1342.     tig_ec_input_pause
  1343.   end
  1344. end

  1345. #==============================================================================
  1346. # □ Window_Choice
  1347. #------------------------------------------------------------------------------
  1348. #  別枠選択肢の表示用のウインドウです。
  1349. #==============================================================================

  1350. class Window_Choice < Window_Selectable
  1351.   #--------------------------------------------------------------------------
  1352.   # ○ 公開インスタンス変数
  1353.   #--------------------------------------------------------------------------
  1354.   attr_reader   :choice
  1355.   attr_reader   :window_row_max
  1356.   attr_accessor :delay
  1357.   #--------------------------------------------------------------------------
  1358.   # ○ オブジェクト初期化
  1359.   #--------------------------------------------------------------------------
  1360.   def initialize
  1361.     super(0, 0, 64, 64)
  1362.     @column_max = 1
  1363.     @spacing = 16
  1364.     @delay = 0
  1365.     create_help_window
  1366.     create_gold_window
  1367.   end
  1368.   #--------------------------------------------------------------------------
  1369.   # ○ ウインドウタイプの取得
  1370.   #--------------------------------------------------------------------------
  1371.   def window_type
  1372.     return -1 if @choice == nil
  1373.     return @choice.window_type
  1374.   end
  1375.   #--------------------------------------------------------------------------
  1376.   # ○ ウインドウセッティング
  1377.   #--------------------------------------------------------------------------
  1378.   def setting(choice)
  1379.     @choice = choice
  1380.     @item_max = @choice.size
  1381.     case @choice.window_type
  1382.     when -1 # 選択肢ピックアップで使用される位置設定
  1383.       @window_row_max = 9
  1384.       set_column_max
  1385.       self.width = choise_width
  1386.       self.height = choise_height
  1387.       self.x = 288
  1388.       self.y = center_y(144)
  1389.     when 0 # レス用メッセージウインドウ位置
  1390.       @window_row_max = 4
  1391.       set_column_max
  1392.       self.width = 544
  1393.       self.height = 128
  1394.       self.x = 0
  1395.       case $game_message.position
  1396.       when 0 ; self.y = 288 # 上
  1397.       when 1 ; self.y = 288 # 真ん中
  1398.       when 2 ; self.y = 0   # 下
  1399.       end
  1400.     when 1 # メッセージウインドウが上or下位置の際に適した位置
  1401.       @window_row_max = 4
  1402.       set_column_max
  1403.       self.width = choise_width
  1404.       self.height = choise_height
  1405.       self.x = align_right_x(480)
  1406.       self.y = center_y(208)
  1407.     when 2 # ヘルプウインドウ&下位置の組み合わせに適したやや上への位置
  1408.       @window_row_max = 7
  1409.       set_column_max
  1410.       self.width = choise_width
  1411.       self.height = choise_height
  1412.       self.x = align_right_x(480)
  1413.       self.y = center_y(172)
  1414.     when 3 # ENDウインドウのような中央揃えの位置
  1415.       @window_row_max = 4
  1416.       set_column_max
  1417.       self.width = choise_width
  1418.       self.height = choise_height
  1419.       self.x = center_x(272)
  1420.       self.y = center_y(208)
  1421.     when 4 # ショップ風選択肢用(メッセウインドウ下位置、ヘルプ・ゴールド使用)
  1422.       @window_row_max = 7
  1423.       set_column_max
  1424.       self.width = choise_width
  1425.       self.height = choise_height
  1426.       self.x = 50
  1427.       self.y = center_y(172)
  1428.     end
  1429.     self.index = 0
  1430.     refresh
  1431.   end
  1432.   #--------------------------------------------------------------------------
  1433.   # ○ 桁数のセット
  1434.   #--------------------------------------------------------------------------
  1435.   def set_column_max
  1436.     if @choice.column
  1437.       @column_max = @choice.size / @window_row_max
  1438.       @column_max += 1 if @choice.size % @window_row_max != 0
  1439.     else
  1440.       @column_max = 1
  1441.     end
  1442.   end
  1443.   #--------------------------------------------------------------------------
  1444.   # ○ 選択肢幅に合わせたウインドウ幅の取得
  1445.   #--------------------------------------------------------------------------
  1446.   def choise_width
  1447.     size = 32
  1448.     for i in @choice.choices
  1449.       size = [size, self.contents.text_size(i).width].max + 1
  1450.     end
  1451.     unless @choice.icon.empty?     # アイコン付きならばその表示の為に幅を拡張
  1452.       size += 24
  1453.     end
  1454.     unless @choice.price.empty?    # 値段が付いていればその表示の為に幅を拡張
  1455.       size += 80
  1456.       cx = contents.text_size(Vocab::gold).width
  1457.       size += cx if contents.text_size(Vocab::gold).width <= 36
  1458.     end
  1459.     size *= @column_max
  1460.     unless @choice.face_name == "" # フェイス付きならばその表示の為に幅を拡張
  1461.       size += 112
  1462.     end
  1463.     return size + (@spacing * (@column_max - 1)) + 32 + 1
  1464.   end
  1465.   #--------------------------------------------------------------------------
  1466.   # ○ 選択項目数に合わせたウインドウ高さの取得
  1467.   #--------------------------------------------------------------------------
  1468.   def choise_height
  1469.     row = row_max
  1470.     row += @choice.pick_up.size if @choice.pick_up
  1471.     height = row * WLH
  1472.     unless @choice.face_name == ""
  1473.       height = [96, height].max
  1474.     end
  1475.     max_height = @window_row_max * WLH
  1476.     return [height, max_height].min + 32
  1477.   end
  1478.   #--------------------------------------------------------------------------
  1479.   # ○ 引数を中心とした場合のウインドウX座標の取得(中央揃え)
  1480.   #--------------------------------------------------------------------------
  1481.   def center_x(x)
  1482.     return x - self.width / 2
  1483.   end
  1484.   #--------------------------------------------------------------------------
  1485.   # ○ 引数をウインドウ終点とした場合のウインドウX座標の取得(右詰め)
  1486.   #--------------------------------------------------------------------------
  1487.   def align_right_x(x)
  1488.     return x - self.width
  1489.   end
  1490.   #--------------------------------------------------------------------------
  1491.   # ○ 引数を中心とした場合のウインドウY座標の取得(中央揃え)
  1492.   #--------------------------------------------------------------------------
  1493.   def center_y(y)
  1494.     return y - self.height / 2
  1495.   end
  1496.   #--------------------------------------------------------------------------
  1497.   # ○ 引数をウインドウ終点とした場合のウインドウY座標の取得(下詰め)
  1498.   #--------------------------------------------------------------------------
  1499.   def align_bottom_y(y)
  1500.     return y - self.height
  1501.   end
  1502.   #--------------------------------------------------------------------------
  1503.   # ○ ヘルプウインドウの作成
  1504.   #--------------------------------------------------------------------------
  1505.   def create_help_window
  1506.     @help_window = Window_Help.new
  1507.     @help_window.visible = false
  1508.   end
  1509.   #--------------------------------------------------------------------------
  1510.   # ○ 所持金ウィンドウの作成
  1511.   #--------------------------------------------------------------------------
  1512.   def create_gold_window
  1513.     @gold_window = Window_Gold.new(384, 0)
  1514.     @gold_window.visible = false
  1515.   end
  1516.   #--------------------------------------------------------------------------
  1517.   # ○ 開放
  1518.   #--------------------------------------------------------------------------
  1519.   def dispose
  1520.     super
  1521.     face_sprite_dispose
  1522.     dispose_gold_window
  1523.     dispose_gold_window
  1524.   end
  1525.   #--------------------------------------------------------------------------
  1526.   # ○ ヘルプウインドウの解放
  1527.   #--------------------------------------------------------------------------
  1528.   def dispose_help_window
  1529.     @help_window.dispose
  1530.   end
  1531.   #--------------------------------------------------------------------------
  1532.   # ○ 所持金ウィンドウの解放
  1533.   #--------------------------------------------------------------------------
  1534.   def dispose_gold_window
  1535.     @gold_window.dispose
  1536.   end
  1537.   #--------------------------------------------------------------------------
  1538.   # ○ リフレッシュ
  1539.   #--------------------------------------------------------------------------
  1540.   def refresh
  1541.     @item_max = @choice.size
  1542.     create_contents
  1543.     return if @choice.nil?
  1544.     unless @choice.face_name == ""               # フェイスあり
  1545.       draw_face_sprite(@choice.face_name, @choice.face_index, @choice.re_face)
  1546.     end
  1547.     for i in 0...@item_max
  1548.       draw_item(i)
  1549.     end
  1550.     @index = [@index, @item_max - 1].min
  1551.     unless @index < 0
  1552.       self.bottom_row = [@index / @column_max, self.bottom_row].min  
  1553.     end
  1554.   end
  1555.   #--------------------------------------------------------------------------
  1556.   # ○ 項目を描画する矩形の取得
  1557.   #     index : 項目番号
  1558.   #--------------------------------------------------------------------------
  1559.   def item_rect(index)
  1560.     rect = Rect.new(0, 0, 0, 0)
  1561.     width = contents.width
  1562.     width -= 112 if @choice.face_name != ""
  1563.     rect.width = (width + @spacing) / @column_max - @spacing
  1564.     rect.height = WLH
  1565.     rect.x = index % @column_max * (rect.width + @spacing)
  1566.     rect.x += 112 if @choice.face_name != "" and not @choice.re_face
  1567.     rect.y = index / @column_max * WLH
  1568.     return rect
  1569.   end
  1570.   #--------------------------------------------------------------------------
  1571.   # ○ 項目の描画
  1572.   #--------------------------------------------------------------------------
  1573.   def draw_item(index)
  1574.     rect = item_rect(index)
  1575.     self.contents.clear_rect(rect)
  1576.     if @choice.icon[@choice.display_item_index[index]]           # アイコンあり
  1577.       draw_icon(@choice.icon[@choice.display_item_index[index]], rect.x, rect.y, enabled(index))
  1578.     end
  1579.     unless @choice.icon.empty?
  1580.       rect.x += 24
  1581.       rect.width -= 24
  1582.     end
  1583.     self.contents.font.color = normal_color
  1584.     self.contents.font.color.alpha = enabled(index) ? 255 : 128
  1585.     self.contents.draw_text(rect, @choice.item[index])
  1586.     if @choice.price[@choice.display_item_index[index]]          # 値段表示あり
  1587.       value = @choice.price[@choice.display_item_index[index]]
  1588.       rect.width -= 4
  1589.       cx = contents.text_size(Vocab::gold).width
  1590.       if cx <= 36            # 通貨単位が短ければあわせて表示、長い場合は非表示
  1591.         self.contents.font.color = system_color
  1592.         self.contents.font.color.alpha = enabled(index) ? 255 : 128
  1593.         self.contents.draw_text(rect, Vocab::gold, 2)
  1594.         rect.width -= ( cx + 2 )
  1595.       end
  1596.       self.contents.font.color = normal_color
  1597.       self.contents.font.color.alpha = enabled(index) ? 255 : 128
  1598.       self.contents.draw_text(rect, value, 2)
  1599.     end
  1600.   end
  1601.   #--------------------------------------------------------------------------
  1602.   # ○ 顔グラフィック(スプライト)の描画
  1603.   #     face_name  : 顔グラフィック ファイル名
  1604.   #     face_index : 顔グラフィック インデックス
  1605.   #     size       : 表示サイズ
  1606.   #--------------------------------------------------------------------------
  1607.   def draw_face_sprite(face_name, face_index, re_fase, size = 96)
  1608.    
  1609.     rect = Rect.new(0, 0, 0, 0)
  1610.     rect.x = face_index % 4 * 96 + (96 - size) / 2
  1611.     rect.y = face_index / 4 * 96 + (96 - size) / 2
  1612.     rect.width = size
  1613.     rect.height = size
  1614.     @face_sprite = Sprite.new
  1615.     @face_sprite.bitmap = Cache.face(face_name)
  1616.     @face_sprite.src_rect = rect
  1617.     @face_sprite.z = 200
  1618.     if re_fase
  1619.       @face_sprite.x = self.x + self.width - size - 16
  1620.       @face_sprite.mirror = true
  1621.     else
  1622.       @face_sprite.x = self.x + 16
  1623.     end
  1624.     @face_sprite.y = self.y + 16
  1625.   end
  1626.   #--------------------------------------------------------------------------
  1627.   # ○ 顔グラフィック(スプライト)の開放
  1628.   #--------------------------------------------------------------------------
  1629.   def face_sprite_dispose
  1630.     unless @face_sprite.nil?
  1631.       @face_sprite.dispose unless @face_sprite.disposed?
  1632.     end
  1633.   end
  1634.   #--------------------------------------------------------------------------
  1635.   # ○ 項目の有効フラグ
  1636.   #--------------------------------------------------------------------------
  1637.   def enabled(index)
  1638.     return false if @choice.can_not_select_active.include?(index)
  1639.     if @choice.price[@choice.display_item_index[index]]
  1640.       if @choice.price[@choice.display_item_index[index]] > $game_party.gold
  1641.         return false
  1642.       end
  1643.     end
  1644.     return true
  1645.   end
  1646.   #--------------------------------------------------------------------------
  1647.   # ○ フレーム更新
  1648.   #--------------------------------------------------------------------------
  1649.   def update
  1650.     super
  1651.     @delay -= 1 unless @delay == 0
  1652.     @help_window.update
  1653.     @gold_window.update
  1654.     unless @face_sprite.nil?
  1655.       @face_sprite.visible = self.openness == 255 unless @face_sprite.disposed?
  1656.     end
  1657.   end
  1658.   #--------------------------------------------------------------------------
  1659.   # ○ ウィンドウを開く
  1660.   #--------------------------------------------------------------------------
  1661.   def open
  1662.     super
  1663.     return unless @opening
  1664.     if $game_message.show_ex_choices.help_text != []
  1665.       @help_window.visible = true
  1666.     end
  1667.     unless @choice.price.empty?
  1668.       @gold_window.y = $game_message.show_ex_choices.help_text.empty? ? 0 : 56
  1669.       @gold_window.refresh
  1670.       @gold_window.visible = true
  1671.     end
  1672.     @delay = Expansion_Choices::EX_CHOICES_DELAY  # 延滞フレーム数
  1673.   end
  1674.   #--------------------------------------------------------------------------
  1675.   # ○ ウィンドウを閉じる
  1676.   #--------------------------------------------------------------------------
  1677.   def close
  1678.     super
  1679.     return unless @closing
  1680.     face_sprite_dispose
  1681.     @help_window.visible = false
  1682.     @gold_window.visible = false
  1683.   end
  1684.   #--------------------------------------------------------------------------
  1685.   # ○ ヘルプテキスト更新
  1686.   #--------------------------------------------------------------------------
  1687.   def update_help
  1688.     return if @choice.nil?
  1689.     if @choice.display_item_index[@index].nil?
  1690.       @help_window.set_text("")
  1691.     else
  1692.       text = @choice.help_text[@choice.display_item_index[@index]]
  1693.       @help_window.set_text(text.nil? ? "" : text)
  1694.     end
  1695.   end
  1696. end

  1697. #==============================================================================
  1698. # □ Window_Pickup
  1699. #------------------------------------------------------------------------------
  1700. #  選択肢のピックアップ処理用のウインドウです。
  1701. #==============================================================================

  1702. class Window_Pickup < Window_Selectable
  1703.   #--------------------------------------------------------------------------
  1704.   # ○ オブジェクト初期化
  1705.   #--------------------------------------------------------------------------
  1706.   def initialize(choice_window)
  1707.     @choice_window = choice_window
  1708.     super(0, 0, 64, 64)
  1709.   end
  1710.   #--------------------------------------------------------------------------
  1711.   # ○ リフレッシュ
  1712.   #--------------------------------------------------------------------------
  1713.   def refresh
  1714.     self.x = @choice_window.x - @choice_window.width - 32
  1715.     self.y = @choice_window.y
  1716.     self.width = @choice_window.width
  1717.     self.height = [@choice_window.height, @choice_window.choice.pick_up_limit * WLH + 32].min
  1718.     create_contents
  1719.     return if @choice_window.choice.nil?
  1720.     return if @choice_window.choice.pick_up.nil?
  1721.     self.visible = true
  1722.     @item_max = [@choice_window.choice.pick_up.size, @choice_window.window_row_max].min
  1723.     y = 0
  1724.     ([@choice_window.choice.pick_up.size - @item_max, 0].max).upto(@choice_window.choice.pick_up.size) do |i|
  1725.       draw_item(i, y)
  1726.       y += 1
  1727.     end
  1728.   end
  1729.   #--------------------------------------------------------------------------
  1730.   # ○ 項目の描画
  1731.   #--------------------------------------------------------------------------
  1732.   def draw_item(index, y)
  1733.     return if @choice_window.choice.pick_up[index].nil?
  1734.     rect = item_rect(y)
  1735.     self.contents.clear_rect(rect)
  1736.     self.contents.font.color = normal_color
  1737.     self.contents.draw_text(rect, @choice_window.choice.choices[@choice_window.choice.pick_up[index]])
  1738.   end
  1739. end
复制代码

点评

請問一下,為什麼按x,他不會取消,而是自動進行第二個選項????  发表于 2014-8-16 21:20

评分

参与人数 1星屑 +120 收起 理由
丿梁丶小柒 + 120 认可答案

查看全部评分


  -fk: -azogi:
回复

使用道具 举报

梦石
0
星屑
50
在线时间
32 小时
注册时间
2014-2-8
回帖
5
 楼主| 发表于 2014-8-16 17:13:48 | 显示全部楼层
kuerlulu 发表于 2014-8-16 14:16
食用姿势 :
  • 事件-注释> 選択肢[3]:选项1|选项2 (3代表将窗口放中间)

  • 解決了,十分感謝!

    点评

    这是[默认是取消的选项], 你看看事件里的选项也是这样的, 具体可以设置不过要详细研究一下那个脚本  发表于 2014-8-16 21:43
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 注册会员

    本版积分规则

    Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

    在本版发帖返回顶部