查看: 2054|回复: 4

[已经过期] 请问这种界面是怎么做的?有没有相关的工程或教程推荐呢~~

[复制链接]
梦石
0
星屑
50
在线时间
59 小时
注册时间
2015-12-24
回帖
36
发表于 2016-2-23 14:49:49 | 显示全部楼层 |阅读模式

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

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

×
QQ图片20160223144854.png

就是这种~~~

先感谢~
梦石
0
星屑
4385
在线时间
2677 小时
注册时间
2012-3-1
回帖
680
发表于 2016-2-23 15:30:16 | 显示全部楼层
本帖最后由 卡奥尼特 于 2016-2-23 16:23 编辑

敢問樓主是想在RMXP實現這效果嗎?還是RMVA?

如果是RMVA的話……
感覺是用了 木星ペンギン的 選択肢拡張 腳本
我也只是猜測,如果知道那遊戲用的是什麼腳本的話就更清楚了==

等!@阿竹天 楼主你好像發錯區了………

▼ 選択肢拡張 ver. 2.2

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

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

  1. =begin

  2. ▼ 選択肢拡張 ver. 2.2

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

  4. 制作 : 木星ペンギン
  5. URL  : [url=http://woodpenguin.blog.fc2.com/]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]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 = 8
  59.   
  60.   #--------------------------------------------------------------------------
  61.   # ● 選択肢の位置記憶
  62.   #     前回表示した選択肢と全く同じ内容の選択肢を表示する場合、
  63.   #     カーソルの初期位置を前回選んだ項目にする機能です。
  64.   #     false で無効化できます。
  65.   #--------------------------------------------------------------------------
  66.   Store = true
  67.   
  68.   #--------------------------------------------------------------------------
  69.   # ● 選択肢ヘルプを読み取る文字列
  70.   #--------------------------------------------------------------------------
  71.   Help = "選択肢ヘルプ"
  72.   
  73. end

  74. #//////////////////////////////////////////////////////////////////////////////
  75. #
  76. # 以降、変更する必要なし
  77. #
  78. #//////////////////////////////////////////////////////////////////////////////

  79.   @material ||= []
  80.   @material << :ChoiceEX
  81.   def self.include?(sym)
  82.     @material.include?(sym)
  83.   end
  84.   
  85. end

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

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

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

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

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



如果是RMXP的話...
  那就看後面的人怎麼說了……

点评

1楼有给的~  发表于 2016-3-10 15:44
一般情况下都会给一个效果图,看看XP能不能实现这一的效果的  发表于 2016-3-10 12:55
实在是…………犀利~  发表于 2016-2-23 16:26
无论如何非常感谢~~~虽然没看懂~~~(汗)  发表于 2016-2-23 16:18
哪来的错区,楼主用的一直都是RMXP,之前的问题也是问XP的  发表于 2016-2-23 16:12
回复

使用道具 举报

梦石
0
星屑
12161
在线时间
4435 小时
注册时间
2014-4-11
回帖
5616

开拓者

发表于 2016-2-23 16:16:37 | 显示全部楼层
这个啊
自己看默认的照着写个Scene类的脚本
然后里面生成窗口。
再生成选择窗。
加个@screen = Spriteset_Map.new可以把地图画面显示出来。
背景可以透明掉。

用背景当地图的显示出背景图。

点评

我在这里  发表于 2016-2-23 21:50
对不起!!!实在抱歉,认成RB了~~  发表于 2016-2-23 16:25
你认错人了  发表于 2016-2-23 16:23
说个题外话,大大的输入法很有意思。在视频当中,你敲入XC,最优先是小苍~~哈哈哈哈。  发表于 2016-2-23 16:23
嗯……之前一直在跟同事学程序的基本概念,现在看你的视频教程也明白了许多。总之非常感谢。应该要用到你第三讲的内容。  发表于 2016-2-23 16:22
回复

使用道具 举报

梦石
0
星屑
50
在线时间
59 小时
注册时间
2015-12-24
回帖
36
 楼主| 发表于 2016-2-24 23:16:59 | 显示全部楼层
本帖最后由 阿竹天 于 2016-2-24 23:18 编辑

遇到一个问题
我按Window_Selectable写的带光标窗口都无法添加到Scene_Map
求解~

我尝试用了默认的Window_Selectable子类窗口比如Window_PartyCommand添加也不行

添加地方是
1、    # 生成信息窗口     @party = Window_PartyCommand.new
2、    # 释放信息窗口     @party.dispose
3、    # 刷新信息窗口    @party.update

先谢谢~~  
回复

使用道具 举报

梦石
0
星屑
50
在线时间
59 小时
注册时间
2015-12-24
回帖
36
 楼主| 发表于 2016-2-24 23:22:56 | 显示全部楼层
yang1zhi 发表于 2016-2-23 16:16
这个啊
自己看默认的照着写个Scene类的脚本
然后里面生成窗口。


Scene类看不太懂~~或者说是找不到到合适的参照物去学习~~求指点~

点错了~~非有意连楼~~~抱歉
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部