查看: 1999|回复: 4

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

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

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

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

×
QQ图片20160223144854.png

就是这种~~~

先感谢~
梦石
0
星屑
4235
在线时间
2671 小时
注册时间
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/

[pre lang="ruby"]=begin

▼ 選択肢拡張 ver. 2.2

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

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

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

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

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

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

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

  http://woodpenguin.web.fc2.com/rgss3/choice_ex.html
  
=end
module WdTk
module ChoiceEX
#//////////////////////////////////////////////////////////////////////////////
#
# 設定項目
#
#//////////////////////////////////////////////////////////////////////////////
  #--------------------------------------------------------------------------
  # ● 選択肢の最大行数
  #     選択肢を表示するウィンドウの行数の最大数です。
  #     選択肢がこの数より小さければ、選択肢の数に合わせます。
  #--------------------------------------------------------------------------
  RowMax = 8
  
  #--------------------------------------------------------------------------
  # ● 選択肢の位置記憶
  #     前回表示した選択肢と全く同じ内容の選択肢を表示する場合、
  #     カーソルの初期位置を前回選んだ項目にする機能です。
  #     false で無効化できます。
  #--------------------------------------------------------------------------
  Store = true
  
  #--------------------------------------------------------------------------
  # ● 選択肢ヘルプを読み取る文字列
  #--------------------------------------------------------------------------
  Help = "選択肢ヘルプ"
  
end

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

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

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

class Game_Message
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_accessor :choice_x                 # 選択肢ウィンドウの表示 X 座標
  attr_accessor :choice_y                 # 選択肢ウィンドウの表示 Y 座標
  attr_accessor :choice_row_max           # 選択肢ウィンドウの表示行数
  attr_accessor :choice_enables           # 選択肢の有効状態
  attr_accessor :choice_help              # 選択肢のヘルプ
  #--------------------------------------------------------------------------
  # ○ クリア
  #--------------------------------------------------------------------------
  alias _wdtk_choice_clear clear
  def clear
    _wdtk_choice_clear
    @choice_x = @choice_y = nil
    @choice_row_max = WdTk::ChoiceEX::RowMax
    @choice_enables = []
    @choice_help = {}
  end
end

#==============================================================================
# ■ Game_Interpreter
#==============================================================================
class Game_Interpreter
  #--------------------------------------------------------------------------
  # ☆ 選択肢のセットアップ
  #--------------------------------------------------------------------------
  def setup_choices(params)
    result = []
    add_choices(params, @index, result)
    $game_message.choice_enables = $game_message.choices.collect do |c|
      !c.slice!(/\s*en\((.+)\)/i) || choice_eval($1)
    end
    unless $game_message.choices.empty?
      m = result.index($game_message.choice_cancel_type - 1)
      $game_message.choice_enables << (!m || $game_message.choice_enables[m])
      result << $game_message.choice_cancel_type - 1
      $game_message.choice_proc = Proc.new {|n| @branch[@indent] = result[n] }
    else
      @branch[@indent] = -1
    end
  end
  #--------------------------------------------------------------------------
  # ● 選択肢の追加
  #--------------------------------------------------------------------------
  def add_choices(params, i, result, d = 0)
    params[0].each_with_index do |s, n|
      choice = s.dup
      next if choice.slice!(/\s*if\((.+)\)/i) && !choice_eval($1)
      $game_message.choices << choice
      result << n + d
    end
    if params[1] == 5 || (params[1] > 0 && result.include?(params[1] + d - 1))
      $game_message.choice_cancel_type = params[1] + d
    end
    indent = @list.indent
    loop do
      i += 1
      if @list.indent == indent
        case @list.code
        when 402 # [**] の場合
          m = result.index(@list.parameters[0] + d)
          get_help_texts(m, i + 1) if m
        when 404 # 分岐終了
          break
        end
      end
    end
    i += 1
    add_choices(@list.parameters, i, result, d + 5) if @list.code == 102
  end
  #--------------------------------------------------------------------------
  # ● 分岐終了の場合
  #--------------------------------------------------------------------------
  def choice_eval(formula)
    s, v = $game_switches, $game_variables
    begin
      Kernel.eval(formula)
    rescue
      msgbox "以下の条件判定でエラーが出ました。\n\n", formula
      true
    end
  end
  #--------------------------------------------------------------------------
  # ● ヘルプ用テキストの取得
  #--------------------------------------------------------------------------
  def get_help_texts(b, i)
    if @list.code == 108 && @list.parameters[0] == WdTk::ChoiceEX::Help
      $game_message.choice_help = []
      loop do
        i += 1
        break if @list.code != 408
        $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|
      if comment =~ /選択肢位置\((\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)
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 分岐終了の場合
  #--------------------------------------------------------------------------
  def command_404
    if next_event_code == 102
      @branch[@indent] -= 5 if @branch.include?(@indent)
      @index += 1
      command_skip
    else
      @branch.delete(@indent)
    end
  end
end

#==============================================================================
# ■ Window_ChoiceList
#==============================================================================
class Window_ChoiceList
  #--------------------------------------------------------------------------
  # ☆ 入力処理の開始
  #--------------------------------------------------------------------------
  def start
    return unless close?
    last_choices = @list.collect {|c| c[:name] }
    update_placement
    refresh
    unless WdTk::ChoiceEX::Store && last_choices == $game_message.choices
      select(0)
    end
    open
    activate
  end
  #--------------------------------------------------------------------------
  # ○ ウィンドウ位置の更新
  #--------------------------------------------------------------------------
  alias _wdtk_choice_update_placement update_placement
  def update_placement
    _wdtk_choice_update_placement
    self.height = [height, fitting_height($game_message.choice_row_max)].min
    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 make_command_list
    $game_message.choices.each_with_index do |choice, i|
      add_command(choice, :choice, $game_message.choice_enables)
    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 process_cancel
    if $game_message.choice_enables[item_max]
      super
    else
      Sound.play_buzzer
    end
  end
  #--------------------------------------------------------------------------
  # ☆ キャンセルハンドラの呼び出し
  #--------------------------------------------------------------------------
  def call_cancel_handler
    $game_message.choice_proc.call(item_max)
    close
  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?(index)
      $game_message.texts.replace($game_message.choice_help[index])
    else
      $game_message.texts.clear
    end
  end
end

#==============================================================================
# ■ Window_Message
#==============================================================================
class Window_Message
  #--------------------------------------------------------------------------
  # ● 文章の標示を強制クリア
  #--------------------------------------------------------------------------
  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]



如果是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.

在本版发帖返回顶部