查看: 1639|回复: 6

[已经解决] 事件的流程设置

[复制链接]
梦石
3
星屑
75
在线时间
200 小时
注册时间
2008-7-8
回帖
145
发表于 2015-8-25 11:07:17 | 显示全部楼层 |阅读模式

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

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

×
感觉事件的分支条件设置感觉有点太弱了
比如想设置: 若满足条件1 则出现ABCD选项,否则只出现ABC选项,
结果满足和不满足两边分支都要放上ABC的后续内容,而ABC这部分是完全重复的...
有没有什么方法能减少这种重复的流程设置?

老鹰

梦石
40
星屑
37812
在线时间
7091 小时
注册时间
2012-5-26
回帖
3297

极短24评委极短23参与极短22参与极短21评委老司机慢点开短篇十吟唱者组别冠军开拓者剧作品鉴家

发表于 2015-8-25 12:21:22 | 显示全部楼层
选择框的选项里写if()表示条件满足时出现选项,en()表示条件不满足时为半透明不可选
v[x]表示变量,s[x]表示开关
该脚本自带多选项和选择框显示位置    選択肢位置(x, y[, row])  在选择前面添加注释即可,
多选项直接插入多个选择支,中间不要有间隔
  1. =begin

  2. ▼ 選択肢拡張 ver. 2.3

  3. RPGツクールVXAce用スクリプト

  4. 制作 : 木星ペンギン
  5. URL  : [url]http://woodpenguin.blog.fc2.com/[/url]

  6. ------------------------------------------------------------------------------
  7. 概要

  8. □ 選択肢を連続して設定した場合、つなげて一つの選択肢にする機能の追加。
  9. □ 条件を設定することで、その項目を表示しない機能の追加。
  10. □ 選択肢内容が前回と同じだった場合、
  11.     カーソルの初期位置を前回選んだ項目にする機能の追加。
  12. □ 選択肢ウィンドウの位置を一時的に変更する機能の追加。
  13. □ 条件を設定することで、その項目を半透明にして選択不可にする機能の追加。
  14. □ 選択肢毎にヘルプメッセージを表示できる機能の追加。

  15. ------------------------------------------------------------------------------
  16. 使い方

  17. □ 選択肢の表示を続けて配置すると、一つの選択肢にまとめられます。
  18.   ・「キャンセルの場合」の処理は、無効以外を設定したものが適用され、
  19.      複数ある場合は後に設定された選択肢のものが適用されます。
  20.   
  21. □ 選択肢の文章中に if(条件) と入れ、その条件が偽になると項目が表示されなくなります。
  22.   ・s でスイッチ、v で変数を参照できます。
  23.   ・「キャンセルの場合」の項目が表示されない場合、無効と同じ処理をします。

  24. □ 注釈に以下の文字列を入れることで、選択肢ウィンドウの表示位置を
  25.    一時的に変更することが出来ます。
  26.   
  27.     選択肢位置(x, y[, row])
  28.    
  29.       x   : ウィンドウを表示する X 座標。
  30.       y   : ウィンドウを表示する Y 座標。
  31.       row : 選択肢を表示する最大行数。
  32.             指定しない場合は、通常の最大行数を無視して
  33.             すべての選択肢が表示されます。
  34.   
  35. □ 選択肢の文章中に en(条件) と入れ、その条件が偽になると項目が半透明で表示されます。
  36.   
  37. □ 各項目の下に、注釈で以下の文字列を入れると、続きの文章を
  38.     項目のヘルプメッセージとしてカーソルを合わせたときに標示することができます。
  39.   
  40.     選択肢ヘルプ
  41.    
  42. □ 詳細は下記のサイトを参照してください。

  43.   [url]http://woodpenguin.web.fc2.com/rgss3/choice_ex.html[/url]
  44.   
  45. =end
  46. module WdTk
  47. module ChoiceEX
  48. #//////////////////////////////////////////////////////////////////////////////
  49. #
  50. # 設定項目
  51. #
  52. #//////////////////////////////////////////////////////////////////////////////
  53.   #--------------------------------------------------------------------------
  54.   # ● 選択肢の最大行数
  55.   #     選択肢を表示するウィンドウの行数の最大数です。
  56.   #     選択肢がこの数より小さければ、選択肢の数に合わせます。
  57.   #--------------------------------------------------------------------------
  58.   RowMax = 4

  59.   #--------------------------------------------------------------------------
  60.   # ● 選択肢の位置記憶
  61.   #     前回表示した選択肢と全く同じ内容の選択肢を表示する場合、
  62.   #     カーソルの初期位置を前回選んだ項目にする機能です。
  63.   #     false で無効化できます。
  64.   #--------------------------------------------------------------------------
  65.   Store = true

  66.   #--------------------------------------------------------------------------
  67.   # ● 選択肢ヘルプを読み取る文字列
  68.   #--------------------------------------------------------------------------
  69.   Help = "選択肢ヘルプ"

  70. end

  71. #//////////////////////////////////////////////////////////////////////////////
  72. #
  73. # 以降、変更する必要なし
  74. #
  75. #//////////////////////////////////////////////////////////////////////////////

  76.   @material ||= []
  77.   @material << :ChoiceEX
  78.   def self.include?(sym)
  79.     @material.include?(sym)
  80.   end

  81. end

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

  88. class Game_Message
  89.   #--------------------------------------------------------------------------
  90.   # ● 公開インスタンス変数
  91.   #--------------------------------------------------------------------------
  92.   attr_accessor :choice_x                 # 選択肢ウィンドウの表示 X 座標
  93.   attr_accessor :choice_y                 # 選択肢ウィンドウの表示 Y 座標
  94.   attr_accessor :choice_row_max           # 選択肢ウィンドウの表示行数
  95.   attr_accessor :choice_enables           # 選択肢の有効状態
  96.   attr_accessor :choice_help              # 選択肢のヘルプ
  97.   #--------------------------------------------------------------------------
  98.   # ○ クリア
  99.   #--------------------------------------------------------------------------
  100.   alias _wdtk_choice_clear clear
  101.   def clear
  102.     _wdtk_choice_clear
  103.     @choice_x = @choice_y = nil
  104.     @choice_row_max = WdTk::ChoiceEX::RowMax
  105.     @choice_enables = []
  106.     @choice_help = {}
  107.   end
  108. end

  109. #==============================================================================
  110. # ■ Game_Interpreter
  111. #==============================================================================
  112. class Game_Interpreter
  113.   #--------------------------------------------------------------------------
  114.   # ☆ 選択肢のセットアップ
  115.   #--------------------------------------------------------------------------
  116.   def setup_choices(params)
  117.     result = []
  118.     add_choices(params, @index, result)
  119.     $game_message.choice_enables = $game_message.choices.collect do |c|
  120.       !c.slice!(/\s*en\(([^\)]+)\)/i) || choice_eval($1)
  121.     end
  122.     unless $game_message.choices.empty?
  123.       m = result.index($game_message.choice_cancel_type - 1)
  124.       $game_message.choice_enables << (!m || $game_message.choice_enables[m])
  125.       result << $game_message.choice_cancel_type - 1
  126.       $game_message.choice_proc = Proc.new {|n| @branch[@indent] = result[n] }
  127.     else
  128.       @branch[@indent] = -1
  129.     end
  130.   end
  131.   #--------------------------------------------------------------------------
  132.   # ● 選択肢の追加
  133.   #--------------------------------------------------------------------------
  134.   def add_choices(params, i, result, d = 0)
  135.     params[0].each_with_index do |s, n|
  136.       choice = s.dup
  137.       next if choice.slice!(/\s*if\(([^\)]+)\)/i) && !choice_eval($1)
  138.       $game_message.choices << choice
  139.       result << n + d
  140.     end
  141.     if params[1] == 5 || (params[1] > 0 && result.include?(params[1] + d - 1))
  142.       $game_message.choice_cancel_type = params[1] + d
  143.     end
  144.     indent = @list[i].indent
  145.     loop do
  146.       i += 1
  147.       if @list[i].indent == indent
  148.         case @list[i].code
  149.         when 402 # [**] の場合
  150.           m = result.index(@list[i].parameters[0] + d)
  151.           get_help_texts(m, i + 1) if m
  152.         when 404 # 分岐終了
  153.           break
  154.         end
  155.       end
  156.     end
  157.     i += 1
  158.     add_choices(@list[i].parameters, i, result, d + 5) if @list[i].code == 102
  159.   end
  160.   #--------------------------------------------------------------------------
  161.   # ● 分岐用
  162.   #--------------------------------------------------------------------------
  163.   def choice_eval(formula)
  164.     s, v = $game_switches, $game_variables
  165.     begin
  166.       Kernel.eval(formula)
  167.     rescue
  168.       msgbox "以下の条件判定でエラーが出ました。\n\n", formula
  169.       true
  170.     end
  171.   end
  172.   #--------------------------------------------------------------------------
  173.   # ● ヘルプ用テキストの取得
  174.   #--------------------------------------------------------------------------
  175.   def get_help_texts(b, i)
  176.     if @list[i].code == 108 && @list[i].parameters[0] == WdTk::ChoiceEX::Help
  177.       $game_message.choice_help[b] = []
  178.       loop do
  179.         i += 1
  180.         break if @list[i].code != 408
  181.         $game_message.choice_help[b] << @list[i].parameters[0]
  182.       end
  183.     end
  184.   end
  185.   #--------------------------------------------------------------------------
  186.   # ◯ 注釈
  187.   #--------------------------------------------------------------------------
  188.   alias _wdtk_choice_command_108 command_108
  189.   def command_108
  190.     _wdtk_choice_command_108
  191.     @comments.each do |comment|
  192.       if comment =~ /選択肢位置\((\d+),\s*(\d+),?\s*(\d*)\)/
  193.         $game_message.choice_x = $1.to_i
  194.         $game_message.choice_y = $2.to_i
  195.         $game_message.choice_row_max = ($3.empty? ? 99 : $3.to_i)
  196.       end
  197.     end
  198.   end
  199.   #--------------------------------------------------------------------------
  200.   # ● 分岐終了の場合
  201.   #--------------------------------------------------------------------------
  202.   def command_404
  203.     if next_event_code == 102
  204.       @branch[@indent] -= 5 if @branch.include?(@indent)
  205.       @index += 1
  206.       command_skip
  207. #~     else
  208. #~       @branch.delete(@indent)
  209.     end
  210.   end
  211. end

  212. #==============================================================================
  213. # ■ Window_ChoiceList
  214. #==============================================================================
  215. class Window_ChoiceList
  216.   #--------------------------------------------------------------------------
  217.   # ☆ 入力処理の開始
  218.   #--------------------------------------------------------------------------
  219.   def start
  220.     return unless close?
  221.     last_choices = @list.collect {|c| c[:name] }
  222.     update_placement
  223.     refresh
  224.     unless WdTk::ChoiceEX::Store && last_choices == $game_message.choices
  225.       select(0)
  226.     end
  227.     open
  228.     activate
  229.   end
  230.   #--------------------------------------------------------------------------
  231.   # ○ ウィンドウ位置の更新
  232.   #--------------------------------------------------------------------------
  233.   alias _wdtk_choice_update_placement update_placement
  234.   def update_placement
  235.     _wdtk_choice_update_placement
  236.     self.height = [height, fitting_height($game_message.choice_row_max)].min
  237.     if @message_window.y >= Graphics.height / 2
  238.       self.y = @message_window.y - height
  239.     else
  240.       self.y = @message_window.y + @message_window.height
  241.     end
  242.     self.x = $game_message.choice_x if $game_message.choice_x
  243.     self.y = $game_message.choice_y if $game_message.choice_y
  244.   end
  245.   #--------------------------------------------------------------------------
  246.   # ☆ コマンドリストの作成
  247.   #--------------------------------------------------------------------------
  248.   def make_command_list
  249.     $game_message.choices.each_with_index do |choice, i|
  250.       add_command(choice, :choice, $game_message.choice_enables[i])
  251.     end
  252.   end
  253.   #--------------------------------------------------------------------------
  254.   # ○ 項目の描画
  255.   #--------------------------------------------------------------------------
  256.   alias _wdtk_choice_draw_item draw_item
  257.   def draw_item(index)
  258.     @choice_enabled = command_enabled?(index)
  259.     _wdtk_choice_draw_item(index)
  260.   end
  261.   #--------------------------------------------------------------------------
  262.   # ● テキスト描画色の変更
  263.   #--------------------------------------------------------------------------
  264.   def change_color(color, enabled = true)
  265.     super(color, enabled && @choice_enabled)
  266.   end
  267.   #--------------------------------------------------------------------------
  268.   # ● キャンセルボタンが押されたときの処理
  269.   #--------------------------------------------------------------------------
  270.   def process_cancel
  271.     if $game_message.choice_enables[item_max]
  272.       super
  273.     else
  274.       Sound.play_buzzer
  275.     end
  276.   end
  277.   #--------------------------------------------------------------------------
  278.   # ☆ キャンセルハンドラの呼び出し
  279.   #--------------------------------------------------------------------------
  280.   def call_cancel_handler
  281.     $game_message.choice_proc.call(item_max)
  282.     close
  283.   end
  284.   #--------------------------------------------------------------------------
  285.   # ● ウィンドウを閉じる
  286.   #--------------------------------------------------------------------------
  287.   def close
  288.     @message_window.on_show_fast unless $game_message.choice_help.empty?
  289.     super
  290.   end
  291.   #--------------------------------------------------------------------------
  292.   # ● ヘルプウィンドウ更新メソッドの呼び出し
  293.   #--------------------------------------------------------------------------
  294.   def call_update_help
  295.     update_help if active && !$game_message.choice_help.empty?
  296.   end
  297.   #--------------------------------------------------------------------------
  298.   # ● ヘルプウィンドウの更新
  299.   #--------------------------------------------------------------------------
  300.   def update_help
  301.     @message_window.force_clear
  302.     if $game_message.choice_help.include?(index)
  303.       $game_message.texts.replace($game_message.choice_help[index])
  304.     else
  305.       $game_message.texts.clear
  306.     end
  307.   end
  308. end

  309. #==============================================================================
  310. # ■ Window_Message
  311. #==============================================================================
  312. class Window_Message
  313.   #--------------------------------------------------------------------------
  314.   # ● 文章の標示を強制クリア
  315.   #--------------------------------------------------------------------------
  316.   def force_clear
  317.     @gold_window.close
  318.     @fiber = nil
  319.     close
  320.     if WdTk.include?(:MesEff)
  321.       @character_sprites.each do |sprite, params|
  322.         next if params.empty?
  323.         sprite.bitmap.clear
  324.         sprite.visible = false
  325.         params.clear
  326.       end
  327.     end
  328.   end
  329.   #--------------------------------------------------------------------------
  330.   # ● 文章を最後まで表示する
  331.   #--------------------------------------------------------------------------
  332.   def on_show_fast
  333.     @show_fast = true
  334.   end
  335. end
复制代码

点评

谢谢  发表于 2015-8-26 10:22

评分

参与人数 1梦石 +1 收起 理由
VIPArcher + 1 你是个好人

查看全部评分

回复

使用道具 举报

梦石
0
星屑
880
在线时间
253 小时
注册时间
2015-1-24
回帖
95
发表于 2015-8-25 15:25:58 | 显示全部楼层
这难道不是只靠复制粘贴就能解决的问题吗……
优先能用事件解决的问题还是不要使用脚本的好吧……

点评

大段内容复制粘贴的话即使有缩进也很难分辨出层次,很混乱。  发表于 2015-8-26 10:24

评分

参与人数 1星屑 +5 收起 理由
taroxd + 5 第二句话不敢苟同哦~

查看全部评分

原创恐怖解谜  岛语
   原创悬疑解谜 雪疑
      原创悬疑风格伪R剧 《抉择CHoice》   【黑历史】

             一只来自北方的泥亾工作室,欢迎骚扰
回复

使用道具 举报

梦石
0
星屑
48
在线时间
784 小时
注册时间
2013-1-4
回帖
1057
发表于 2015-8-25 15:49:45 | 显示全部楼层
事件解释器神马的自己造
RM-GUI延期。。。最近被黑心老板压迫T_T
二次元少女的shitake,长着长脸,身高165,蓝色卷双马尾,FCUP,瞳色黑色,病气和御宅属性,是天才少女。
回复

使用道具 举报

梦石
0
星屑
22879
在线时间
8598 小时
注册时间
2011-12-31
回帖
3270
发表于 2015-8-25 16:26:52 | 显示全部楼层
選択肢拡張 3.2[pre lang="ruby"]=begin

▼ 選択肢拡張 ver. 3.2

RPGツクールVXAce用スクリプト

制作 : 木星ペンギン
URL  : http://woodpenguin.blog.fc2.com/

------------------------------------------------------------------------------
概要

□ 選択肢を連続して設定した場合、つなげて一つの選択肢にする機能の追加。
□ 条件を設定することで、その項目を表示しない機能の追加。
□ 選択肢のカーソル初期位置を指定する機能と
    現在のカーソル位置を変数に入れる機能の追加。

□ 選択肢ウィンドウの位置を一時的に変更する機能の追加。
□ 条件を設定することで、その項目を半透明にして選択不可にする機能の追加。
□ 選択肢毎にヘルプメッセージを表示できる機能の追加。

------------------------------------------------------------------------------
使い方

□ 選択肢の表示を続けて配置すると、一つの選択肢にまとめられます。
  ・「キャンセルの場合」の処理は、無効以外を設定したものが適用され、
     複数ある場合は後の選択肢のものが適用されます。
  
□ 選択肢の文章中に if(条件) と入れ、その条件が偽になると項目が表示されなくなります。
  ・条件は eval によって評価されます。(詳細は【組み込み関数】を参照)
  ・s でスイッチ、v で変数を参照できます。
  ・「キャンセルの場合」の項目が表示されない場合、無効と同じ処理をします。

□ 注釈に以下の文字列を入れることで、指定された変数の値が
    カーソルの初期位置になります。
  
    カーソル記憶(n)
   
      n : カーソル初期位置の入った変数番号
  
  ・選択肢のカーソルの位置が変更されるたびに、
    この変数に選択肢の番号が入れられるようになります。
  
□ 注釈に以下の文字列を入れることで、選択肢ウィンドウの表示位置を
   一時的に変更することが出来ます。
  
    選択肢位置(x, y[, row])
   
      x   : ウィンドウを表示する X 座標。
      y   : ウィンドウを表示する Y 座標。
      row : 選択肢を表示する最大行数。
            指定しない場合は、通常の最大行数を無視して
            すべての選択肢が表示されます。
  
□ 注釈に以下の文字列を入れることで、選択肢ウィンドウの背景が非表示になります。
  
    背景OFF
   
□ 選択肢の文章中に en(条件) と入れ、その条件が偽になると項目が半透明で表示されます。
  ・条件は eval によって評価されます。(詳細は【組み込み関数】を参照)
  ・s でスイッチ、v で変数を参照できます。
  ・「キャンセルの場合」の項目が半透明の場合、ブザーが鳴ります。
  
□ 各項目の下に、注釈で以下の文字列を入れると、続きの注釈を
    項目のヘルプメッセージとしてカーソルを合わせたときに標示することができます。
  
    選択肢ヘルプ
   
□ 詳細は下記のサイトを参照してください。

  http://woodpenguin.web.fc2.com/rgss3/choice_ex.html
  
=end
module WdTk
module ChoiceEX
#//////////////////////////////////////////////////////////////////////////////
#
# 設定項目
#
#//////////////////////////////////////////////////////////////////////////////
  #--------------------------------------------------------------------------
  # ● 選択肢の最大行数
  #     選択肢を表示するウィンドウの行数の最大数です。
  #     選択肢がこの数より小さければ、選択肢の数に合わせます。
  #--------------------------------------------------------------------------
  RowMax = 4
  
  #--------------------------------------------------------------------------
  # ● 選択肢ヘルプを読み取る文字列
  #--------------------------------------------------------------------------
  Help = "選択肢ヘルプ"
  
end

#//////////////////////////////////////////////////////////////////////////////
#
# 以降、変更する必要なし
#
#//////////////////////////////////////////////////////////////////////////////

  @material ||= []
  @material << :ChoiceEX
  def self.include?(sym)
    @material.include?(sym)
  end
  
end

#==============================================================================
# ■ Game_Message
#==============================================================================
class Game_Message
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_accessor :choice_x                 # 選択肢ウィンドウの表示 X 座標
  attr_accessor :choice_y                 # 選択肢ウィンドウの表示 Y 座標
  attr_accessor :choice_row_max           # 選択肢ウィンドウの表示行数
  attr_accessor :choice_help              # 選択肢のヘルプ
  attr_accessor :choice_var_id            # 選択肢のカーソル位置を入れる変数ID
  attr_accessor :choice_background        # 選択肢ウィンドウ背景の表示状態
  #--------------------------------------------------------------------------
  # ○ クリア
  #--------------------------------------------------------------------------
  alias _wdtk_choice_clear clear
  def clear
    _wdtk_choice_clear
    @choice_x = @choice_y = nil
    @choice_row_max = WdTk::ChoiceEX::RowMax
    @choice_help = {}
    @choice_var_id = 0
    @choice_background = 0
  end
end

#==============================================================================
# ■ Game_Interpreter
#==============================================================================
class Game_Interpreter
  #--------------------------------------------------------------------------
  # ☆ 選択肢のセットアップ
  #--------------------------------------------------------------------------
  def setup_choices(params)
    add_choices(params, @index)
    $game_message.choice_proc = Proc.new {|n| @branch[@indent] = n }
  end
  #--------------------------------------------------------------------------
  # ● 選択肢の追加
  #--------------------------------------------------------------------------
  def add_choices(params, i, d = 0)
    params[0].each_with_index {|s, n| $game_message.choices[n + d] = s }
    $game_message.choice_cancel_type = params[1] + d if params[1] > 0
    indent = @list.indent
    loop do
      i += 1
      if @list.indent == indent
        case @list.code
        when 402 # [**] の場合
          get_help_texts(@list.parameters[0] + d, i + 1)
        when 404 # 分岐終了
          break
        end
      end
    end
    i += 1
    add_choices(@list.parameters, i, d + 5) if @list.code == 102
  end
  #--------------------------------------------------------------------------
  # ● ヘルプ用テキストの取得
  #--------------------------------------------------------------------------
  def get_help_texts(b, i)
    if @list.code == 108 && @list.parameters[0] == WdTk::ChoiceEX::Help
      $game_message.choice_help = []
      while @list[i + 1].code == 408
        i += 1
        $game_message.choice_help << @list.parameters[0]
      end
    end
  end
  #--------------------------------------------------------------------------
  # ◯ 注釈
  #--------------------------------------------------------------------------
  alias _wdtk_choice_command_108 command_108
  def command_108
    _wdtk_choice_command_108
    @comments.each do |comment|
      case comment
      when /選択肢位置\((\d+),\s*(\d+),?\s*(\d*)\)/
        $game_message.choice_x = $1.to_i
        $game_message.choice_y = $2.to_i
        $game_message.choice_row_max = ($3.empty? ? 99 : $3.to_i)
      when /カーソル記憶\((\d+)\)/
        $game_message.choice_var_id = $1.to_i
      when /背景(ON|OFF)/
        $game_message.choice_background = ($1 == "ON" ? 0 : 1)
      end
    end
  end
  #--------------------------------------------------------------------------
  # ☆ 分岐終了の場合
  #--------------------------------------------------------------------------
  def command_404
    if next_event_code == 102
      @branch[@indent] -= 5 if @branch.include?(@indent)
      @index += 1
      command_skip
    end
  end
end

#==============================================================================
# ■ Window_ChoiceList
#==============================================================================
class Window_ChoiceList
  #--------------------------------------------------------------------------
  # ☆ 入力処理の開始
  #--------------------------------------------------------------------------
  def start
    return unless close?
    clear_command_list
    make_command_list
    if @list.empty?
      $game_message.choice_proc.call(-1)
      return
    end
    update_placement
    refresh
    select(0)
    if $game_message.choice_var_id > 0
      select_ext($game_variables[$game_message.choice_var_id])
    end
    open
    activate
  end
  #--------------------------------------------------------------------------
  # ☆ ウィンドウ位置の更新
  #--------------------------------------------------------------------------
  def update_placement
    self.width = [max_choice_width + 12, 96].max + padding * 2
    self.width = [width, Graphics.width].min
    n = [@list.size, $game_message.choice_row_max].min
    self.height = fitting_height(n)
    self.x = Graphics.width - width
    if @message_window.y >= Graphics.height / 2
      self.y = @message_window.y - height
    else
      self.y = @message_window.y + @message_window.height
    end
    self.x = $game_message.choice_x if $game_message.choice_x
    self.y = $game_message.choice_y if $game_message.choice_y
  end
  #--------------------------------------------------------------------------
  # ☆ 選択肢の最大幅を取得
  #--------------------------------------------------------------------------
  def max_choice_width
    @list.collect {|com| text_size(com[:name]).width }.max || 0
  end
  #--------------------------------------------------------------------------
  # ☆ コマンドリストの作成
  #--------------------------------------------------------------------------
  def make_command_list
    $game_message.choices.each_with_index do |choice, i|
      next unless choice
      str = choice.dup
      next if str.slice!(/\s*if\(([^\)]+)\)/i) && !choice_eval($1)
      enable = !str.slice!(/\s*en\(([^\)]+)\)/i) || choice_eval($1)
      add_command(str, :choice, enable, i)
    end
  end
  #--------------------------------------------------------------------------
  # ○ 項目の描画
  #--------------------------------------------------------------------------
  alias _wdtk_choice_draw_item draw_item
  def draw_item(index)
    @choice_enabled = command_enabled?(index)
    _wdtk_choice_draw_item(index)
  end
  #--------------------------------------------------------------------------
  # ● テキスト描画色の変更
  #--------------------------------------------------------------------------
  def change_color(color, enabled = true)
    super(color, enabled && @choice_enabled)
  end
  #--------------------------------------------------------------------------
  # ☆ 決定ハンドラの呼び出し
  #--------------------------------------------------------------------------
  def call_ok_handler
    $game_message.choice_proc.call(current_ext)
    close
  end
  #--------------------------------------------------------------------------
  # ● キャンセルボタンが押されたときの処理
  #--------------------------------------------------------------------------
  def process_cancel
    return super if $game_message.choice_cancel_type % 5 == 0
    index = @list.index {|c| c[:ext] == $game_message.choice_cancel_type - 1 }
    return unless index
    return super if command_enabled?(index)
    Sound.play_buzzer
  end
  #--------------------------------------------------------------------------
  # ● ウィンドウを閉じる
  #--------------------------------------------------------------------------
  def close
    @message_window.on_show_fast unless $game_message.choice_help.empty?
    super
  end
  #--------------------------------------------------------------------------
  # ● ヘルプウィンドウ更新メソッドの呼び出し
  #--------------------------------------------------------------------------
  def call_update_help
    update_help if active && !$game_message.choice_help.empty?
  end
  #--------------------------------------------------------------------------
  # ● ヘルプウィンドウの更新
  #--------------------------------------------------------------------------
  def update_help
    @message_window.force_clear
    if $game_message.choice_help.include?(current_ext)
      $game_message.texts.replace($game_message.choice_help[current_ext])
    else
      $game_message.texts.clear
    end
  end
  #--------------------------------------------------------------------------
  # ● 分岐用
  #--------------------------------------------------------------------------
  def choice_eval(formula)
    s, v = $game_switches, $game_variables
    begin
      Kernel.eval(formula)
    rescue
      msgbox "以下の条件判定でエラーが出ました。\n\n", formula
      true
    end
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
    last_index = @index
    super
    if last_index != @index && $game_message.choice_var_id > 0
      $game_variables[$game_message.choice_var_id] = current_ext
    end
  end
end

#==============================================================================
# ■ Window_Message
#==============================================================================
class Window_Message
  #--------------------------------------------------------------------------
  # ○ ウィンドウ背景の更新
  #--------------------------------------------------------------------------
  alias _wdtk_choice_update_background update_background
  def update_background
    _wdtk_choice_update_background
    @choice_window.opacity = $game_message.choice_background == 0 ? 255 : 0
  end
  #--------------------------------------------------------------------------
  # ● 文章の標示を強制クリア
  #--------------------------------------------------------------------------
  def force_clear
    @gold_window.close
    @fiber = nil
    close
    if WdTk.include?(:MesEff)
      @character_sprites.each do |sprite, params|
        next if params.empty?
        sprite.bitmap.clear
        sprite.visible = false
        params.clear
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 文章を最後まで表示する
  #--------------------------------------------------------------------------
  def on_show_fast
    @show_fast = true
  end
end
[/pre]

各種功能説明
4楼
https://rpg.blue/thread-371661-1-1.html
[pre lang="ruby"][/pre]
2015/04/26 (ver. 3.2)
 追加選択肢視窗背景不表示機能。
在事件>注釈加入以下文字列選択肢選択肢視窗背景不表示。
  
    背景OFF

点评

看懂了,谢谢  发表于 2015-8-26 10:22
回复

使用道具 举报

梦石
7
星屑
1113
在线时间
334 小时
注册时间
2008-1-28
回帖
1506
发表于 2015-8-26 10:58:59 | 显示全部楼层
为什么没人想过要用:

“标签”和“标签转跳”

啊!
终于有可以放在这里的游戏了……
极短13 新生 《箱子新世界》
回复

使用道具 举报

梦石
3
星屑
75
在线时间
200 小时
注册时间
2008-7-8
回帖
145
 楼主| 发表于 2015-8-26 11:09:56 | 显示全部楼层
未命名 发表于 2015-8-26 10:58
为什么没人想过要用:

“标签”和“标签转跳”

是的...我发现了
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部