查看: 2804|回复: 3

[转载] [日站] 竖排界面

[复制链接]
梦石
0
星屑
50
在线时间
228 小时
注册时间
2012-2-27
回帖
25
发表于 2012-7-21 11:44:12 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 l616631804 于 2012-7-21 11:44 编辑

转载自    http://www4.plala.or.jp/findias/codecrush/material/vxace_rgss3/index.html

各个界面的竖排。不用添加素材,可直接使用。

img1.jpg img2.jpg img4.jpg img3.jpg img5.jpg img6.jpg img8.jpg img7.jpg


  1. #==============================================================================
  2. # ■ VXAce-RGSS3-31 和風レイアウト<base> [Ver.1.0.0]          by Claimh
  3. #------------------------------------------------------------------------------
  4. # 和風なレイアウトに変更します。
  5. #==============================================================================

  6. # デフォルトフォント設定
  7. Font.default_name = ["HGP行書体", "MS 明朝", "VL Gothic"]
  8. Font.default_outline = false
  9. Font.default_shadow = false

  10. #==============================================================================
  11. # ■ Vocab
  12. #------------------------------------------------------------------------------
  13. #  用語とメッセージを定義するモジュールです。定数でメッセージなどを直接定義す
  14. # るほか、グローバル変数 $data_system から用語データを取得します。
  15. #==============================================================================

  16. module Vocab
  17.   # セーブ/ロード画面
  18.   SaveMessage     = "どの書に記録しますか?"
  19.   LoadMessage     = "どの書から読み出ししますか?"
  20.   File            = "記録の書"

  21.   # アクター対象の行動結果
  22.   ActorDamage     = "%sは %s の傷を受けた!"
  23.   ActorRecovery   = "%sの%sが %s 回復した!"
  24.   ActorGain       = "%sの%sが %s 増えた!"
  25.   ActorLoss       = "%sの%sが %s 減った!"
  26.   ActorDrain      = "%sは%sを %s 奪われた!"
  27.   ActorNoDamage   = "%sには効かない!"
  28.   ActorNoHit      = "%sには当たらない!"

  29.   # 敵キャラ対象の行動結果
  30.   EnemyDamage     = "%sに %s の傷を与えた!"
  31.   EnemyRecovery   = "%sの%sが %s 回復した!"
  32.   EnemyGain       = "%sの%sが %s 増えた!"
  33.   EnemyLoss       = "%sの%sが %s 減った!"
  34.   EnemyDrain      = "%sの%sを %s 奪った!"
  35.   EnemyNoDamage   = "%sには効かない!"
  36.   EnemyNoHit      = "%sに当たらない!"

  37.   # 回避/反射
  38.   Evasion         = "%sは攻撃をかわした!"
  39.   MagicEvasion    = "%sは術を打ち消した!"
  40.   MagicReflection = "%sは術を跳ね返した!"
  41.   CounterAttack   = "%sの反撃!"
  42.   Substitute      = "%sが%sをかばった!"
  43. end


  44. class Bitmap
  45.   #--------------------------------------------------------------------------
  46.   # ● 縦テキスト描画
  47.   #--------------------------------------------------------------------------
  48.   def draw_h_text(rect, text)
  49.     t = text.to_s.split(//)
  50.     x = rect.x
  51.     y = rect.y
  52.     t.each_index do |i|
  53.       h = text_size(t[i]).height
  54.       case t[i]
  55.       when "。", "、"
  56.         plus = h / 2
  57.         draw_text(x+plus, y-plus, rect.width, h, t[i], 1)
  58.       when "っ", "ぁ", "ぃ", "ぅ", "ぇ", "ぉ", "ゃ", "ゅ", "ょ",
  59.            "ッ", "ァ", "ィ", "ゥ", "ェ", "ォ", "ャ", "ュ", "ョ"
  60.         plus = h / 5
  61.         draw_text(x+plus, y-plus, rect.width, h, t[i], 1)
  62.       when "\n", "\r"; next
  63.       else
  64.         draw_text(x, y, rect.width, h, t[i], 1)
  65.       end
  66.       y += h
  67.     end
  68.   end
  69.   #--------------------------------------------------------------------------
  70.   # ● 和数字描画
  71.   #--------------------------------------------------------------------------
  72.   def draw_jnum(rect, num, align=2)
  73.     draw_text(rect, ConvJnum.conv(num), align)
  74.   end
  75.   #--------------------------------------------------------------------------
  76.   # ● 和数字描画 <縦>
  77.   #--------------------------------------------------------------------------
  78.   def draw_h_jnum(rect, num, align=2)
  79.     draw_h_text(rect, ConvJnum.conv(num), align)
  80.   end
  81. end


  82. module ConvJnum
  83.   #--------------------------------------------------------------------------
  84.   # ● 和数字変換
  85.   #--------------------------------------------------------------------------
  86.   def self.conv(num)
  87.     text = ""
  88.     if num / 100000000 > 0
  89.       text += conv_o(num / 100000000)
  90.       num %= 100000000
  91.     end
  92.     if num / 10000 > 0
  93.       text += conv_m(num / 10000)
  94.       num %= 10000
  95.     end
  96.     text += conv_s(num)
  97.     text = "零" if text == ""
  98.     text
  99.   end
  100.   #--------------------------------------------------------------------------
  101.   # ● 和数字変換 (億単位)
  102.   #--------------------------------------------------------------------------
  103.   def self.conv_o(num)
  104.     conv_s(num) + "億 "
  105.   end
  106.   #--------------------------------------------------------------------------
  107.   # ● 和数字変換 (万単位)
  108.   #--------------------------------------------------------------------------
  109.   def self.conv_m(num)
  110.     conv_s(num) + "万 "
  111.   end
  112.   #--------------------------------------------------------------------------
  113.   # ● 和数字変換 (千単位以下)
  114.   #--------------------------------------------------------------------------
  115.   def self.conv_s(num)
  116.     text = ""
  117.     if num / 1000 > 0
  118.       text += conv_one(num / 1000, false) + "千"
  119.       num %= 1000
  120.     end
  121.     if num / 100 > 0
  122.       text += conv_one(num / 100, false) + "百"
  123.       num %= 100
  124.     end
  125.     if num / 10 > 0
  126.       text += conv_one(num / 10, false) + "十"
  127.       num %= 10
  128.     end
  129.     if num > 0
  130.       text +=conv_one(num, true)
  131.     end
  132.     text
  133.   end
  134.   def self.conv_one(num, one=false)
  135.     conv = {1=>"一", 2=>"二", 3=>"三", 4=>"四", 5=>"五",
  136.             6=>"六", 7=>"七", 8=>"八", 9=>"九"}
  137.     one ? conv[num] : (num > 1 ? conv[num] : "")
  138.   end
  139. end


  140. class Window_Base < Window
  141.   #--------------------------------------------------------------------------
  142.   # ● 各種文字色の取得
  143.   #--------------------------------------------------------------------------
  144.   def normal_color;      text_color(0);   end;    # 通常
  145.   def system_color;      text_color(11);   end;    # システム
  146.   def crisis_color;      text_color(17);  end;    # ピンチ
  147.   def knockout_color;    text_color(18);  end;    # 戦闘不能
  148.   def gauge_back_color;  text_color(7);  end;    # ゲージ背景
  149.   def hp_gauge_color1;   text_color(20);  end;    # HP ゲージ 1
  150.   def hp_gauge_color2;   text_color(21);  end;    # HP ゲージ 2
  151.   def mp_gauge_color1;   text_color(22);  end;    # MP ゲージ 1
  152.   def mp_gauge_color2;   text_color(23);  end;    # MP ゲージ 2
  153.   def mp_cost_color;     text_color(31);  end;    # 消費 MP
  154.   def power_up_color;    text_color(24);  end;    # 装備 パワーアップ
  155.   def power_down_color;  text_color(25);  end;    # 装備 パワーダウン
  156.   def tp_gauge_color1;   text_color(28);  end;    # TP ゲージ 1
  157.   def tp_gauge_color2;   text_color(29);  end;    # TP ゲージ 2
  158.   def tp_cost_color;     text_color(30);  end;    # 消費 TP

  159.   #--------------------------------------------------------------------------
  160.   # ● 文字の処理
  161.   #     c    : 文字
  162.   #     text : 描画処理中の文字列バッファ(必要なら破壊的に変更)
  163.   #     pos  : 描画位置 {:x, :y, :new_x, :height}
  164.   #--------------------------------------------------------------------------
  165.   def process_character(c, text, pos)
  166.     case c
  167.     when "\r"   # キャリッジリターンは無視
  168.     when "\n"   # 改行
  169.       process_new_line(text, pos)
  170.     when "\f"   # 改ページ
  171.       process_new_page(text, pos)
  172.     when "\e"   # 制御文字
  173.       process_escape_character(obtain_escape_code(text), text, pos)
  174.     else        # 普通の文字
  175.       process_normal_character(c, pos)
  176.     end
  177.   end
  178.   #--------------------------------------------------------------------------
  179.   # ● シンプルなステータスの描画
  180.   #--------------------------------------------------------------------------
  181.   def draw_actor_simple_status(actor, x, y, add=120, width=124)
  182.     draw_actor_name(actor, x, y)
  183.     draw_actor_level(actor, x, y + line_height * 1)
  184.     draw_actor_icons(actor, x, y + line_height * 2)
  185.     draw_actor_class(actor, x + add, y)
  186.     draw_actor_hp(actor, x + add, y + line_height * 1, width)
  187.     draw_actor_mp(actor, x + add, y + line_height * 2, width)
  188.   end
  189.   #--------------------------------------------------------------------------
  190.   # ● 現在値/最大値を分数形式で描画
  191.   #     current : 現在値
  192.   #     max     : 最大値
  193.   #     color1  : 現在値の色
  194.   #     color2  : 最大値の色
  195.   #--------------------------------------------------------------------------
  196.   def draw_current_and_max_values(x, y, width, current, max, color1, color2)
  197.     change_color(color1)
  198.     xr = x + width
  199.     if width < 106
  200.       draw_text(xr - 50, y, 52, line_height, current, 2)
  201.     else
  202.       draw_text(xr - 106, y, 52, line_height, current, 2)
  203.       change_color(color2)
  204.       draw_text(xr - 56, y, 12, line_height, "/", 2)
  205.       draw_text(xr - 52, y, 52, line_height, max, 2)
  206.     end
  207.   end
  208. end


  209. #==============================================================================
  210. # ■ Window_J_Base
  211. #------------------------------------------------------------------------------
  212. #  ゲーム中の全てのウィンドウのスーパークラスです。
  213. #==============================================================================

  214. class Window_J_Base < Window_Base
  215.   #--------------------------------------------------------------------------
  216.   # ● オブジェクト初期化
  217.   #--------------------------------------------------------------------------
  218.   def initialize(*args)
  219.     @jmode=true
  220.     super(*args)
  221.   end
  222.   #--------------------------------------------------------------------------
  223.   # ● 行の幅を取得
  224.   #--------------------------------------------------------------------------
  225.   def line_width
  226.     return 24
  227.   end
  228.   #--------------------------------------------------------------------------
  229.   # ● 指定行数に適合するウィンドウの幅を計算
  230.   #--------------------------------------------------------------------------
  231.   def fitting_width(line_number)
  232.     line_number * line_width + standard_padding * 2
  233.   end
  234.   #--------------------------------------------------------------------------
  235.   # ● テキストの描画 <縦書き>
  236.   #     args : Bitmap#draw_text と同じ
  237.   #--------------------------------------------------------------------------
  238.   def draw_text(*args)
  239.     return super(*args) unless @jmode
  240.     if args[0].is_a?(Rect)
  241.       contents.draw_h_text(args[0], args[1])
  242.     else
  243.       contents.draw_h_text(Rect.new(args[0], args[1], args[2], args[3]), args[4])
  244.     end
  245.   end
  246.   #--------------------------------------------------------------------------
  247.   # ● 制御文字つきテキストの描画
  248.   #--------------------------------------------------------------------------
  249.   def draw_text_ex(x, y, text)
  250.     reset_font_settings
  251.     text = convert_escape_characters(text)
  252.     pos = {:x => x, :y => y, :new_y => y, :width => calc_line_width(text)}
  253.     process_character(text.slice!(0, 1), text, pos) until text.empty?
  254.   end
  255.   #--------------------------------------------------------------------------
  256.   # ● 通常文字の処理
  257.   #--------------------------------------------------------------------------
  258.   def process_normal_character(c, pos)
  259.     text_height = c.split(//).inject(0) {|r, t| r+=text_size(t).height}
  260.     draw_text(pos[:x], pos[:y], line_width, text_height, c)
  261.     pos[:y] += text_height
  262.   end
  263.   #--------------------------------------------------------------------------
  264.   # ● 改行文字の処理
  265.   #--------------------------------------------------------------------------
  266.   def process_new_line(text, pos)
  267.     pos[:x] -= pos[:width]
  268.     pos[:y] = pos[:new_y]
  269.     pos[:width] = calc_line_width(text)
  270.   end
  271.   #--------------------------------------------------------------------------
  272.   # ● 制御文字によるアイコン描画の処理
  273.   #--------------------------------------------------------------------------
  274.   def process_draw_icon(icon_index, pos)
  275.     draw_icon(icon_index, pos[:x]-pos[:width], pos[:y])
  276.     pos[:y] += 24
  277.   end
  278.   #--------------------------------------------------------------------------
  279.   # ● アイテム名の描画
  280.   #     enabled : 有効フラグ。false のとき半透明で描画
  281.   #--------------------------------------------------------------------------
  282.   def draw_item_name(item, x, y, enabled = true, height = 172)
  283.     return unless item
  284.     draw_icon(item.icon_index, x, y, enabled)
  285.     change_color(normal_color, enabled)
  286.     draw_text(x, y + 24, line_width, height, item.name)
  287.   end
  288.   #--------------------------------------------------------------------------
  289.   # ● 行の幅を計算
  290.   #     restore_font_size : 計算後にフォントサイズを元に戻す
  291.   #--------------------------------------------------------------------------
  292.   def calc_line_width(text, restore_font_size = true)
  293.     result = [line_width, contents.font.size].max
  294.     last_font_size = contents.font.size
  295.     text.slice(/^.*$/).scan(/\e[\{\}]/).each do |esc|
  296.       make_font_bigger  if esc == "\e{"
  297.       make_font_smaller if esc == "\e}"
  298.       result = [result, contents.font.size].max
  299.     end
  300.     contents.font.size = last_font_size if restore_font_size
  301.     result
  302.   end
  303.   #--------------------------------------------------------------------------
  304.   # ● 名前の描画
  305.   #--------------------------------------------------------------------------
  306.   def draw_actor_name_l(actor, x, y, width = 112)
  307.     @jmode = false
  308.     draw_actor_name(actor, x, y, width)
  309.     @jmode = true
  310.   end
  311.   #--------------------------------------------------------------------------
  312.   # ● レベルの描画
  313.   #--------------------------------------------------------------------------
  314.   def draw_actor_level_l(actor, x, y)
  315.     @jmode = false
  316.     draw_actor_level(actor, x, y)
  317.     @jmode = true
  318.   end
  319.   #--------------------------------------------------------------------------
  320.   # ● HP の描画
  321.   #--------------------------------------------------------------------------
  322.   def draw_actor_hp_l(actor, x, y, width = 124)
  323.     @jmode = false
  324.     draw_actor_hp(actor, x, y, width)
  325.     @jmode = true
  326.   end
  327.   #--------------------------------------------------------------------------
  328.   # ● MP の描画
  329.   #--------------------------------------------------------------------------
  330.   def draw_actor_mp_l(actor, x, y, width = 124)
  331.     @jmode = false
  332.     draw_actor_mp(actor, x, y, width)
  333.     @jmode = true
  334.   end
  335.   #--------------------------------------------------------------------------
  336.   # ● シンプルなステータスの描画
  337.   #--------------------------------------------------------------------------
  338.   def draw_actor_simple_status(actor, x, y, add=120, width=124)
  339.     @jmode = false
  340.     draw_actor_name(actor, x, y, width)
  341.     draw_actor_level(actor, x, y + line_height * 1)
  342.     draw_actor_icons(actor, x, y + line_height * 2)
  343.     draw_actor_class(actor, x + add, y)
  344.     draw_actor_hp(actor, x + add, y + line_height * 1, width)
  345.     draw_actor_mp(actor, x + add, y + line_height * 2, width)
  346.     @jmode = true
  347.   end
  348.   #--------------------------------------------------------------------------
  349.   # ● シンプルなステータスの描画 <縦パターン>
  350.   #--------------------------------------------------------------------------
  351.   def draw_actor_simple_status2(actor, x, y, width=124)
  352.     @jmode = false
  353.     draw_actor_name( actor, x, y + line_height * 0, width)
  354.     draw_actor_face( actor, x+(width-96)/2, y + line_height * 1, width)
  355. #~     draw_actor_class(actor, x, y + 96 + line_height * 1, width)
  356.     draw_actor_level(actor, x, y + 96 + line_height * 2)
  357.     draw_actor_hp(   actor, x, y + 96 + line_height * 3, width)
  358.     draw_actor_mp(   actor, x, y + 96 + line_height * 4, width)
  359.     draw_actor_icons(actor, x, y + 96 + line_height * 5, width)
  360.     @jmode = true
  361.   end
  362. end


  363. #==============================================================================
  364. # ■ Window_J_Selectable
  365. #------------------------------------------------------------------------------
  366. #  カーソルの移動やスクロールの機能を持つウィンドウクラスです。
  367. #==============================================================================

  368. class Window_J_Selectable < Window_J_Base
  369.   #--------------------------------------------------------------------------
  370.   # ● 公開インスタンス変数
  371.   #--------------------------------------------------------------------------
  372.   attr_reader   :index                    # カーソル位置
  373.   attr_reader   :help_window              # ヘルプウィンドウ
  374.   attr_accessor :cursor_fix               # カーソル固定フラグ
  375.   attr_accessor :cursor_all               # カーソル全選択フラグ
  376.   #--------------------------------------------------------------------------
  377.   # ● オブジェクト初期化
  378.   #-------------------------------------------------------------------------
  379.   def initialize(x, y, width, height)
  380.     super
  381.     @index = -1
  382.     @handler = {}
  383.     @cursor_fix = false
  384.     @cursor_all = false
  385.     update_padding
  386.     deactivate
  387.   end
  388.   #--------------------------------------------------------------------------
  389.   # ● ウィンドウ内容の作成
  390.   #--------------------------------------------------------------------------
  391.   def create_contents
  392.     super
  393.     self.ox = contents_width - base_contents_width
  394.   end
  395.   #--------------------------------------------------------------------------
  396.   # ● 桁数の取得
  397.   #--------------------------------------------------------------------------
  398.   def col_max
  399.     return 1
  400.   end
  401.   #--------------------------------------------------------------------------
  402.   # ● 縦に項目が並ぶときの空白の幅を取得
  403.   #--------------------------------------------------------------------------
  404.   def spacing
  405.     return 32
  406.   end
  407.   #--------------------------------------------------------------------------
  408.   # ● 項目数の取得
  409.   #--------------------------------------------------------------------------
  410.   def item_max
  411.     return 0
  412.   end
  413.   #--------------------------------------------------------------------------
  414.   # ● 項目の高さを取得
  415.   #--------------------------------------------------------------------------
  416.   def item_height
  417.     (height - standard_padding * 2 + spacing) / col_max - spacing
  418.   end
  419.   #--------------------------------------------------------------------------
  420.   # ● 項目の高さを取得
  421.   #--------------------------------------------------------------------------
  422.   def item_width
  423.     line_width
  424.   end
  425.   #--------------------------------------------------------------------------
  426.   # ● 行数の取得
  427.   #--------------------------------------------------------------------------
  428.   def row_max
  429.     [(item_max + col_max - 1) / col_max, 1].max
  430.   end
  431.   #--------------------------------------------------------------------------
  432.   # ● ウィンドウ内容の幅を計算
  433.   #--------------------------------------------------------------------------
  434.   def contents_width
  435.     [super, row_max * item_width].max
  436.   end
  437.   #--------------------------------------------------------------------------
  438.   # ● ウィンドウ内容の幅を計算
  439.   #--------------------------------------------------------------------------
  440.   def base_contents_width
  441.     width - standard_padding * 2
  442.   end
  443.   #--------------------------------------------------------------------------
  444.   # ● 下端パディングの更新
  445.   #--------------------------------------------------------------------------
  446.   def update_padding_bottom
  447.     surplus = (width - standard_padding * 2) % item_width
  448.     self.padding_bottom = padding + surplus
  449.   end
  450.   #--------------------------------------------------------------------------
  451.   # ● 幅の設定
  452.   #--------------------------------------------------------------------------
  453.   def width=(width)
  454.     super
  455.     update_padding
  456.   end
  457.   #--------------------------------------------------------------------------
  458.   # ● アクティブ状態の変更
  459.   #--------------------------------------------------------------------------
  460.   def active=(active)
  461.     super
  462.     update_cursor
  463.     call_update_help
  464.   end
  465.   #--------------------------------------------------------------------------
  466.   # ● カーソル位置の設定
  467.   #--------------------------------------------------------------------------
  468.   def index=(index)
  469.     @index = index
  470.     update_cursor
  471.     call_update_help
  472.   end
  473.   #--------------------------------------------------------------------------
  474.   # ● 項目の選択
  475.   #--------------------------------------------------------------------------
  476.   def select(index)
  477.     self.index = index if index
  478.   end
  479.   #--------------------------------------------------------------------------
  480.   # ● 項目の選択解除
  481.   #--------------------------------------------------------------------------
  482.   def unselect
  483.     self.index = -1
  484.   end
  485.   #--------------------------------------------------------------------------
  486.   # ● 現在の行の取得
  487.   #--------------------------------------------------------------------------
  488.   def row
  489.     index / col_max
  490.   end
  491.   #--------------------------------------------------------------------------
  492.   # ● 先頭の行の取得
  493.   #--------------------------------------------------------------------------
  494.   def top_row
  495.     (ox - base_contents_width) / item_width
  496.   end
  497.   #--------------------------------------------------------------------------
  498.   # ● 先頭の行の設定
  499.   #--------------------------------------------------------------------------
  500.   def top_row=(row)
  501.     row = 0 if row < 0
  502.     row = row_max - 1 if row > row_max - 1
  503.     self.ox = contents_width - base_contents_width - row * item_width
  504.   end
  505.   #--------------------------------------------------------------------------
  506.   # ● 1 ページに表示できる行数の取得
  507.   #--------------------------------------------------------------------------
  508.   def page_row_max
  509.     base_contents_width / item_width
  510.   end
  511.   #--------------------------------------------------------------------------
  512.   # ● 1 ページに表示できる項目数の取得
  513.   #--------------------------------------------------------------------------
  514.   def page_item_max
  515.     page_row_max * col_max
  516.   end
  517.   #--------------------------------------------------------------------------
  518.   # ● 横選択判定
  519.   #--------------------------------------------------------------------------
  520.   def horizontal?
  521.     page_row_max == 1
  522.   end
  523.   #--------------------------------------------------------------------------
  524.   # ● 末尾の行の取得
  525.   #--------------------------------------------------------------------------
  526.   def bottom_row
  527.     top_row + page_row_max - 1
  528.   end
  529.   #--------------------------------------------------------------------------
  530.   # ● 末尾の行の設定
  531.   #--------------------------------------------------------------------------
  532.   def bottom_row=(row)
  533.     self.top_row = row - (page_row_max - 1)
  534.   end
  535.   #--------------------------------------------------------------------------
  536.   # ● 項目を描画する矩形の取得
  537.   #--------------------------------------------------------------------------
  538.   def item_rect(index)
  539.     rect = Rect.new
  540.     rect.width = item_width
  541.     rect.height = item_height
  542.     rect.x = contents_width - index / col_max * item_width - item_width
  543.     rect.y = index % col_max * (item_height + spacing)
  544.     rect
  545.   end
  546.   #--------------------------------------------------------------------------
  547.   # ● 項目を描画する矩形の取得(テキスト用)
  548.   #--------------------------------------------------------------------------
  549.   def item_rect_for_text(index)
  550.     rect = item_rect(index)
  551.     rect.y += 4
  552.     rect.height -= 8
  553.     rect
  554.   end
  555.   #--------------------------------------------------------------------------
  556.   # ● ヘルプウィンドウの設定
  557.   #--------------------------------------------------------------------------
  558.   def help_window=(help_window)
  559.     @help_window = help_window
  560.     call_update_help
  561.   end
  562.   #--------------------------------------------------------------------------
  563.   # ● 動作に対応するハンドラの設定
  564.   #     method : ハンドラとして設定するメソッド (Method オブジェクト)
  565.   #--------------------------------------------------------------------------
  566.   def set_handler(symbol, method)
  567.     @handler[symbol] = method
  568.   end
  569.   #--------------------------------------------------------------------------
  570.   # ● ハンドラの存在確認
  571.   #--------------------------------------------------------------------------
  572.   def handle?(symbol)
  573.     @handler.include?(symbol)
  574.   end
  575.   #--------------------------------------------------------------------------
  576.   # ● ハンドラの呼び出し
  577.   #--------------------------------------------------------------------------
  578.   def call_handler(symbol)
  579.     @handler[symbol].call if handle?(symbol)
  580.   end
  581.   #--------------------------------------------------------------------------
  582.   # ● カーソルの移動可能判定
  583.   #--------------------------------------------------------------------------
  584.   def cursor_movable?
  585.     active && open? && !@cursor_fix && !@cursor_all && item_max > 0
  586.   end
  587.   #--------------------------------------------------------------------------
  588.   # ● カーソルを下に移動
  589.   #--------------------------------------------------------------------------
  590.   def cursor_down(wrap = false)
  591.     if col_max >= 2 && (index < item_max - 1 || (wrap && horizontal?))
  592.       select((index + 1) % item_max)
  593.     end
  594.   end
  595.   #--------------------------------------------------------------------------
  596.   # ● カーソルを上に移動
  597.   #--------------------------------------------------------------------------
  598.   def cursor_up(wrap = false)
  599.     if col_max >= 2 && (index > 0 || (wrap && horizontal?))
  600.       select((index - 1 + item_max) % item_max)
  601.     end
  602.   end
  603.   #--------------------------------------------------------------------------
  604.   # ● カーソルを右に移動
  605.   #--------------------------------------------------------------------------
  606.   def cursor_right(wrap = false)
  607.     if index >= col_max || (wrap && col_max == 1)
  608.       select((index - col_max + item_max) % item_max)
  609.     end
  610.   end
  611.   #--------------------------------------------------------------------------
  612.   # ● カーソルを左に移動
  613.   #--------------------------------------------------------------------------
  614.   def cursor_left(wrap = false)
  615.     if index < item_max - col_max || (wrap && col_max == 1)
  616.       select((index + col_max) % item_max)
  617.     end
  618.   end
  619.   #--------------------------------------------------------------------------
  620.   # ● カーソルを 1 ページ後ろに移動
  621.   #--------------------------------------------------------------------------
  622.   def cursor_pagedown
  623.     if top_row + page_row_max < row_max
  624.       self.top_row += page_row_max
  625.       select([@index + page_item_max, item_max - 1].min)
  626.     end
  627.   end
  628.   #--------------------------------------------------------------------------
  629.   # ● カーソルを 1 ページ前に移動
  630.   #--------------------------------------------------------------------------
  631.   def cursor_pageup
  632.     if top_row > 0
  633.       self.top_row -= page_row_max
  634.       select([@index - page_item_max, 0].max)
  635.     end
  636.   end
  637.   #--------------------------------------------------------------------------
  638.   # ● フレーム更新
  639.   #--------------------------------------------------------------------------
  640.   def update
  641.     super
  642.     process_cursor_move
  643.     process_handling
  644.   end
  645.   #--------------------------------------------------------------------------
  646.   # ● カーソルの移動処理
  647.   #--------------------------------------------------------------------------
  648.   def process_cursor_move
  649.     return unless cursor_movable?
  650.     last_index = @index
  651.     cursor_down (Input.trigger?(:DOWN))  if Input.repeat?(:DOWN)
  652.     cursor_up   (Input.trigger?(:UP))    if Input.repeat?(:UP)
  653.     cursor_right(Input.trigger?(:RIGHT)) if Input.repeat?(:RIGHT)
  654.     cursor_left (Input.trigger?(:LEFT))  if Input.repeat?(:LEFT)
  655.     cursor_pagedown   if !handle?(:pagedown) && Input.trigger?(:R)
  656.     cursor_pageup     if !handle?(:pageup)   && Input.trigger?(:L)
  657.     Sound.play_cursor if @index != last_index
  658.   end
  659.   #--------------------------------------------------------------------------
  660.   # ● 決定やキャンセルなどのハンドリング処理
  661.   #--------------------------------------------------------------------------
  662.   def process_handling
  663.     return unless open? && active
  664.     return process_ok       if ok_enabled?        && Input.trigger?(:C)
  665.     return process_cancel   if cancel_enabled?    && Input.trigger?(:B)
  666.     return process_pagedown if handle?(:pagedown) && Input.trigger?(:R)
  667.     return process_pageup   if handle?(:pageup)   && Input.trigger?(:L)
  668.   end
  669.   #--------------------------------------------------------------------------
  670.   # ● 決定処理の有効状態を取得
  671.   #--------------------------------------------------------------------------
  672.   def ok_enabled?
  673.     handle?(:ok)
  674.   end
  675.   #--------------------------------------------------------------------------
  676.   # ● キャンセル処理の有効状態を取得
  677.   #--------------------------------------------------------------------------
  678.   def cancel_enabled?
  679.     handle?(:cancel)
  680.   end
  681.   #--------------------------------------------------------------------------
  682.   # ● 決定ボタンが押されたときの処理
  683.   #--------------------------------------------------------------------------
  684.   def process_ok
  685.     if current_item_enabled?
  686.       Sound.play_ok
  687.       Input.update
  688.       deactivate
  689.       call_ok_handler
  690.     else
  691.       Sound.play_buzzer
  692.     end
  693.   end
  694.   #--------------------------------------------------------------------------
  695.   # ● 決定ハンドラの呼び出し
  696.   #--------------------------------------------------------------------------
  697.   def call_ok_handler
  698.     call_handler(:ok)
  699.   end
  700.   #--------------------------------------------------------------------------
  701.   # ● キャンセルボタンが押されたときの処理
  702.   #--------------------------------------------------------------------------
  703.   def process_cancel
  704.     Sound.play_cancel
  705.     Input.update
  706.     deactivate
  707.     call_cancel_handler
  708.   end
  709.   #--------------------------------------------------------------------------
  710.   # ● キャンセルハンドラの呼び出し
  711.   #--------------------------------------------------------------------------
  712.   def call_cancel_handler
  713.     call_handler(:cancel)
  714.   end
  715.   #--------------------------------------------------------------------------
  716.   # ● L ボタン(PageUp)が押されたときの処理
  717.   #--------------------------------------------------------------------------
  718.   def process_pageup
  719.     Sound.play_cursor
  720.     Input.update
  721.     deactivate
  722.     call_handler(:pageup)
  723.   end
  724.   #--------------------------------------------------------------------------
  725.   # ● R ボタン(PageDown)が押されたときの処理
  726.   #--------------------------------------------------------------------------
  727.   def process_pagedown
  728.     Sound.play_cursor
  729.     Input.update
  730.     deactivate
  731.     call_handler(:pagedown)
  732.   end
  733.   #--------------------------------------------------------------------------
  734.   # ● カーソルの更新
  735.   #--------------------------------------------------------------------------
  736.   def update_cursor
  737.     if @cursor_all
  738.       cursor_rect.set(0, 0, row_max * item_width, contents.height)
  739.       self.top_row = 0
  740.     elsif @index < 0
  741.       cursor_rect.empty
  742.     else
  743.       ensure_cursor_visible
  744.       cursor_rect.set(item_rect(@index))
  745.     end
  746.   end
  747.   #--------------------------------------------------------------------------
  748.   # ● カーソル位置が画面内になるようにスクロール
  749.   #--------------------------------------------------------------------------
  750.   def ensure_cursor_visible
  751.     self.top_row = row if row < top_row
  752.     self.bottom_row = row if row > bottom_row
  753.   end
  754.   #--------------------------------------------------------------------------
  755.   # ● ヘルプウィンドウ更新メソッドの呼び出し
  756.   #--------------------------------------------------------------------------
  757.   def call_update_help
  758.     update_help if active && @help_window
  759.   end
  760.   #--------------------------------------------------------------------------
  761.   # ● ヘルプウィンドウの更新
  762.   #--------------------------------------------------------------------------
  763.   def update_help
  764.     @help_window.clear
  765.   end
  766.   #--------------------------------------------------------------------------
  767.   # ● 選択項目の有効状態を取得
  768.   #--------------------------------------------------------------------------
  769.   def current_item_enabled?
  770.     return true
  771.   end
  772.   #--------------------------------------------------------------------------
  773.   # ● 全項目の描画
  774.   #--------------------------------------------------------------------------
  775.   def draw_all_items
  776.     item_max.times {|i| draw_item(i) }
  777.   end
  778.   #--------------------------------------------------------------------------
  779.   # ● 項目の描画
  780.   #--------------------------------------------------------------------------
  781.   def draw_item(index)
  782.   end
  783.   #--------------------------------------------------------------------------
  784.   # ● 項目の消去
  785.   #--------------------------------------------------------------------------
  786.   def clear_item(index)
  787.     contents.clear_rect(item_rect(index))
  788.   end
  789.   #--------------------------------------------------------------------------
  790.   # ● 項目の再描画
  791.   #--------------------------------------------------------------------------
  792.   def redraw_item(index)
  793.     clear_item(index) if index >= 0
  794.     draw_item(index)  if index >= 0
  795.   end
  796.   #--------------------------------------------------------------------------
  797.   # ● 選択項目の再描画
  798.   #--------------------------------------------------------------------------
  799.   def redraw_current_item
  800.     redraw_item(@index)
  801.   end
  802.   #--------------------------------------------------------------------------
  803.   # ● リフレッシュ
  804.   #--------------------------------------------------------------------------
  805.   def refresh
  806.     contents.clear
  807.     draw_all_items
  808.   end
  809. end


  810. #==============================================================================
  811. # ■ Window_J_Help
  812. #------------------------------------------------------------------------------
  813. #  スキルやアイテムの説明、アクターのステータスなどを表示するウィンドウです。
  814. #==============================================================================

  815. class Window_J_Help < Window_J_Base
  816.   #--------------------------------------------------------------------------
  817.   # ● オブジェクト初期化
  818.   #--------------------------------------------------------------------------
  819.   def initialize(line_number = 2)
  820.     @line_number = line_number
  821.     super(0, 0, fitting_width(line_number), Graphics.height)
  822.   end
  823.   #--------------------------------------------------------------------------
  824.   # ● テキスト設定
  825.   #--------------------------------------------------------------------------
  826.   def set_text(text)
  827.     if text != @text
  828.       @text = text
  829.       refresh
  830.     end
  831.   end
  832.   #--------------------------------------------------------------------------
  833.   # ● クリア
  834.   #--------------------------------------------------------------------------
  835.   def clear
  836.     set_text("")
  837.   end
  838.   #--------------------------------------------------------------------------
  839.   # ● アイテム設定
  840.   #     item : スキル、アイテム等
  841.   #--------------------------------------------------------------------------
  842.   def set_item(item)
  843.     set_text(item ? item.description : "")
  844.   end
  845.   #--------------------------------------------------------------------------
  846.   # ● リフレッシュ
  847.   #--------------------------------------------------------------------------
  848.   def refresh
  849.     contents.clear
  850.     draw_text_ex((@line_number-1)*line_width, 0, @text)
  851.   end
  852. end


  853. #==============================================================================
  854. # ■ Window_J_Command
  855. #------------------------------------------------------------------------------
  856. #  一般的なコマンド選択を行うウィンドウです。
  857. #==============================================================================

  858. class Window_J_Command < Window_J_Selectable
  859.   #--------------------------------------------------------------------------
  860.   # ● オブジェクト初期化
  861.   #--------------------------------------------------------------------------
  862.   def initialize(x, y)
  863.     clear_command_list
  864.     make_command_list
  865.     super(x, y, window_width, window_height)
  866.     refresh
  867.     select(0)
  868.     activate
  869.   end
  870.   #--------------------------------------------------------------------------
  871.   # ● ウィンドウ高さの取得
  872.   #--------------------------------------------------------------------------
  873.   def window_width
  874.     fitting_width(visible_line_number)
  875.   end
  876.   #--------------------------------------------------------------------------
  877.   # ● ウィンドウ高さの取得
  878.   #--------------------------------------------------------------------------
  879.   def window_height
  880.     Graphics.height
  881.   end
  882.   #--------------------------------------------------------------------------
  883.   # ● 表示行数の取得
  884.   #--------------------------------------------------------------------------
  885.   def visible_line_number
  886.     (item_max * 1.0 / col_max).round
  887.   end
  888.   #--------------------------------------------------------------------------
  889.   # ● 項目数の取得
  890.   #--------------------------------------------------------------------------
  891.   def item_max
  892.     @list.size
  893.   end
  894.   #--------------------------------------------------------------------------
  895.   # ● コマンドリストのクリア
  896.   #--------------------------------------------------------------------------
  897.   def clear_command_list
  898.     @list = []
  899.   end
  900.   #--------------------------------------------------------------------------
  901.   # ● コマンドリストの作成
  902.   #--------------------------------------------------------------------------
  903.   def make_command_list
  904.   end
  905.   #--------------------------------------------------------------------------
  906.   # ● コマンドの追加
  907.   #     name    : コマンド名
  908.   #     symbol  : 対応するシンボル
  909.   #     enabled : 有効状態フラグ
  910.   #     ext     : 任意の拡張データ
  911.   #--------------------------------------------------------------------------
  912.   def add_command(name, symbol, enabled = true, ext = nil)
  913.     @list.push({:name=>name, :symbol=>symbol, :enabled=>enabled, :ext=>ext})
  914.   end
  915.   #--------------------------------------------------------------------------
  916.   # ● コマンド名の取得
  917.   #--------------------------------------------------------------------------
  918.   def command_name(index)
  919.     @list[index][:name]
  920.   end
  921.   #--------------------------------------------------------------------------
  922.   # ● コマンドの有効状態を取得
  923.   #--------------------------------------------------------------------------
  924.   def command_enabled?(index)
  925.     @list[index][:enabled]
  926.   end
  927.   #--------------------------------------------------------------------------
  928.   # ● 選択項目のコマンドデータを取得
  929.   #--------------------------------------------------------------------------
  930.   def current_data
  931.     index >= 0 ? @list[index] : nil
  932.   end
  933.   #--------------------------------------------------------------------------
  934.   # ● 選択項目の有効状態を取得
  935.   #--------------------------------------------------------------------------
  936.   def current_item_enabled?
  937.     current_data ? current_data[:enabled] : false
  938.   end
  939.   #--------------------------------------------------------------------------
  940.   # ● 選択項目のシンボルを取得
  941.   #--------------------------------------------------------------------------
  942.   def current_symbol
  943.     current_data ? current_data[:symbol] : nil
  944.   end
  945.   #--------------------------------------------------------------------------
  946.   # ● 選択項目の拡張データを取得
  947.   #--------------------------------------------------------------------------
  948.   def current_ext
  949.     current_data ? current_data[:ext] : nil
  950.   end
  951.   #--------------------------------------------------------------------------
  952.   # ● 指定されたシンボルを持つコマンドにカーソルを移動
  953.   #--------------------------------------------------------------------------
  954.   def select_symbol(symbol)
  955.     @list.each_index {|i| select(i) if @list[i][:symbol] == symbol }
  956.   end
  957.   #--------------------------------------------------------------------------
  958.   # ● 指定された拡張データを持つコマンドにカーソルを移動
  959.   #--------------------------------------------------------------------------
  960.   def select_ext(ext)
  961.     @list.each_index {|i| select(i) if @list[i][:ext] == ext }
  962.   end
  963.   #--------------------------------------------------------------------------
  964.   # ● 項目の描画
  965.   #--------------------------------------------------------------------------
  966.   def draw_item(index)
  967.     change_color(normal_color, command_enabled?(index))
  968.     draw_text(item_rect_for_text(index), command_name(index), alignment)
  969.   end
  970.   #--------------------------------------------------------------------------
  971.   # ● アライメントの取得
  972.   #--------------------------------------------------------------------------
  973.   def alignment
  974.     return 0
  975.   end
  976.   #--------------------------------------------------------------------------
  977.   # ● 決定処理の有効状態を取得
  978.   #--------------------------------------------------------------------------
  979.   def ok_enabled?
  980.     return true
  981.   end
  982.   #--------------------------------------------------------------------------
  983.   # ● 決定ハンドラの呼び出し
  984.   #--------------------------------------------------------------------------
  985.   def call_ok_handler
  986.     if handle?(current_symbol)
  987.       call_handler(current_symbol)
  988.     elsif handle?(:ok)
  989.       super
  990.     else
  991.       activate
  992.     end
  993.   end
  994.   #--------------------------------------------------------------------------
  995.   # ● リフレッシュ
  996.   #--------------------------------------------------------------------------
  997.   def refresh
  998.     clear_command_list
  999.     make_command_list
  1000.     create_contents
  1001.     super
  1002.   end
  1003. end
复制代码



  1. #==============================================================================
  2. # ■ VXAce-RGSS3-31 和風レイアウト <menu>          by Claimh
  3. #------------------------------------------------------------------------------
  4. # メニュー画面変更
  5. #==============================================================================


  6. #==============================================================================
  7. # ■ Window_J_MenuCommand
  8. #------------------------------------------------------------------------------
  9. #  メニュー画面で表示するコマンドウィンドウです。
  10. #==============================================================================

  11. class Window_J_MenuCommand < Window_J_Command
  12.   #--------------------------------------------------------------------------
  13.   # ● コマンド選択位置の初期化(クラスメソッド)
  14.   #--------------------------------------------------------------------------
  15.   def self.init_command_position
  16.     @@last_command_symbol = nil
  17.   end
  18.   #--------------------------------------------------------------------------
  19.   # ● オブジェクト初期化
  20.   #--------------------------------------------------------------------------
  21.   def initialize
  22.     super(0, 0)
  23.     self.x = Graphics.width - width
  24.     select_last
  25.   end
  26.   #--------------------------------------------------------------------------
  27.   # ● ウィンドウ高さの取得
  28.   #--------------------------------------------------------------------------
  29.   def window_height
  30.     140
  31.   end
  32.   #--------------------------------------------------------------------------
  33.   # ● コマンドリストの作成
  34.   #--------------------------------------------------------------------------
  35.   def make_command_list
  36.     add_main_commands
  37.     add_formation_command
  38.     add_original_commands
  39.     add_save_command
  40.     add_game_end_command
  41.   end
  42.   #--------------------------------------------------------------------------
  43.   # ● 主要コマンドをリストに追加
  44.   #--------------------------------------------------------------------------
  45.   def add_main_commands
  46.     add_command(Vocab::item,   :item,   main_commands_enabled)
  47.     add_command(Vocab::skill,  :skill,  main_commands_enabled)
  48.     add_command(Vocab::equip,  :equip,  main_commands_enabled)
  49.     add_command(Vocab::status, :status, main_commands_enabled)
  50.   end
  51.   #--------------------------------------------------------------------------
  52.   # ● 並び替えをコマンドリストに追加
  53.   #--------------------------------------------------------------------------
  54.   def add_formation_command
  55.     add_command(Vocab::formation, :formation, formation_enabled)
  56.   end
  57.   #--------------------------------------------------------------------------
  58.   # ● 独自コマンドの追加用
  59.   #--------------------------------------------------------------------------
  60.   def add_original_commands
  61.   end
  62.   #--------------------------------------------------------------------------
  63.   # ● セーブをコマンドリストに追加
  64.   #--------------------------------------------------------------------------
  65.   def add_save_command
  66.     add_command(Vocab::save, :save, save_enabled)
  67.   end
  68.   #--------------------------------------------------------------------------
  69.   # ● ゲーム終了をコマンドリストに追加
  70.   #--------------------------------------------------------------------------
  71.   def add_game_end_command
  72.     add_command(Vocab::game_end, :game_end)
  73.   end
  74.   #--------------------------------------------------------------------------
  75.   # ● 主要コマンドの有効状態を取得
  76.   #--------------------------------------------------------------------------
  77.   def main_commands_enabled
  78.     $game_party.exists
  79.   end
  80.   #--------------------------------------------------------------------------
  81.   # ● 並び替えの有効状態を取得
  82.   #--------------------------------------------------------------------------
  83.   def formation_enabled
  84.     $game_party.members.size >= 2 && !$game_system.formation_disabled
  85.   end
  86.   #--------------------------------------------------------------------------
  87.   # ● セーブの有効状態を取得
  88.   #--------------------------------------------------------------------------
  89.   def save_enabled
  90.     !$game_system.save_disabled
  91.   end
  92.   #--------------------------------------------------------------------------
  93.   # ● 決定ボタンが押されたときの処理
  94.   #--------------------------------------------------------------------------
  95.   def process_ok
  96.     @@last_command_symbol = current_symbol
  97.     super
  98.   end
  99.   #--------------------------------------------------------------------------
  100.   # ● 前回の選択位置を復帰
  101.   #--------------------------------------------------------------------------
  102.   def select_last
  103.     select_symbol(@@last_command_symbol)
  104.   end
  105. end


  106. #==============================================================================
  107. # ■ Window_J_MenuStatus
  108. #------------------------------------------------------------------------------
  109. #  メニュー画面でパーティメンバーのステータスを表示するウィンドウです。
  110. #==============================================================================

  111. class Window_J_MenuStatus < Window_J_Selectable
  112.   #--------------------------------------------------------------------------
  113.   # ● 公開インスタンス変数
  114.   #--------------------------------------------------------------------------
  115.   attr_reader   :pending_index            # 保留位置(並び替え用)
  116.   #--------------------------------------------------------------------------
  117.   # ● オブジェクト初期化
  118.   #--------------------------------------------------------------------------
  119.   def initialize(x, y)
  120.     super(x, y, Graphics.width, Graphics.height - y)
  121.     @pending_index = -1
  122.     refresh
  123.   end
  124.   #--------------------------------------------------------------------------
  125.   # ● 項目数の取得
  126.   #--------------------------------------------------------------------------
  127.   def item_max
  128.     $game_party.members.size
  129.   end
  130.   #--------------------------------------------------------------------------
  131.   # ● 行の幅を取得
  132.   #--------------------------------------------------------------------------
  133.   def line_width
  134.     130
  135.   end
  136.   #--------------------------------------------------------------------------
  137.   # ● 項目の高さを取得
  138.   #--------------------------------------------------------------------------
  139.   def item_height
  140.     contents_height
  141.   end
  142.   #--------------------------------------------------------------------------
  143.   # ● 項目の描画
  144.   #--------------------------------------------------------------------------
  145.   def draw_item(index)
  146.     actor = $game_party.members[index]
  147.     enabled = $game_party.battle_members.include?(actor)
  148.     rect = item_rect_for_text(index)
  149.     draw_item_background(index)
  150.     draw_actor_simple_status2(actor, rect.x + 4, rect.y, item_width - 8)
  151.   end
  152.   #--------------------------------------------------------------------------
  153.   # ● 項目の背景を描画
  154.   #--------------------------------------------------------------------------
  155.   def draw_item_background(index)
  156.     if index == @pending_index
  157.       contents.fill_rect(item_rect(index), pending_color)
  158.     end
  159.   end
  160.   #--------------------------------------------------------------------------
  161.   # ● 決定ボタンが押されたときの処理
  162.   #--------------------------------------------------------------------------
  163.   def process_ok
  164.     super
  165.     $game_party.menu_actor = $game_party.members[index]
  166.   end
  167.   #--------------------------------------------------------------------------
  168.   # ● 前回の選択位置を復帰
  169.   #--------------------------------------------------------------------------
  170.   def select_last
  171.     select($game_party.menu_actor.index || 0)
  172.   end
  173.   #--------------------------------------------------------------------------
  174.   # ● 保留位置(並び替え用)の設定
  175.   #--------------------------------------------------------------------------
  176.   def pending_index=(index)
  177.     last_pending_index = @pending_index
  178.     @pending_index = index
  179.     redraw_item(@pending_index)
  180.     redraw_item(last_pending_index)
  181.   end
  182. end


  183. #==============================================================================
  184. # ■ Scene_Map
  185. #------------------------------------------------------------------------------
  186. #  マップ画面の処理を行うクラスです。
  187. #==============================================================================

  188. class Scene_Map < Scene_Base
  189.   #--------------------------------------------------------------------------
  190.   # ● メニュー画面の呼び出し
  191.   #--------------------------------------------------------------------------
  192.   def call_menu
  193.     Sound.play_ok
  194.     SceneManager.call(Scene_Menu)
  195.     Window_J_MenuCommand::init_command_position
  196.   end
  197. end


  198. #==============================================================================
  199. # ■ Scene_Menu
  200. #------------------------------------------------------------------------------
  201. #  メニュー画面の処理を行うクラスです。
  202. #==============================================================================

  203. class Scene_Menu < Scene_MenuBase
  204.   #--------------------------------------------------------------------------
  205.   # ● コマンドウィンドウの作成
  206.   #--------------------------------------------------------------------------
  207.   def create_command_window
  208.     @command_window = Window_J_MenuCommand.new
  209.     @command_window.set_handler(:item,      method(:command_item))
  210.     @command_window.set_handler(:skill,     method(:command_personal))
  211.     @command_window.set_handler(:equip,     method(:command_personal))
  212.     @command_window.set_handler(:status,    method(:command_personal))
  213.     @command_window.set_handler(:formation, method(:command_formation))
  214.     @command_window.set_handler(:save,      method(:command_save))
  215.     @command_window.set_handler(:game_end,  method(:command_game_end))
  216.     @command_window.set_handler(:cancel,    method(:return_scene))
  217.   end
  218.   #--------------------------------------------------------------------------
  219.   # ● ゴールドウィンドウの作成
  220.   #--------------------------------------------------------------------------
  221.   def create_gold_window
  222.     @gold_window = Window_Gold.new
  223.   end
  224.   #--------------------------------------------------------------------------
  225.   # ● ステータスウィンドウの作成
  226.   #--------------------------------------------------------------------------
  227.   def create_status_window
  228.     @status_window = Window_J_MenuStatus.new(0, @command_window.height)
  229.   end
  230. end
复制代码


  1. #==============================================================================
  2. # ■ VXAce-RGSS3-31 和風レイアウト <item>          by Claimh
  3. #------------------------------------------------------------------------------
  4. # アイテム画面変更
  5. #==============================================================================

  6. #==============================================================================
  7. # ■ Window_J_ItemCategory
  8. #------------------------------------------------------------------------------
  9. #  アイテム画面またはショップ画面で、通常アイテムや装備品の分類を選択するウィ
  10. # ンドウです。
  11. #==============================================================================

  12. class Window_J_ItemCategory < Window_J_Command
  13.   #--------------------------------------------------------------------------
  14.   # ● 公開インスタンス変数
  15.   #--------------------------------------------------------------------------
  16.   attr_reader   :item_window
  17.   #--------------------------------------------------------------------------
  18.   # ● オブジェクト初期化
  19.   #--------------------------------------------------------------------------
  20.   def initialize
  21.     super(Graphics.width-fitting_width(1), 0)
  22.   end
  23.   #--------------------------------------------------------------------------
  24.   # ● 桁数の取得
  25.   #--------------------------------------------------------------------------
  26.   def col_max
  27.     return 4
  28.   end
  29.   #--------------------------------------------------------------------------
  30.   # ● 縦に項目が並ぶときの空白の幅を取得
  31.   #--------------------------------------------------------------------------
  32.   def spacing
  33.     return 0
  34.   end
  35.   #--------------------------------------------------------------------------
  36.   # ● フレーム更新
  37.   #--------------------------------------------------------------------------
  38.   def update
  39.     super
  40.     @item_window.category = current_symbol if @item_window
  41.   end
  42.   #--------------------------------------------------------------------------
  43.   # ● コマンドリストの作成
  44.   #--------------------------------------------------------------------------
  45.   def make_command_list
  46.     add_command(Vocab::item,     :item)
  47.     add_command(Vocab::weapon,   :weapon)
  48.     add_command(Vocab::armor,    :armor)
  49.     add_command(Vocab::key_item, :key_item)
  50.   end
  51.   #--------------------------------------------------------------------------
  52.   # ● アイテムウィンドウの設定
  53.   #--------------------------------------------------------------------------
  54.   def item_window=(item_window)
  55.     @item_window = item_window
  56.     update
  57.   end
  58. end


  59. #==============================================================================
  60. # ■ Window_J_ItemList
  61. #------------------------------------------------------------------------------
  62. #  アイテム画面で、所持アイテムの一覧を表示するウィンドウです。
  63. #==============================================================================

  64. class Window_J_ItemList < Window_J_Selectable
  65.   #--------------------------------------------------------------------------
  66.   # ● オブジェクト初期化
  67.   #--------------------------------------------------------------------------
  68.   def initialize(x, y, width, height)
  69.     super
  70.     @category = :none
  71.     @data = []
  72.   end
  73.   #--------------------------------------------------------------------------
  74.   # ● カテゴリの設定
  75.   #--------------------------------------------------------------------------
  76.   def category=(category)
  77.     return if @category == category
  78.     @category = category
  79.     refresh
  80.     self.oy = 0
  81.   end
  82.   #--------------------------------------------------------------------------
  83.   # ● 桁数の取得
  84.   #--------------------------------------------------------------------------
  85.   def col_max
  86.     return 2
  87.   end
  88.   #--------------------------------------------------------------------------
  89.   # ● 項目数の取得
  90.   #--------------------------------------------------------------------------
  91.   def item_max
  92.     @data ? @data.size : 1
  93.   end
  94.   #--------------------------------------------------------------------------
  95.   # ● アイテムの取得
  96.   #--------------------------------------------------------------------------
  97.   def item
  98.     @data && index >= 0 ? @data[index] : nil
  99.   end
  100.   #--------------------------------------------------------------------------
  101.   # ● 選択項目の有効状態を取得
  102.   #--------------------------------------------------------------------------
  103.   def current_item_enabled?
  104.     enable?(@data[index])
  105.   end
  106.   #--------------------------------------------------------------------------
  107.   # ● アイテムをリストに含めるかどうか
  108.   #--------------------------------------------------------------------------
  109.   def include?(item)
  110.     case @category
  111.     when :item
  112.       item.is_a?(RPG::Item) && !item.key_item?
  113.     when :weapon
  114.       item.is_a?(RPG::Weapon)
  115.     when :armor
  116.       item.is_a?(RPG::Armor)
  117.     when :key_item
  118.       item.is_a?(RPG::Item) && item.key_item?
  119.     else
  120.       false
  121.     end
  122.   end
  123.   #--------------------------------------------------------------------------
  124.   # ● アイテムを許可状態で表示するかどうか
  125.   #--------------------------------------------------------------------------
  126.   def enable?(item)
  127.     $game_party.usable?(item)
  128.   end
  129.   #--------------------------------------------------------------------------
  130.   # ● アイテムリストの作成
  131.   #--------------------------------------------------------------------------
  132.   def make_item_list
  133.     @data = $game_party.all_items.select {|item| include?(item) }
  134.     @data.push(nil) if include?(nil)
  135.   end
  136.   #--------------------------------------------------------------------------
  137.   # ● 前回の選択位置を復帰
  138.   #--------------------------------------------------------------------------
  139.   def select_last
  140.     select(@data.index($game_party.last_item.object) || 0)
  141.   end
  142.   #--------------------------------------------------------------------------
  143.   # ● 項目の描画
  144.   #--------------------------------------------------------------------------
  145.   def draw_item(index)
  146.     item = @data[index]
  147.     if item
  148.       rect = item_rect(index)
  149.       rect.height -= 4
  150.       draw_item_name(item, rect.x, rect.y, enable?(item))
  151.       draw_item_number(rect, item)
  152.     end
  153.   end
  154.   #--------------------------------------------------------------------------
  155.   # ● アイテムの個数を描画
  156.   #--------------------------------------------------------------------------
  157.   def draw_item_number(rect, item)
  158.     rect.y += rect.height - line_width
  159.     rect.height = line_width
  160.     contents.draw_text(rect, sprintf("%2d", $game_party.item_number(item)), 1)
  161.   end
  162.   #--------------------------------------------------------------------------
  163.   # ● ヘルプテキスト更新
  164.   #--------------------------------------------------------------------------
  165.   def update_help
  166.     @help_window.set_item(item)
  167.   end
  168.   #--------------------------------------------------------------------------
  169.   # ● リフレッシュ
  170.   #--------------------------------------------------------------------------
  171.   def refresh
  172.     make_item_list
  173.     create_contents
  174.     draw_all_items
  175.   end
  176. end


  177. #==============================================================================
  178. # ■ Scene_Item
  179. #------------------------------------------------------------------------------
  180. #  アイテム画面の処理を行うクラスです。
  181. #==============================================================================

  182. class Scene_Item < Scene_ItemBase
  183.   #--------------------------------------------------------------------------
  184.   # ● カーソルが左列にあるかの判定
  185.   #--------------------------------------------------------------------------
  186.   def cursor_left?
  187. #~     @item_window.index % 2 == 0
  188.     true
  189.   end
  190.   #--------------------------------------------------------------------------
  191.   # ● ヘルプウィンドウの作成
  192.   #--------------------------------------------------------------------------
  193.   def create_help_window
  194.     @help_window = Window_J_Help.new
  195.     @help_window.viewport = @viewport
  196.   end
  197.   #--------------------------------------------------------------------------
  198.   # ● カテゴリウィンドウの作成
  199.   #--------------------------------------------------------------------------
  200.   def create_category_window
  201.     @category_window = Window_J_ItemCategory.new
  202.     @category_window.viewport = @viewport
  203.     @category_window.help_window = @help_window
  204.     @category_window.set_handler(:ok,     method(:on_category_ok))
  205.     @category_window.set_handler(:cancel, method(:return_scene))
  206.   end
  207.   #--------------------------------------------------------------------------
  208.   # ● アイテムウィンドウの作成
  209.   #--------------------------------------------------------------------------
  210.   def create_item_window
  211.     x = @help_window.width
  212.     w = Graphics.width - (@help_window.width + @category_window.width)
  213.     @item_window = Window_J_ItemList.new(x, 0, w, Graphics.height)
  214.     @item_window.viewport = @viewport
  215.     @item_window.help_window = @help_window
  216.     @item_window.set_handler(:ok,     method(:on_item_ok))
  217.     @item_window.set_handler(:cancel, method(:on_item_cancel))
  218.     @category_window.item_window = @item_window
  219.   end
  220. end
复制代码

  1. #==============================================================================
  2. # ■ VXAce-RGSS3-31 和風レイアウト <skill>          by Claimh
  3. #------------------------------------------------------------------------------
  4. # スキル画面変更
  5. #==============================================================================

  6. #==============================================================================
  7. # ■ Window_SkillCommand
  8. #------------------------------------------------------------------------------
  9. #  スキル画面で、コマンド(特技や魔法など)を選択するウィンドウです。
  10. #==============================================================================

  11. class Window_J_SkillCommand < Window_J_Command
  12.   #--------------------------------------------------------------------------
  13.   # ● 公開インスタンス変数
  14.   #--------------------------------------------------------------------------
  15.   attr_reader   :skill_window
  16.   #--------------------------------------------------------------------------
  17.   # ● オブジェクト初期化
  18.   #--------------------------------------------------------------------------
  19.   def initialize(x, y)
  20.     super(x, y)
  21.     @actor = nil
  22.   end
  23.   #--------------------------------------------------------------------------
  24.   # ● ウィンドウ幅の取得
  25.   #--------------------------------------------------------------------------
  26.   def window_width
  27.     fitting_width(visible_line_number)
  28.   end
  29.   #--------------------------------------------------------------------------
  30.   # ● ウィンドウ幅の取得
  31.   #--------------------------------------------------------------------------
  32.   def window_height
  33.     return 120
  34.   end
  35.   #--------------------------------------------------------------------------
  36.   # ● アクターの設定
  37.   #--------------------------------------------------------------------------
  38.   def actor=(actor)
  39.     return if @actor == actor
  40.     @actor = actor
  41.     refresh
  42.     select_last
  43.   end
  44.   #--------------------------------------------------------------------------
  45.   # ● 表示行数の取得
  46.   #--------------------------------------------------------------------------
  47.   def visible_line_number
  48.     return 4
  49.   end
  50.   #--------------------------------------------------------------------------
  51.   # ● コマンドリストの作成
  52.   #--------------------------------------------------------------------------
  53.   def make_command_list
  54.     return unless @actor
  55.     @actor.added_skill_types.sort.each do |stype_id|
  56.       name = $data_system.skill_types[stype_id]
  57.       add_command(name, :skill, true, stype_id)
  58.     end
  59.   end
  60.   #--------------------------------------------------------------------------
  61.   # ● フレーム更新
  62.   #--------------------------------------------------------------------------
  63.   def update
  64.     super
  65.     @skill_window.stype_id = current_ext if @skill_window
  66.   end
  67.   #--------------------------------------------------------------------------
  68.   # ● スキルウィンドウの設定
  69.   #--------------------------------------------------------------------------
  70.   def skill_window=(skill_window)
  71.     @skill_window = skill_window
  72.     update
  73.   end
  74.   #--------------------------------------------------------------------------
  75.   # ● 前回の選択位置を復帰
  76.   #--------------------------------------------------------------------------
  77.   def select_last
  78.     skill = @actor.last_skill.object
  79.     if skill
  80.       select_ext(skill.stype_id)
  81.     else
  82.       select(0)
  83.     end
  84.   end
  85. end


  86. #==============================================================================
  87. # ■ Window_SkillStatus
  88. #------------------------------------------------------------------------------
  89. #  スキル画面で、スキル使用者のステータスを表示するウィンドウです。
  90. #==============================================================================

  91. class Window_SkillStatus < Window_Base
  92.   #--------------------------------------------------------------------------
  93.   # ● ウィンドウ幅の取得
  94.   #--------------------------------------------------------------------------
  95.   def window_width
  96.     Graphics.width - fitting_height(2) - 120
  97.   end
  98.   #--------------------------------------------------------------------------
  99.   # ● リフレッシュ
  100.   #--------------------------------------------------------------------------
  101.   def refresh
  102.     contents.clear
  103.     return unless @actor
  104.     draw_actor_face(@actor, 0, 0)
  105.     draw_actor_simple_status(@actor, 108, line_height / 2, 90)
  106.   end
  107. end


  108. #==============================================================================
  109. # ■ Window_J_SkillList
  110. #------------------------------------------------------------------------------
  111. #  スキル画面で、使用できるスキルの一覧を表示するウィンドウです。
  112. #==============================================================================

  113. class Window_J_SkillList < Window_J_Selectable
  114.   #--------------------------------------------------------------------------
  115.   # ● オブジェクト初期化
  116.   #--------------------------------------------------------------------------
  117.   def initialize(x, y, width, height)
  118.     super
  119.     @actor = nil
  120.     @stype_id = 0
  121.     @data = []
  122.   end
  123.   #--------------------------------------------------------------------------
  124.   # ● アクターの設定
  125.   #--------------------------------------------------------------------------
  126.   def actor=(actor)
  127.     return if @actor == actor
  128.     @actor = actor
  129.     refresh
  130.     self.oy = 0
  131.   end
  132.   #--------------------------------------------------------------------------
  133.   # ● スキルタイプ ID の設定
  134.   #--------------------------------------------------------------------------
  135.   def stype_id=(stype_id)
  136.     return if @stype_id == stype_id
  137.     @stype_id = stype_id
  138.     refresh
  139.     self.oy = 0
  140.   end
  141.   #--------------------------------------------------------------------------
  142.   # ● 桁数の取得
  143.   #--------------------------------------------------------------------------
  144.   def col_max
  145.     return 1
  146.   end
  147.   #--------------------------------------------------------------------------
  148.   # ● 項目数の取得
  149.   #--------------------------------------------------------------------------
  150.   def item_max
  151.     @data ? @data.size : 1
  152.   end
  153.   #--------------------------------------------------------------------------
  154.   # ● スキルの取得
  155.   #--------------------------------------------------------------------------
  156.   def item
  157.     @data && index >= 0 ? @data[index] : nil
  158.   end
  159.   #--------------------------------------------------------------------------
  160.   # ● 選択項目の有効状態を取得
  161.   #--------------------------------------------------------------------------
  162.   def current_item_enabled?
  163.     enable?(@data[index])
  164.   end
  165.   #--------------------------------------------------------------------------
  166.   # ● スキルをリストに含めるかどうか
  167.   #--------------------------------------------------------------------------
  168.   def include?(item)
  169.     item && item.stype_id == @stype_id
  170.   end
  171.   #--------------------------------------------------------------------------
  172.   # ● スキルを許可状態で表示するかどうか
  173.   #--------------------------------------------------------------------------
  174.   def enable?(item)
  175.     @actor && @actor.usable?(item)
  176.   end
  177.   #--------------------------------------------------------------------------
  178.   # ● スキルリストの作成
  179.   #--------------------------------------------------------------------------
  180.   def make_item_list
  181.     @data = @actor ? @actor.skills.select {|skill| include?(skill) } : []
  182.   end
  183.   #--------------------------------------------------------------------------
  184.   # ● 前回の選択位置を復帰
  185.   #--------------------------------------------------------------------------
  186.   def select_last
  187.     select(@data.index(@actor.last_skill.object) || 0)
  188.   end
  189.   #--------------------------------------------------------------------------
  190.   # ● 項目の描画
  191.   #--------------------------------------------------------------------------
  192.   def draw_item(index)
  193.     skill = @data[index]
  194.     if skill
  195.       rect = item_rect(index)
  196.       rect.width -= 4
  197.       draw_item_name(skill, rect.x, rect.y, enable?(skill))
  198.       draw_skill_cost(rect, skill)
  199.     end
  200.   end
  201.   #--------------------------------------------------------------------------
  202.   # ● スキルの使用コストを描画
  203.   #--------------------------------------------------------------------------
  204.   def draw_skill_cost(rect, skill)
  205.     rect.y = rect.height - line_width
  206.     rect.height = line_width
  207.     if @actor.skill_tp_cost(skill) > 0
  208.       change_color(tp_cost_color, enable?(skill))
  209.       contents.draw_text(rect, @actor.skill_tp_cost(skill), 2)
  210.     elsif @actor.skill_mp_cost(skill) > 0
  211.       change_color(mp_cost_color, enable?(skill))
  212.       contents.draw_text(rect, @actor.skill_mp_cost(skill), 2)
  213.     end
  214.   end
  215.   #--------------------------------------------------------------------------
  216.   # ● ヘルプテキスト更新
  217.   #--------------------------------------------------------------------------
  218.   def update_help
  219.     @help_window.set_item(item)
  220.   end
  221.   #--------------------------------------------------------------------------
  222.   # ● リフレッシュ
  223.   #--------------------------------------------------------------------------
  224.   def refresh
  225.     make_item_list
  226.     create_contents
  227.     draw_all_items
  228.   end
  229. end


  230. #==============================================================================
  231. # ■ Scene_Skill
  232. #------------------------------------------------------------------------------
  233. #  スキル画面の処理を行うクラスです。処理共通化の便宜上、スキルも「アイテム」
  234. # として扱っています。
  235. #==============================================================================

  236. class Scene_Skill < Scene_ItemBase
  237.   #--------------------------------------------------------------------------
  238.   # ● カーソルが左列にあるかの判定
  239.   #--------------------------------------------------------------------------
  240.   def cursor_left?
  241. #~     @item_window.index % 2 == 0
  242.     true
  243.   end
  244.   #--------------------------------------------------------------------------
  245.   # ● ヘルプウィンドウの作成
  246.   #--------------------------------------------------------------------------
  247.   def create_help_window
  248.     @help_window = Window_J_Help.new
  249.     @help_window.viewport = @viewport
  250.   end
  251.   #--------------------------------------------------------------------------
  252.   # ● コマンドウィンドウの作成
  253.   #--------------------------------------------------------------------------
  254.   def create_command_window
  255.     @command_window = Window_J_SkillCommand.new(0, 0)
  256.     @command_window.x = Graphics.width - @command_window.width
  257.     @command_window.viewport = @viewport
  258.     @command_window.help_window = @help_window
  259.     @command_window.actor = @actor
  260.     @command_window.set_handler(:skill,    method(:command_skill))
  261.     @command_window.set_handler(:cancel,   method(:return_scene))
  262.     @command_window.set_handler(:pagedown, method(:next_actor))
  263.     @command_window.set_handler(:pageup,   method(:prev_actor))
  264.   end
  265.   #--------------------------------------------------------------------------
  266.   # ● ステータスウィンドウの作成
  267.   #--------------------------------------------------------------------------
  268.   def create_status_window
  269.     @status_window = Window_SkillStatus.new(@help_window.width, 0)
  270.     @status_window.viewport = @viewport
  271.     @status_window.actor = @actor
  272.   end
  273.   #--------------------------------------------------------------------------
  274.   # ● アイテムウィンドウの作成
  275.   #--------------------------------------------------------------------------
  276.   def create_item_window
  277.     wx = @help_window.width
  278.     wy = @status_window.height
  279.     ww = Graphics.width - wx
  280.     wh = Graphics.height - wy
  281.     @item_window = Window_J_SkillList.new(wx, wy, ww, wh)
  282.     @item_window.actor = @actor
  283.     @item_window.viewport = @viewport
  284.     @item_window.help_window = @help_window
  285.     @item_window.set_handler(:ok,     method(:on_item_ok))
  286.     @item_window.set_handler(:cancel, method(:on_item_cancel))
  287.     @command_window.skill_window = @item_window
  288.   end
  289. end
复制代码

  1. #==============================================================================
  2. # ■ VXAce-RGSS3-31 和風レイアウト <equip>          by Claimh
  3. #------------------------------------------------------------------------------
  4. # 装備画面変更
  5. #==============================================================================

  6. #==============================================================================
  7. # ■ Window_EquipStatus
  8. #------------------------------------------------------------------------------
  9. #  装備画面で、アクターの能力値変化を表示するウィンドウです。
  10. #==============================================================================

  11. class Window_EquipStatus < Window_Base
  12.   #--------------------------------------------------------------------------
  13.   # ● オブジェクト初期化
  14.   #--------------------------------------------------------------------------
  15.   def initialize(x, y)
  16.     super(x, y, window_width, window_height)
  17.     @actor = nil
  18.     @temp_actor = nil
  19.     refresh
  20.   end
  21.   #--------------------------------------------------------------------------
  22.   # ● ウィンドウ幅の取得
  23.   #--------------------------------------------------------------------------
  24.   def window_width
  25.     Graphics.width - fitting_height(2) - fitting_height(1)
  26.   end
  27.   #--------------------------------------------------------------------------
  28.   # ● ウィンドウ高さの取得
  29.   #--------------------------------------------------------------------------
  30.   def window_height
  31.     fitting_height(visible_line_number)
  32.   end
  33.   #--------------------------------------------------------------------------
  34.   # ● 表示行数の取得
  35.   #--------------------------------------------------------------------------
  36.   def visible_line_number
  37.     (7.0 / col_max).round
  38.   end
  39.   #--------------------------------------------------------------------------
  40.   # ● 桁数の取得
  41.   #--------------------------------------------------------------------------
  42.   def col_max
  43.     return 2
  44.   end
  45.   #--------------------------------------------------------------------------
  46.   # ● リフレッシュ
  47.   #--------------------------------------------------------------------------
  48.   def refresh
  49.     contents.clear
  50.     draw_actor_name(@actor, 4, 0) if @actor
  51.     6.times do |i|
  52.       x = (i % col_max) * contents_width / col_max
  53.       y = line_height * (i / col_max)
  54.       draw_item(x, y+line_height, 2 + i)
  55.     end
  56.   end
  57. end


  58. #==============================================================================
  59. # ■ Window_J_EquipCommand
  60. #------------------------------------------------------------------------------
  61. #  スキル画面で、コマンド(装備変更、最強装備など)を選択するウィンドウです。
  62. #==============================================================================

  63. class Window_J_EquipCommand < Window_J_Command
  64.   #--------------------------------------------------------------------------
  65.   # ● オブジェクト初期化
  66.   #--------------------------------------------------------------------------
  67.   def initialize(x, y, width)
  68.     super(x, y)
  69.   end
  70.   #--------------------------------------------------------------------------
  71.   # ● ウィンドウ幅の取得
  72.   #--------------------------------------------------------------------------
  73.   def window_width
  74.     fitting_width(1)
  75.   end
  76.   #--------------------------------------------------------------------------
  77.   # ● 桁数の取得
  78.   #--------------------------------------------------------------------------
  79.   def col_max
  80.     return 3
  81.   end
  82.   #--------------------------------------------------------------------------
  83.   # ● コマンドリストの作成
  84.   #--------------------------------------------------------------------------
  85.   def make_command_list
  86.     add_command(Vocab::equip2,   :equip)
  87.     add_command(Vocab::optimize, :optimize)
  88.     add_command(Vocab::clear,    :clear)
  89.   end
  90. end


  91. #==============================================================================
  92. # ■ Window_J_EquipSlot
  93. #------------------------------------------------------------------------------
  94. #  装備画面で、アクターが現在装備しているアイテムを表示するウィンドウです。
  95. #==============================================================================

  96. class Window_J_EquipSlot < Window_J_Selectable
  97.   #--------------------------------------------------------------------------
  98.   # ● 公開インスタンス変数
  99.   #--------------------------------------------------------------------------
  100.   attr_reader   :status_window            # ステータスウィンドウ
  101.   attr_reader   :item_window              # アイテムウィンドウ
  102.   #--------------------------------------------------------------------------
  103.   # ● オブジェクト初期化
  104.   #--------------------------------------------------------------------------
  105.   def initialize(x, y, height)
  106.     super(x, y, window_width, height)
  107.     @actor = nil
  108.     refresh
  109.   end
  110.   #--------------------------------------------------------------------------
  111.   # ● ウィンドウ高さの取得
  112.   #--------------------------------------------------------------------------
  113.   def window_width
  114.     fitting_width(visible_line_number)
  115.   end
  116.   #--------------------------------------------------------------------------
  117.   # ● 表示行数の取得
  118.   #--------------------------------------------------------------------------
  119.   def visible_line_number
  120.     return 5
  121.   end
  122.   #--------------------------------------------------------------------------
  123.   # ● アクターの設定
  124.   #--------------------------------------------------------------------------
  125.   def actor=(actor)
  126.     return if @actor == actor
  127.     @actor = actor
  128.     refresh
  129.   end
  130.   #--------------------------------------------------------------------------
  131.   # ● フレーム更新
  132.   #--------------------------------------------------------------------------
  133.   def update
  134.     super
  135.     @item_window.slot_id = index if @item_window
  136.   end
  137.   #--------------------------------------------------------------------------
  138.   # ● 項目数の取得
  139.   #--------------------------------------------------------------------------
  140.   def item_max
  141.     @actor ? @actor.equip_slots.size : 0
  142.   end
  143.   #--------------------------------------------------------------------------
  144.   # ● アイテムの取得
  145.   #--------------------------------------------------------------------------
  146.   def item
  147.     @actor ? @actor.equips[index] : nil
  148.   end
  149.   #--------------------------------------------------------------------------
  150.   # ● 項目の描画
  151.   #--------------------------------------------------------------------------
  152.   def draw_item(index)
  153.     return unless @actor
  154.     rect = item_rect_for_text(index)
  155.     change_color(system_color, enable?(index))
  156.     draw_text(rect.x, rect.y, line_width, 96, slot_name(index))
  157.     draw_item_name(@actor.equips[index], rect.x, rect.y + 92, enable?(index))
  158.   end
  159.   #--------------------------------------------------------------------------
  160.   # ● 装備スロットの名前を取得
  161.   #--------------------------------------------------------------------------
  162.   def slot_name(index)
  163.     @actor ? Vocab::etype(@actor.equip_slots[index]) : ""
  164.   end
  165.   #--------------------------------------------------------------------------
  166.   # ● 装備スロットを許可状態で表示するかどうか
  167.   #--------------------------------------------------------------------------
  168.   def enable?(index)
  169.     @actor ? @actor.equip_change_ok?(index) : false
  170.   end
  171.   #--------------------------------------------------------------------------
  172.   # ● 選択項目の有効状態を取得
  173.   #--------------------------------------------------------------------------
  174.   def current_item_enabled?
  175.     enable?(index)
  176.   end
  177.   #--------------------------------------------------------------------------
  178.   # ● ステータスウィンドウの設定
  179.   #--------------------------------------------------------------------------
  180.   def status_window=(status_window)
  181.     @status_window = status_window
  182.     call_update_help
  183.   end
  184.   #--------------------------------------------------------------------------
  185.   # ● アイテムウィンドウの設定
  186.   #--------------------------------------------------------------------------
  187.   def item_window=(item_window)
  188.     @item_window = item_window
  189.     update
  190.   end
  191.   #--------------------------------------------------------------------------
  192.   # ● ヘルプテキスト更新
  193.   #--------------------------------------------------------------------------
  194.   def update_help
  195.     super
  196.     @help_window.set_item(item) if @help_window
  197.     @status_window.set_temp_actor(nil) if @status_window
  198.   end
  199. end


  200. #==============================================================================
  201. # ■ Window_J_EquipItem
  202. #------------------------------------------------------------------------------
  203. #  装備画面で、装備変更の候補となるアイテムの一覧を表示するウィンドウです。
  204. #==============================================================================

  205. class Window_J_EquipItem < Window_J_ItemList
  206.   #--------------------------------------------------------------------------
  207.   # ● 公開インスタンス変数
  208.   #--------------------------------------------------------------------------
  209.   attr_reader   :status_window            # ステータスウィンドウ
  210.   #--------------------------------------------------------------------------
  211.   # ● オブジェクト初期化
  212.   #--------------------------------------------------------------------------
  213.   def initialize(x, y, width, height)
  214.     super
  215.     @actor = nil
  216.     @slot_id = 0
  217.   end
  218.   #--------------------------------------------------------------------------
  219.   # ● 桁数の取得
  220.   #--------------------------------------------------------------------------
  221.   def col_max
  222.     return 1
  223.   end
  224.   #--------------------------------------------------------------------------
  225.   # ● アクターの設定
  226.   #--------------------------------------------------------------------------
  227.   def actor=(actor)
  228.     return if @actor == actor
  229.     @actor = actor
  230.     refresh
  231.     self.oy = 0
  232.   end
  233.   #--------------------------------------------------------------------------
  234.   # ● 装備スロット ID の設定
  235.   #--------------------------------------------------------------------------
  236.   def slot_id=(slot_id)
  237.     return if @slot_id == slot_id
  238.     @slot_id = slot_id
  239.     refresh
  240.     self.oy = 0
  241.   end
  242.   #--------------------------------------------------------------------------
  243.   # ● アイテムをリストに含めるかどうか
  244.   #--------------------------------------------------------------------------
  245.   def include?(item)
  246.     return true if item == nil
  247.     return false unless item.is_a?(RPG::EquipItem)
  248.     return false if @slot_id < 0
  249.     return false if item.etype_id != @actor.equip_slots[@slot_id]
  250.     return @actor.equippable?(item)
  251.   end
  252.   #--------------------------------------------------------------------------
  253.   # ● アイテムを許可状態で表示するかどうか
  254.   #--------------------------------------------------------------------------
  255.   def enable?(item)
  256.     return true
  257.   end
  258.   #--------------------------------------------------------------------------
  259.   # ● 前回の選択位置を復帰
  260.   #--------------------------------------------------------------------------
  261.   def select_last
  262.   end
  263.   #--------------------------------------------------------------------------
  264.   # ● ステータスウィンドウの設定
  265.   #--------------------------------------------------------------------------
  266.   def status_window=(status_window)
  267.     @status_window = status_window
  268.     call_update_help
  269.   end
  270.   #--------------------------------------------------------------------------
  271.   # ● ヘルプテキスト更新
  272.   #--------------------------------------------------------------------------
  273.   def update_help
  274.     super
  275.     if @actor && @status_window
  276.       temp_actor = Marshal.load(Marshal.dump(@actor))
  277.       temp_actor.force_change_equip(@slot_id, item)
  278.       @status_window.set_temp_actor(temp_actor)
  279.     end
  280.   end
  281. end


  282. #==============================================================================
  283. # ■ Scene_Equip
  284. #------------------------------------------------------------------------------
  285. #  装備画面の処理を行うクラスです。
  286. #==============================================================================

  287. class Scene_Equip < Scene_MenuBase
  288.   #--------------------------------------------------------------------------
  289.   # ● ヘルプウィンドウの作成
  290.   #--------------------------------------------------------------------------
  291.   def create_help_window
  292.     @help_window = Window_J_Help.new
  293.     @help_window.viewport = @viewport
  294.   end
  295.   #--------------------------------------------------------------------------
  296.   # ● ステータスウィンドウの作成
  297.   #--------------------------------------------------------------------------
  298.   def create_status_window
  299.     @status_window = Window_EquipStatus.new(@help_window.width, 0)
  300.     @status_window.viewport = @viewport
  301.     @status_window.actor = @actor
  302.   end
  303.   #--------------------------------------------------------------------------
  304.   # ● コマンドウィンドウの作成
  305.   #--------------------------------------------------------------------------
  306.   def create_command_window
  307.     wx = @help_window.width + @status_window.width
  308.     @command_window = Window_J_EquipCommand.new(wx, 0, 0)
  309.     @command_window.viewport = @viewport
  310.     @command_window.help_window = @help_window
  311.     @command_window.set_handler(:equip,    method(:command_equip))
  312.     @command_window.set_handler(:optimize, method(:command_optimize))
  313.     @command_window.set_handler(:clear,    method(:command_clear))
  314.     @command_window.set_handler(:cancel,   method(:return_scene))
  315.     @command_window.set_handler(:pagedown, method(:next_actor))
  316.     @command_window.set_handler(:pageup,   method(:prev_actor))
  317.   end
  318.   #--------------------------------------------------------------------------
  319.   # ● スロットウィンドウの作成
  320.   #--------------------------------------------------------------------------
  321.   def create_slot_window
  322.     wx = Graphics.width - @command_window.width
  323.     wy = @status_window.height
  324.     wh = Graphics.height - wy
  325.     @slot_window = Window_J_EquipSlot.new(wx, wy, wh)
  326.     @slot_window.x -= @slot_window.width
  327.     @slot_window.viewport = @viewport
  328.     @slot_window.help_window = @help_window
  329.     @slot_window.status_window = @status_window
  330.     @slot_window.actor = @actor
  331.     @slot_window.set_handler(:ok,       method(:on_slot_ok))
  332.     @slot_window.set_handler(:cancel,   method(:on_slot_cancel))
  333.   end
  334.   #--------------------------------------------------------------------------
  335.   # ● アイテムウィンドウの作成
  336.   #--------------------------------------------------------------------------
  337.   def create_item_window
  338.     wx = @help_window.width
  339.     wy = @status_window.height
  340.     ww = Graphics.width - wx - @slot_window.width - @command_window.width
  341.     wh = Graphics.height - wy
  342.     @item_window = Window_J_EquipItem.new(wx, wy, ww, wh)
  343.     @item_window.viewport = @viewport
  344.     @item_window.help_window = @help_window
  345.     @item_window.status_window = @status_window
  346.     @item_window.actor = @actor
  347.     @item_window.set_handler(:ok,     method(:on_item_ok))
  348.     @item_window.set_handler(:cancel, method(:on_item_cancel))
  349.     @slot_window.item_window = @item_window
  350.   end
  351. end
复制代码


  1. #==============================================================================
  2. # ■ VXAce-RGSS3-31 和風レイアウト <file>          by Claimh
  3. #------------------------------------------------------------------------------
  4. # ファイル画面変更
  5. #==============================================================================

  6. #==============================================================================
  7. # ■ SaveActor  : セーブファイル用のダミーアクター
  8. #==============================================================================
  9. class SaveActor
  10.   #--------------------------------------------------------------------------
  11.   # ● 公開インスタンス変数
  12.   #--------------------------------------------------------------------------
  13.   attr_reader :name
  14.   attr_reader :level
  15.   attr_reader :hp
  16.   attr_reader :mp
  17.   attr_reader :mhp
  18.   attr_reader :mmp
  19.   attr_reader :face_name
  20.   attr_reader :face_index
  21.   #--------------------------------------------------------------------------
  22.   # ● オブジェクト初期化
  23.   #--------------------------------------------------------------------------
  24.   def initialize(actor)
  25.     @name = actor.name
  26.     @level = actor.level
  27.     @hp = actor.hp; @mhp = actor.mhp
  28.     @mp = actor.mp; @mmp = actor.mmp
  29.     @face_name = actor.face_name
  30.     @face_index = actor.face_index
  31.     @dead = actor.dead?
  32.   end
  33.   #--------------------------------------------------------------------------
  34.   # ● 戦闘不能判定
  35.   #--------------------------------------------------------------------------
  36.   def dead?
  37.     @dead
  38.   end
  39.   #--------------------------------------------------------------------------
  40.   # ● HP の割合を取得
  41.   #--------------------------------------------------------------------------
  42.   def hp_rate
  43.     @hp.to_f / @mhp
  44.   end
  45.   #--------------------------------------------------------------------------
  46.   # ● MP の割合を取得
  47.   #--------------------------------------------------------------------------
  48.   def mp_rate
  49.     @mmp > 0 ? @mp.to_f / @mmp : 0
  50.   end
  51. end

  52. #==============================================================================
  53. # ■ Game_Party
  54. #==============================================================================
  55. class Game_Party < Game_Unit
  56.   #--------------------------------------------------------------------------
  57.   # ● セーブファイル表示用の顔グラフィック画像情報
  58.   #--------------------------------------------------------------------------
  59.   def member_for_savefile
  60.     members.collect { |actor| SaveActor.new(actor) }
  61.   end
  62. end

  63. #==============================================================================
  64. # ■ DataManager
  65. #==============================================================================
  66. class << DataManager
  67.   #--------------------------------------------------------------------------
  68.   # ● セーブヘッダの作成
  69.   #--------------------------------------------------------------------------
  70.   alias make_save_header_faces make_save_header
  71.   def make_save_header
  72.     header = make_save_header_faces
  73.     header[:actors] = $game_party.member_for_savefile
  74.     header
  75.   end
  76. end


  77. #==============================================================================
  78. # ■ Window_J_SaveFile
  79. #------------------------------------------------------------------------------
  80. #  セーブ画面およびロード画面で表示する、セーブファイルのウィンドウです。
  81. #==============================================================================

  82. class Window_J_SaveFile < Window_J_Base
  83.   #--------------------------------------------------------------------------
  84.   # ● 公開インスタンス変数
  85.   #--------------------------------------------------------------------------
  86.   attr_reader   :selected                 # 選択状態
  87.   #--------------------------------------------------------------------------
  88.   # ● オブジェクト初期化
  89.   #     index : セーブファイルのインデックス
  90.   #--------------------------------------------------------------------------
  91.   def initialize(index)
  92.     lw = fitting_width(1)
  93.     dx = Graphics.width - lw
  94.     super(dx - index * lw - lw, 0, lw, window_height)
  95.     @file_index = index
  96.     refresh
  97.     @selected = false
  98.   end
  99.   #--------------------------------------------------------------------------
  100.   # ● ウィンドウ高さ
  101.   #--------------------------------------------------------------------------
  102.   def window_height
  103.     return 200
  104.   end
  105.   #--------------------------------------------------------------------------
  106.   # ● リフレッシュ
  107.   #--------------------------------------------------------------------------
  108.   def refresh
  109.     contents.clear
  110.     change_color(normal_color)
  111.     name = Vocab::File + " " + ConvJnum.conv(@file_index + 1)
  112.     draw_text(0, 4, line_width, contents_height, name)
  113.   end
  114.   #--------------------------------------------------------------------------
  115.   # ● 選択状態の設定
  116.   #--------------------------------------------------------------------------
  117.   def selected=(selected)
  118.     @selected = selected
  119.     update_cursor
  120.   end
  121.   #--------------------------------------------------------------------------
  122.   # ● カーソルの更新
  123.   #--------------------------------------------------------------------------
  124.   def update_cursor
  125.     if @selected
  126.       cursor_rect.set(0, 0, line_width, contents_height)
  127.     else
  128.       cursor_rect.empty
  129.     end
  130.   end
  131. end


  132. #==============================================================================
  133. # ■ Window_J_SaveInfo
  134. #==============================================================================
  135. class Window_J_SaveInfo < Window_J_Selectable
  136.   #--------------------------------------------------------------------------
  137.   # ● オブジェクト初期化
  138.   #--------------------------------------------------------------------------
  139.   def initialize(dw, dh)
  140.     @actors = []
  141.     super(0, dh, Graphics.width - dw, Graphics.height - dh)
  142.     self.file_index = index
  143.   end
  144.   #--------------------------------------------------------------------------
  145.   # ● 行の幅を取得
  146.   #--------------------------------------------------------------------------
  147.   def line_width
  148.     110
  149.   end
  150.   #--------------------------------------------------------------------------
  151.   # ● 項目の高さを取得
  152.   #--------------------------------------------------------------------------
  153.   def item_height
  154.     contents_height
  155.   end
  156.   #--------------------------------------------------------------------------
  157.   # ● ウィンドウ内容の高さを計算
  158.   #--------------------------------------------------------------------------
  159.   def contents_height
  160.     height - standard_padding * 2
  161.   end
  162.   #--------------------------------------------------------------------------
  163.   # ● 項目数の取得
  164.   #--------------------------------------------------------------------------
  165.   def item_max
  166.     return [@actors.size, 4].min
  167.   end
  168.   #--------------------------------------------------------------------------
  169.   # ● ファイル変更
  170.   #--------------------------------------------------------------------------
  171.   def file_index=(index)
  172.     return if @file_index == index
  173.     @file_index = index
  174.     header = DataManager.load_header(@file_index)
  175.     @actors   = !header.nil? ? header[:actors] : []
  176.     create_contents
  177.     refresh
  178.   end
  179.   #--------------------------------------------------------------------------
  180.   # ● 項目の描画
  181.   #--------------------------------------------------------------------------
  182.   def draw_item(index)
  183.     return if @actors.empty? or @actors.nil?
  184.     actor = @actors[index]
  185.     rect = item_rect(index)
  186.     draw_actor_name_l(actor, rect.x+4, rect.y, line_width)
  187.     draw_actor_face(actor, rect.x+(line_width-96)/2, rect.y+line_height*1, !actor.dead?)
  188.     draw_actor_level_l(actor, rect.x+4, rect.y+96+line_height*1)
  189.     draw_actor_hp_l(actor, rect.x+4, rect.y+96+line_height*2, line_width-8)
  190.     draw_actor_mp_l(actor, rect.x+4, rect.y+96+line_height*3, line_width-8)
  191.   end
  192.   #--------------------------------------------------------------------------
  193.   # ● レベルの描画
  194.   #--------------------------------------------------------------------------
  195.   def draw_actor_level(actor, x, y)
  196.     change_color(system_color)
  197.     contents.draw_text(x, y, 32, line_height, Vocab::level_a)
  198.     change_color(normal_color)
  199.     contents.draw_text(x + 32, y, 24, line_height, actor.level, 2)
  200.   end
  201. end


  202. #==============================================================================
  203. # ■ Scene_File
  204. #------------------------------------------------------------------------------
  205. #  セーブ画面とロード画面の共通処理を行うクラスです。
  206. #==============================================================================

  207. class Scene_File < Scene_MenuBase
  208.   #--------------------------------------------------------------------------
  209.   # ● ヘルプウィンドウの作成
  210.   #--------------------------------------------------------------------------
  211.   def create_help_window
  212.     @help_window = Window_J_Help.new(1)
  213.     @help_window.x = Graphics.width - @help_window.width
  214.     @help_window.set_text(help_window_text)
  215.   end
  216.   #--------------------------------------------------------------------------
  217.   # ● セーブファイルビューポートの作成
  218.   #--------------------------------------------------------------------------
  219.   def create_savefile_viewport
  220.     @savefile_viewport = Viewport.new
  221.     @savefile_viewport.rect.width -= @help_window.width
  222.   end
  223.   #--------------------------------------------------------------------------
  224.   # ● セーブファイルウィンドウの作成
  225.   #--------------------------------------------------------------------------
  226.   def create_savefile_windows
  227.     @savefile_windows = Array.new(item_max) do |i|
  228.       Window_J_SaveFile.new(i)
  229.     end
  230.     @savefile_windows.each {|window| window.viewport = @savefile_viewport }
  231.    
  232.     @info_window = Window_J_SaveInfo.new(@help_window.width, @savefile_windows[0].height)
  233.   end
  234.   #--------------------------------------------------------------------------
  235.   # ● 選択状態の初期化
  236.   #--------------------------------------------------------------------------
  237.   def init_selection
  238.     @index = first_savefile_index
  239.     @savefile_windows[@index].selected = true
  240.     self.top_index = @index - visible_max / 2
  241.     ensure_cursor_visible
  242.     @info_window.file_index = @index
  243.   end
  244.   #--------------------------------------------------------------------------
  245.   # ● 項目数の取得
  246.   #--------------------------------------------------------------------------
  247.   def item_max
  248.     DataManager.savefile_max
  249.   end
  250.   #--------------------------------------------------------------------------
  251.   # ● 画面内に表示するセーブファイル数を取得
  252.   #--------------------------------------------------------------------------
  253.   def visible_max
  254.     @savefile_viewport.rect.width / @help_window.width
  255.   end
  256.   #--------------------------------------------------------------------------
  257.   # ● セーブファイルウィンドウの幅を取得
  258.   #--------------------------------------------------------------------------
  259.   def savefile_width
  260.     @savefile_windows[0].width
  261.   end
  262.   #--------------------------------------------------------------------------
  263.   # ● 最初に選択状態にするファイルインデックスを取得
  264.   #--------------------------------------------------------------------------
  265.   def first_savefile_index
  266.     return 0
  267.   end
  268.   #--------------------------------------------------------------------------
  269.   # ● 現在のインデックスの取得
  270.   #--------------------------------------------------------------------------
  271.   def index
  272.     @index
  273.   end
  274.   #--------------------------------------------------------------------------
  275.   # ● 先頭のインデックスの取得
  276.   #--------------------------------------------------------------------------
  277.   def top_index
  278.     (@savefile_viewport.ox - @savefile_viewport.rect.width) / savefile_width
  279.   end
  280.   #--------------------------------------------------------------------------
  281.   # ● 先頭のインデックスの設定
  282.   #--------------------------------------------------------------------------
  283.   def top_index=(index)
  284.     index = 0 if index < 0
  285.     index = item_max - visible_max if index > item_max - visible_max
  286.     @savefile_viewport.ox = @help_window.width - (index+1) * savefile_width
  287.   end
  288.   #--------------------------------------------------------------------------
  289.   # ● 末尾のインデックスの取得
  290.   #--------------------------------------------------------------------------
  291.   def bottom_index
  292.     top_index + visible_max - 1
  293.   end
  294.   #--------------------------------------------------------------------------
  295.   # ● 末尾のインデックスの設定
  296.   #--------------------------------------------------------------------------
  297.   def bottom_index=(index)
  298.     self.top_index = index - (visible_max - 1)
  299.   end
  300.   #--------------------------------------------------------------------------
  301.   # ● セーブファイル選択の更新
  302.   #--------------------------------------------------------------------------
  303.   def update_savefile_selection
  304.     return on_savefile_ok     if Input.trigger?(:C)
  305.     return on_savefile_cancel if Input.trigger?(:B)
  306.     update_cursor
  307.   end
  308.   #--------------------------------------------------------------------------
  309.   # ● セーブファイル[決定]
  310.   #--------------------------------------------------------------------------
  311.   def on_savefile_ok
  312.   end
  313.   #--------------------------------------------------------------------------
  314.   # ● セーブファイル[キャンセル]
  315.   #--------------------------------------------------------------------------
  316.   def on_savefile_cancel
  317.     Sound.play_cancel
  318.     return_scene
  319.   end
  320.   #--------------------------------------------------------------------------
  321.   # ● カーソルの更新
  322.   #--------------------------------------------------------------------------
  323.   def update_cursor
  324.     last_index = @index
  325.     cursor_l(Input.trigger?(:LEFT))   if Input.repeat?(:LEFT)
  326.     cursor_r(Input.trigger?(:RIGHT))  if Input.repeat?(:RIGHT)
  327.     cursor_pagedown   if Input.trigger?(:L)
  328.     cursor_pageup     if Input.trigger?(:R)
  329.     if @index != last_index
  330.       Sound.play_cursor
  331.       @savefile_windows[last_index].selected = false
  332.       @savefile_windows[@index].selected = true
  333.     end
  334.     @info_window.file_index = @index
  335.   end
  336.   #--------------------------------------------------------------------------
  337.   # ● カーソルを左に移動
  338.   #--------------------------------------------------------------------------
  339.   def cursor_l(wrap)
  340.     @index = (@index + 1) % item_max if @index < item_max - 1 || wrap
  341.     ensure_cursor_visible
  342.   end
  343.   #--------------------------------------------------------------------------
  344.   # ● カーソルを右に移動
  345.   #--------------------------------------------------------------------------
  346.   def cursor_r(wrap)
  347.     @index = (@index - 1 + item_max) % item_max if @index > 0 || wrap
  348.     ensure_cursor_visible
  349.   end
  350.   #--------------------------------------------------------------------------
  351.   # ● カーソルを 1 ページ後ろに移動
  352.   #--------------------------------------------------------------------------
  353.   def cursor_pagedown
  354.     if top_index + visible_max < item_max
  355.       self.top_index += visible_max
  356.       @index = [@index + visible_max, item_max - 1].min
  357.     end
  358.   end
  359.   #--------------------------------------------------------------------------
  360.   # ● カーソルを 1 ページ前に移動
  361.   #--------------------------------------------------------------------------
  362.   def cursor_pageup
  363.     if top_index > 0
  364.       self.top_index -= visible_max
  365.       @index = [@index - visible_max, 0].max
  366.     end
  367.   end
  368.   #--------------------------------------------------------------------------
  369.   # ● カーソル位置が画面内になるようにスクロール
  370.   #--------------------------------------------------------------------------
  371.   def ensure_cursor_visible
  372.     self.top_index = index if index < top_index
  373.     self.bottom_index = index if index > bottom_index
  374.   end
  375. end
复制代码


  1. #==============================================================================
  2. # ■ VXAce-RGSS3-31 和風レイアウト <title>          by Claimh
  3. #------------------------------------------------------------------------------
  4. # タイトル画面変更
  5. #==============================================================================

  6. #==============================================================================
  7. # ■ Window_J_TitleCommand
  8. #------------------------------------------------------------------------------
  9. #  タイトル画面で、ニューゲーム/コンティニューを選択するウィンドウです。
  10. #==============================================================================

  11. class Window_J_TitleCommand < Window_J_Command
  12.   #--------------------------------------------------------------------------
  13.   # ● オブジェクト初期化
  14.   #--------------------------------------------------------------------------
  15.   def initialize
  16.     super(0, 0)
  17.     update_placement
  18.     select_symbol(:continue) if continue_enabled
  19.     self.openness = 0
  20.     open
  21.   end
  22.   #--------------------------------------------------------------------------
  23.   # ● ウィンドウ幅の取得
  24.   #--------------------------------------------------------------------------
  25.   def window_height
  26.     return 160
  27.   end
  28.   #--------------------------------------------------------------------------
  29.   # ● ウィンドウ位置の更新
  30.   #--------------------------------------------------------------------------
  31.   def update_placement
  32.     self.x = 10
  33.     self.y = (Graphics.height - height) - 10
  34.   end
  35.   #--------------------------------------------------------------------------
  36.   # ● コマンドリストの作成
  37.   #--------------------------------------------------------------------------
  38.   def make_command_list
  39.     add_command(Vocab::new_game, :new_game)
  40.     add_command(Vocab::continue, :continue, continue_enabled)
  41.     add_command(Vocab::shutdown, :shutdown)
  42.   end
  43.   #--------------------------------------------------------------------------
  44.   # ● コンティニューの有効状態を取得
  45.   #--------------------------------------------------------------------------
  46.   def continue_enabled
  47.     DataManager.save_file_exists?
  48.   end
  49. end


  50. #==============================================================================
  51. # ■ Scene_Title
  52. #------------------------------------------------------------------------------
  53. #  タイトル画面の処理を行うクラスです。
  54. #==============================================================================

  55. class Scene_Title < Scene_Base
  56.   #--------------------------------------------------------------------------
  57.   # ● ゲームタイトルの描画
  58.   #--------------------------------------------------------------------------
  59.   def draw_game_title
  60.     @foreground_sprite.bitmap.font.size = 48
  61.     rect = Rect.new(420, 0, Graphics.width-420, Graphics.height / 2)
  62.     @foreground_sprite.bitmap.draw_h_text(rect, $data_system.game_title)
  63.   end
  64.   #--------------------------------------------------------------------------
  65.   # ● コマンドウィンドウの作成
  66.   #--------------------------------------------------------------------------
  67.   def create_command_window
  68.     @command_window = Window_J_TitleCommand.new
  69.     @command_window.set_handler(:new_game, method(:command_new_game))
  70.     @command_window.set_handler(:continue, method(:command_continue))
  71.     @command_window.set_handler(:shutdown, method(:command_shutdown))
  72.   end
  73. end
复制代码



  1. #==============================================================================
  2. # ■ VXAce-RGSS3-31 和風レイアウト <battle>          by Claimh
  3. #------------------------------------------------------------------------------
  4. # バトル画面変更
  5. #==============================================================================

  6. class Window_BattleLog < Window_Selectable
  7.   #--------------------------------------------------------------------------
  8.   # ● 背景色の取得
  9.   #--------------------------------------------------------------------------
  10.   def back_color
  11.     Color.new(255, 255, 255, back_opacity)
  12.   end
  13.   #--------------------------------------------------------------------------
  14.   # ● 背景の不透明度を取得
  15.   #--------------------------------------------------------------------------
  16.   def back_opacity
  17.     return 164
  18.   end
  19. end


  20. class Game_Troop < Game_Unit
  21.   #--------------------------------------------------------------------------
  22.   # ● 敵キャラ名の後ろにつける文字の表
  23.   #--------------------------------------------------------------------------
  24.   LETTER_TABLE_FULL = ['ノ壱','ノ弐','ノ参','ノ肆','ノ伍',
  25.                        'ノ陸','ノ漆','ノ捌','ノ玖','ノ拾']
  26. end


  27. #==============================================================================
  28. # ■ Game_Battler
  29. #==============================================================================
  30. class Game_Actor < Game_Battler
  31.   attr_reader :r_st   # 戦闘時のステートルーレット
  32.   #--------------------------------------------------------------------------
  33.   # ● セットアップ
  34.   #--------------------------------------------------------------------------
  35.   alias setup_rst setup
  36.   def setup(actor_id)
  37.     setup_rst(actor_id)
  38.     @r_st = FvRouletStates.new(self)
  39.   end
  40. end



  41. #==============================================================================
  42. # ■ FvRouletStates
  43. #==============================================================================
  44. class FvRouletStates
  45.   WAIT = 40   # 切り替えタイミング(frame)
  46.   #--------------------------------------------------------------------------
  47.   # ● オブジェクト初期化
  48.   #--------------------------------------------------------------------------
  49.   def initialize(actor)
  50.     reset_states(actor)
  51.   end
  52.   #--------------------------------------------------------------------------
  53.   # ● ステート情報リセット
  54.   #--------------------------------------------------------------------------
  55.   def reset_states(actor)
  56.     act_sts = actor.states.select {|s| s.icon_index != 0}
  57.     return false if act_sts == @states
  58.     @states = act_sts
  59.     @index = 0
  60.     @wait = WAIT
  61.     true
  62.   end
  63.   #--------------------------------------------------------------------------
  64.   # ● ステート情報切り替え
  65.   #--------------------------------------------------------------------------
  66.   def next_state
  67.     @index = (@index + 1) % @states.size
  68.     @wait = WAIT
  69.     true
  70.   end
  71.   #--------------------------------------------------------------------------
  72.   # ● フレーム更新
  73.   #--------------------------------------------------------------------------
  74.   def update(actor)
  75.     return true if reset_states(actor)
  76.     return false if @states.size < 2
  77.     @wait -= 1
  78.     return next_state if @wait == 0
  79.     false
  80.   end
  81.   #--------------------------------------------------------------------------
  82.   # ● アイコンIndex
  83.   #--------------------------------------------------------------------------
  84.   def icon_index
  85.     return 0 if @states.empty?
  86.     @states[@index].icon_index
  87.   end
  88. end


  89. #==============================================================================
  90. # ■ Spriteset_Battle
  91. #------------------------------------------------------------------------------
  92. #  バトル画面のスプライトをまとめたクラスです。このクラスは Scene_Battle クラ
  93. # スの内部で使用されます。
  94. #==============================================================================

  95. class Spriteset_Battle
  96.   #--------------------------------------------------------------------------
  97.   # ● マップ画面を加工した戦闘背景用ビットマップの作成
  98.   #--------------------------------------------------------------------------
  99.   def create_blurry_background_bitmap
  100.     source = SceneManager.background_bitmap
  101.     bitmap = Bitmap.new(640, 480)
  102.     bitmap.stretch_blt(bitmap.rect, source, source.rect)
  103. #~     bitmap.radial_blur(120, 16)
  104.     bitmap.blur
  105.     bitmap
  106.   end
  107. end


  108. #==============================================================================
  109. # ■ Window_BattleStatus
  110. #------------------------------------------------------------------------------
  111. #  バトル画面で、パーティメンバーのステータスを表示するウィンドウです。
  112. #==============================================================================

  113. class Window_J_BattleStatus < Window_J_Selectable
  114.   #--------------------------------------------------------------------------
  115.   # ● オブジェクト初期化
  116.   #--------------------------------------------------------------------------
  117.   def initialize
  118.     super(0, 0, window_width, window_height)
  119.     refresh
  120.     self.openness = 0
  121.   end
  122.   #--------------------------------------------------------------------------
  123.   # ● ウィンドウ幅の取得
  124.   #--------------------------------------------------------------------------
  125.   def item_width
  126.     base_contents_width / visible_line_number
  127.   end
  128.   #--------------------------------------------------------------------------
  129.   # ● ウィンドウ幅の取得
  130.   #--------------------------------------------------------------------------
  131.   def window_width
  132.     Graphics.width - 128
  133.   end
  134.   #--------------------------------------------------------------------------
  135.   # ● ウィンドウ高さの取得
  136.   #--------------------------------------------------------------------------
  137.   def window_height
  138.     fitting_height(visible_line_number)
  139.   end
  140.   #--------------------------------------------------------------------------
  141.   # ● 表示行数の取得
  142.   #--------------------------------------------------------------------------
  143.   def visible_line_number
  144.     return 4
  145.   end
  146.   #--------------------------------------------------------------------------
  147.   # ● 項目数の取得
  148.   #--------------------------------------------------------------------------
  149.   def item_max
  150.     $game_party.battle_members.size
  151.   end
  152.   #--------------------------------------------------------------------------
  153.   # ● HP/MP/TPの行の高さ取得
  154.   #--------------------------------------------------------------------------
  155.   def gauge_line_height
  156.     return 18
  157.   end
  158.   #--------------------------------------------------------------------------
  159.   # ● 横に項目が並ぶときの空白の幅を取得
  160.   #--------------------------------------------------------------------------
  161.   def spacing
  162.     return 0
  163.   end
  164.   #--------------------------------------------------------------------------
  165.   # ● リフレッシュ
  166.   #--------------------------------------------------------------------------
  167.   def refresh
  168.     contents.clear
  169.     draw_all_items
  170.   end
  171.   #--------------------------------------------------------------------------
  172.   # ● 項目の描画
  173.   #--------------------------------------------------------------------------
  174.   def draw_item(index)
  175.     actor = $game_party.battle_members[index]
  176.     draw_basic_area(basic_area_rect(index), actor)
  177.     draw_gauge_area(gauge_area_rect(index), actor)
  178.   end
  179.   #--------------------------------------------------------------------------
  180.   # ● 基本エリアの矩形を取得
  181.   #--------------------------------------------------------------------------
  182.   def basic_area_rect(index)
  183.     rect = item_rect(index)
  184.     rect.height -= gauge_area_height
  185.     rect
  186.   end
  187.   #--------------------------------------------------------------------------
  188.   # ● ゲージエリアの矩形を取得
  189.   #--------------------------------------------------------------------------
  190.   def gauge_area_rect(index)
  191.     rect = item_rect(index)
  192.     rect.y += contents_height - gauge_area_height - 8
  193.     rect.height = gauge_area_height
  194.     rect.width -= 24
  195.     rect
  196.   end
  197.   #--------------------------------------------------------------------------
  198.   # ● ルーレットステートの描画矩形
  199.   #--------------------------------------------------------------------------
  200.   def rst_area_rect(index)
  201.     r= basic_area_rect(index)
  202.     Rect.new(r.x+r.width-24, contents_height - 24, 24, 24)
  203.   end
  204.   #--------------------------------------------------------------------------
  205.   # ● ゲージエリアの高さを取得
  206.   #--------------------------------------------------------------------------
  207.   def gauge_area_height
  208.     return (gauge_line_height * ($data_system.opt_display_tp ? 3 : 2))
  209.   end
  210.   #--------------------------------------------------------------------------
  211.   # ● 基本エリアの描画
  212.   #--------------------------------------------------------------------------
  213.   def draw_basic_area(rect, actor)
  214.     draw_actor_face(actor, rect.x+2, rect.y+2, !actor.dead?)
  215.     x = rect.x + rect.width - line_width
  216.     draw_actor_name(actor, x, rect.y, item_height)
  217.     draw_roulet_st(actor, actor.index)
  218.   end
  219.   #--------------------------------------------------------------------------
  220.   # ● ゲージエリアの描画
  221.   #--------------------------------------------------------------------------
  222.   def draw_gauge_area(rect, actor)
  223.     if $data_system.opt_display_tp
  224.       draw_gauge_area_with_tp(rect, actor)
  225.     else
  226.       draw_gauge_area_without_tp(rect, actor)
  227.     end
  228.   end
  229.   #--------------------------------------------------------------------------
  230.   # ● ゲージエリアの描画(TP あり)
  231.   #--------------------------------------------------------------------------
  232.   def draw_gauge_area_with_tp(rect, actor)
  233.     @jmode = false
  234.     draw_actor_hp(actor, rect.x, rect.y + gauge_line_height * 0, rect.width)
  235.     draw_actor_mp(actor, rect.x, rect.y + gauge_line_height * 1, rect.width)
  236.     draw_actor_tp(actor, rect.x, rect.y + gauge_line_height * 2, rect.width)
  237.     @jmode = true
  238.   end
  239.   #--------------------------------------------------------------------------
  240.   # ● ゲージエリアの描画(TP なし)
  241.   #--------------------------------------------------------------------------
  242.   def draw_gauge_area_without_tp(rect, actor)
  243.     @jmode = false
  244.     draw_actor_hp(actor, rect.x, rect.y + gauge_line_height * 1, rect.width)
  245.     draw_actor_mp(actor, rect.x, rect.y + gauge_line_height * 2, rect.width)
  246.     @jmode = true
  247.   end
  248.   #--------------------------------------------------------------------------
  249.   # ● 名前の描画
  250.   #--------------------------------------------------------------------------
  251.   def draw_actor_name(actor, x, y, height = 112)
  252.     change_color(hp_color(actor))
  253.     draw_text(x, y, line_width, height, actor.name)
  254.   end
  255.   #--------------------------------------------------------------------------
  256.   # ● アクターの顔グラフィック描画
  257.   #--------------------------------------------------------------------------
  258.   def draw_actor_face(actor, x, y, enabled = true)
  259.     bitmap = Cache.face(actor.face_name)
  260.     rect = Rect.new(actor.face_index % 4 * 96 + 14, actor.face_index / 4 * 96 + 30, 96-26, 32)
  261.     contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
  262.     bitmap.dispose
  263.   end
  264.   #--------------------------------------------------------------------------
  265.   # ● ルーレットステート描画
  266.   #--------------------------------------------------------------------------
  267.   def draw_roulet_st(actor, index)
  268.     return if actor.r_st.icon_index == 0
  269.     rect = rst_area_rect(index)
  270.     draw_icon(actor.r_st.icon_index, rect.x, rect.y)
  271.   end
  272.   #--------------------------------------------------------------------------
  273.   # ● ルーレットステート再描画
  274.   #--------------------------------------------------------------------------
  275.   def redraw_roulet_st(actor, index)
  276.     contents.clear_rect(rst_area_rect(index))
  277.     draw_roulet_st(actor, index)
  278.   end
  279.   #--------------------------------------------------------------------------
  280.   # ● フレーム更新
  281.   #--------------------------------------------------------------------------
  282.   def update
  283.     super
  284.     $game_party.battle_members.each do |actor|
  285.       redraw_roulet_st(actor, actor.index) if actor.r_st.update(actor)
  286.     end
  287.   end
  288. end


  289. #==============================================================================
  290. # ■ Window_J_BattleActor
  291. #------------------------------------------------------------------------------
  292. #  バトル画面で、行動対象のアクターを選択するウィンドウです。
  293. #==============================================================================

  294. class Window_J_BattleActor < Window_J_BattleStatus
  295.   #--------------------------------------------------------------------------
  296.   # ● オブジェクト初期化
  297.   #     info_viewport : 情報表示用ビューポート
  298.   #--------------------------------------------------------------------------
  299.   def initialize(info_viewport)
  300.     super()
  301.     self.y = info_viewport.rect.y
  302.     self.visible = false
  303.     self.openness = 255
  304.     @info_viewport = info_viewport
  305.   end
  306.   #--------------------------------------------------------------------------
  307.   # ● ウィンドウの表示
  308.   #--------------------------------------------------------------------------
  309.   def show
  310.     if @info_viewport
  311.       width_remain = Graphics.width - width
  312.       self.x = width_remain
  313.       @info_viewport.rect.width = width_remain
  314.       select(0)
  315.     end
  316.     super
  317.   end
  318.   #--------------------------------------------------------------------------
  319.   # ● ウィンドウの非表示
  320.   #--------------------------------------------------------------------------
  321.   def hide
  322.     @info_viewport.rect.width = Graphics.width if @info_viewport
  323.     super
  324.   end
  325. end


  326. #==============================================================================
  327. # ■ Window_J_PartyCommand
  328. #------------------------------------------------------------------------------
  329. #  バトル画面で、戦うか逃げるかを選択するウィンドウです。
  330. #==============================================================================

  331. class Window_J_PartyCommand < Window_J_Command
  332.   #--------------------------------------------------------------------------
  333.   # ● オブジェクト初期化
  334.   #--------------------------------------------------------------------------
  335.   def initialize
  336.     super(0, 0)
  337.     self.openness = 0
  338.     deactivate
  339.   end
  340.   #--------------------------------------------------------------------------
  341.   # ● ウィンドウ幅の取得
  342.   #--------------------------------------------------------------------------
  343.   def window_width
  344.     fitting_width(visible_line_number)
  345.   end
  346.   #--------------------------------------------------------------------------
  347.   # ● ウィンドウ高さの取得
  348.   #--------------------------------------------------------------------------
  349.   def window_height
  350.     fitting_width(4)
  351.   end
  352.   #--------------------------------------------------------------------------
  353.   # ● 表示行数の取得
  354.   #--------------------------------------------------------------------------
  355.   def visible_line_number
  356.     return 2
  357.   end
  358.   #--------------------------------------------------------------------------
  359.   # ● コマンドリストの作成
  360.   #--------------------------------------------------------------------------
  361.   def make_command_list
  362.     add_command(Vocab::fight,  :fight)
  363.     add_command(Vocab::escape, :escape, BattleManager.can_escape?)
  364.   end
  365.   #--------------------------------------------------------------------------
  366.   # ● セットアップ
  367.   #--------------------------------------------------------------------------
  368.   def setup
  369.     clear_command_list
  370.     make_command_list
  371.     refresh
  372.     select(0)
  373.     activate
  374.     open
  375.   end
  376. end


  377. #==============================================================================
  378. # ■ Window_J_ActorCommand
  379. #------------------------------------------------------------------------------
  380. #  バトル画面で、アクターの行動を選択するウィンドウです。
  381. #==============================================================================

  382. class Window_J_ActorCommand < Window_J_Command
  383.   #--------------------------------------------------------------------------
  384.   # ● オブジェクト初期化
  385.   #--------------------------------------------------------------------------
  386.   def initialize
  387.     super(0, 0)
  388.     self.openness = 0
  389.     deactivate
  390.     @actor = nil
  391.   end
  392.   #--------------------------------------------------------------------------
  393.   # ● ウィンドウ幅の取得
  394.   #--------------------------------------------------------------------------
  395.   def window_width
  396.     fitting_width(visible_line_number)
  397.   end
  398.   #--------------------------------------------------------------------------
  399.   # ● ウィンドウ高さの取得
  400.   #--------------------------------------------------------------------------
  401.   def window_height
  402.     fitting_width(4)
  403.   end
  404.   #--------------------------------------------------------------------------
  405.   # ● 表示行数の取得
  406.   #--------------------------------------------------------------------------
  407.   def visible_line_number
  408.     return 4
  409.   end
  410.   #--------------------------------------------------------------------------
  411.   # ● コマンドリストの作成
  412.   #--------------------------------------------------------------------------
  413.   def make_command_list
  414.     return unless @actor
  415.     add_attack_command
  416.     add_skill_commands
  417.     add_guard_command
  418.     add_item_command
  419.   end
  420.   #--------------------------------------------------------------------------
  421.   # ● 攻撃コマンドをリストに追加
  422.   #--------------------------------------------------------------------------
  423.   def add_attack_command
  424.     add_command(Vocab::attack, :attack, @actor.attack_usable?)
  425.   end
  426.   #--------------------------------------------------------------------------
  427.   # ● スキルコマンドをリストに追加
  428.   #--------------------------------------------------------------------------
  429.   def add_skill_commands
  430.     @actor.added_skill_types.sort.each do |stype_id|
  431.       name = $data_system.skill_types[stype_id]
  432.       add_command(name, :skill, true, stype_id)
  433.     end
  434.   end
  435.   #--------------------------------------------------------------------------
  436.   # ● 防御コマンドをリストに追加
  437.   #--------------------------------------------------------------------------
  438.   def add_guard_command
  439.     add_command(Vocab::guard, :guard, @actor.guard_usable?)
  440.   end
  441.   #--------------------------------------------------------------------------
  442.   # ● アイテムコマンドをリストに追加
  443.   #--------------------------------------------------------------------------
  444.   def add_item_command
  445.     add_command(Vocab::item, :item)
  446.   end
  447.   #--------------------------------------------------------------------------
  448.   # ● セットアップ
  449.   #--------------------------------------------------------------------------
  450.   def setup(actor)
  451.     @actor = actor
  452.     clear_command_list
  453.     make_command_list
  454.     refresh
  455.     select(0)
  456.     activate
  457.     open
  458.   end
  459. end


  460. #==============================================================================
  461. # ■ Window_BattleSkill
  462. #------------------------------------------------------------------------------
  463. #  バトル画面で、使用するスキルを選択するウィンドウです。
  464. #==============================================================================

  465. class Window_J_BattleSkill < Window_J_SkillList
  466.   #--------------------------------------------------------------------------
  467.   # ● オブジェクト初期化
  468.   #     info_viewport : 情報表示用ビューポート
  469.   #--------------------------------------------------------------------------
  470.   def initialize(help_window, info_viewport)
  471.     y = help_window.height
  472.     super(0, y, Graphics.width, info_viewport.rect.y - y)
  473.     self.visible = false
  474.     @help_window = help_window
  475.     @info_viewport = info_viewport
  476.   end
  477.   #--------------------------------------------------------------------------
  478.   # ● ウィンドウの表示
  479.   #--------------------------------------------------------------------------
  480.   def show
  481.     select_last
  482.     @help_window.show
  483.     super
  484.   end
  485.   #--------------------------------------------------------------------------
  486.   # ● ウィンドウの非表示
  487.   #--------------------------------------------------------------------------
  488.   def hide
  489.     @help_window.hide
  490.     super
  491.   end
  492. end


  493. #==============================================================================
  494. # ■ Window_J_BattleItem
  495. #------------------------------------------------------------------------------
  496. #  バトル画面で、使用するアイテムを選択するウィンドウです。
  497. #==============================================================================

  498. class Window_J_BattleItem < Window_J_ItemList
  499.   #--------------------------------------------------------------------------
  500.   # ● オブジェクト初期化
  501.   #     info_viewport : 情報表示用ビューポート
  502.   #--------------------------------------------------------------------------
  503.   def initialize(help_window, info_viewport)
  504.     y = help_window.height
  505.     super(0, y, Graphics.width, info_viewport.rect.y - y)
  506.     self.visible = false
  507.     @help_window = help_window
  508.     @info_viewport = info_viewport
  509.   end
  510.   #--------------------------------------------------------------------------
  511.   # ● 桁数の取得
  512.   #--------------------------------------------------------------------------
  513.   def col_max
  514.     return 1
  515.   end
  516.   #--------------------------------------------------------------------------
  517.   # ● アイテムをリストに含めるかどうか
  518.   #--------------------------------------------------------------------------
  519.   def include?(item)
  520.     $game_party.usable?(item)
  521.   end
  522.   #--------------------------------------------------------------------------
  523.   # ● ウィンドウの表示
  524.   #--------------------------------------------------------------------------
  525.   def show
  526.     select_last
  527.     @help_window.show
  528.     super
  529.   end
  530.   #--------------------------------------------------------------------------
  531.   # ● ウィンドウの非表示
  532.   #--------------------------------------------------------------------------
  533.   def hide
  534.     @help_window.hide
  535.     super
  536.   end
  537. end


  538. #==============================================================================
  539. # ■ Scene_Battle
  540. #------------------------------------------------------------------------------
  541. #  バトル画面の処理を行うクラスです。
  542. #==============================================================================

  543. class Scene_Battle < Scene_Base
  544.   #--------------------------------------------------------------------------
  545.   # ● パーティコマンドウィンドウの作成
  546.   #--------------------------------------------------------------------------
  547.   def create_party_command_window
  548.     @party_command_window = Window_J_PartyCommand.new
  549.     @party_command_window.x = Graphics.width
  550.     @party_command_window.viewport = @info_viewport
  551.     @party_command_window.set_handler(:fight,  method(:command_fight))
  552.     @party_command_window.set_handler(:escape, method(:command_escape))
  553.     @party_command_window.unselect
  554.   end
  555.   #--------------------------------------------------------------------------
  556.   # ● アクターコマンドウィンドウの作成
  557.   #--------------------------------------------------------------------------
  558.   def create_actor_command_window
  559.     @actor_command_window = Window_J_ActorCommand.new
  560.     @actor_command_window.viewport = @info_viewport
  561.     @actor_command_window.set_handler(:attack, method(:command_attack))
  562.     @actor_command_window.set_handler(:skill,  method(:command_skill))
  563.     @actor_command_window.set_handler(:guard,  method(:command_guard))
  564.     @actor_command_window.set_handler(:item,   method(:command_item))
  565.     @actor_command_window.set_handler(:cancel, method(:prior_command))
  566.     @actor_command_window.x = Graphics.width
  567.   end
  568.   #--------------------------------------------------------------------------
  569.   # ● ステータスウィンドウの作成
  570.   #--------------------------------------------------------------------------
  571.   def create_status_window
  572.     @status_window = Window_J_BattleStatus.new
  573.     @status_window.x = 128
  574.   end
  575.   #--------------------------------------------------------------------------
  576.   # ● アクターウィンドウの作成
  577.   #--------------------------------------------------------------------------
  578.   def create_actor_window
  579.     @actor_window = Window_J_BattleActor.new(@info_viewport)
  580.     @actor_window.set_handler(:ok,     method(:on_actor_ok))
  581.     @actor_window.set_handler(:cancel, method(:on_actor_cancel))
  582.   end
  583.   #--------------------------------------------------------------------------
  584.   # ● スキルウィンドウの作成
  585.   #--------------------------------------------------------------------------
  586.   def create_skill_window
  587.     @skill_window = Window_J_BattleSkill.new(@help_window, @info_viewport)
  588.     @skill_window.set_handler(:ok,     method(:on_skill_ok))
  589.     @skill_window.set_handler(:cancel, method(:on_skill_cancel))
  590.   end
  591.   #--------------------------------------------------------------------------
  592.   # ● アイテムウィンドウの作成
  593.   #--------------------------------------------------------------------------
  594.   def create_item_window
  595.     @item_window = Window_J_BattleItem.new(@help_window, @info_viewport)
  596.     @item_window.set_handler(:ok,     method(:on_item_ok))
  597.     @item_window.set_handler(:cancel, method(:on_item_cancel))
  598.   end
  599.   #--------------------------------------------------------------------------
  600.   # ● 情報表示ビューポートの更新
  601.   #--------------------------------------------------------------------------
  602.   def update_info_viewport
  603.     move_info_viewport(@party_command_window.width)  if @party_command_window.active
  604.     move_info_viewport(@actor_command_window.width) if @actor_command_window.active
  605.     move_info_viewport(64)  if BattleManager.in_turn?
  606.   end
  607. end
复制代码



  1. #==============================================================================
  2. # ■ VXAce-RGSS3-31 和風レイアウト <end>          by Claimh
  3. #------------------------------------------------------------------------------
  4. # 終了画面変更
  5. #==============================================================================

  6. #==============================================================================
  7. # ■ Window_GameEnd
  8. #------------------------------------------------------------------------------
  9. #  ゲーム終了画面で、タイトルへ/シャットダウンを選択するウィンドウです。
  10. #==============================================================================

  11. class Window_J_GameEnd < Window_J_Command
  12.   #--------------------------------------------------------------------------
  13.   # ● オブジェクト初期化
  14.   #--------------------------------------------------------------------------
  15.   def initialize
  16.     super(0, 0)
  17.     update_placement
  18.     self.openness = 0
  19.     open
  20.   end
  21.   #--------------------------------------------------------------------------
  22.   # ● ウィンドウ高さの取得
  23.   #--------------------------------------------------------------------------
  24.   def window_height
  25.     return 160
  26.   end
  27.   #--------------------------------------------------------------------------
  28.   # ● ウィンドウ位置の更新
  29.   #--------------------------------------------------------------------------
  30.   def update_placement
  31.     self.x = (Graphics.width - width) / 2
  32.     self.y = (Graphics.height - height) / 2
  33.   end
  34.   #--------------------------------------------------------------------------
  35.   # ● コマンドリストの作成
  36.   #--------------------------------------------------------------------------
  37.   def make_command_list
  38.     add_command(Vocab::to_title, :to_title)
  39.     add_command(Vocab::shutdown, :shutdown)
  40.     add_command(Vocab::cancel,   :cancel)
  41.   end
  42. end


  43. #==============================================================================
  44. # ■ Scene_End
  45. #------------------------------------------------------------------------------
  46. #  ゲーム終了画面の処理を行うクラスです。
  47. #==============================================================================

  48. class Scene_End < Scene_MenuBase
  49.   #--------------------------------------------------------------------------
  50.   # ● コマンドウィンドウの作成
  51.   #--------------------------------------------------------------------------
  52.   def create_command_window
  53.     @command_window = Window_J_GameEnd.new
  54.     @command_window.set_handler(:to_title, method(:command_to_title))
  55.     @command_window.set_handler(:shutdown, method(:command_shutdown))
  56.     @command_window.set_handler(:cancel,   method(:return_scene))
  57.   end
  58. end
复制代码


点评

楼主如果把它汉化就更好了  发表于 2012-7-24 18:59
梦石
0
星屑
124
在线时间
276 小时
注册时间
2008-5-28
回帖
99
发表于 2012-7-22 18:35:34 | 显示全部楼层
横排的叫“菜单”,这竖排的实在不像“菜单”,像科举的金榜
回复

使用道具 举报

梦石
0
星屑
50
在线时间
76 小时
注册时间
2012-7-4
回帖
101
发表于 2012-7-22 19:36:50 | 显示全部楼层
黑衣客 发表于 2012-7-22 18:35
横排的叫“菜单”,这竖排的实在不像“菜单”,像科举的金榜

哈哈     恭喜大侠上榜了!!
回复

使用道具 举报

梦石
0
星屑
45
在线时间
138 小时
注册时间
2011-11-15
回帖
210
发表于 2012-7-28 23:19:12 来自手机 | 显示全部楼层
表示支持,但是竖的菜单添加内容也要重新写了,愁
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部