查看: 1836|回复: 0

[已经解决] 求帮忙,在这个脚本里面添加一个command_window

[复制链接]
梦石
0
星屑
12161
在线时间
4435 小时
注册时间
2014-4-11
回帖
5616

开拓者

发表于 2016-2-17 13:12:21 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 yang1zhi 于 2016-2-17 20:03 编辑

[box=Red]RMB也可以[/box]
这个是个人物扩张脚本。
就是把菜单界面的右边状态栏改了,变成类似人物仓库的
分开参战人物和待机人物。
这些都不是重点,和标题没关系。
###########
要求是在选择人物后出现“选择”
(“移位”,“放生”)
就是添加了个可以把所选择的角色离队了的功能。
##########
目前是按→进入右边人物仓库界面
然后按空格选择第一个角色,再按空格选择第二个角色
进行位置交换

点击展开/收起
  1. # 赠品:人物扩张脚本
  2. # 窗口界面部分来自 桜雅 在土 XRXS26
  3. module BFS_Setting
  4.   # 待机人物是否获得经验
  5.   BACKWARD_EXP_GAINABLE = false
  6.   # 3人以下的时候,菜单是否拉伸大小(建议不要使用)
  7.   MENU_STATUS_STRETCH   = false
  8.   # 进入键
  9.   MENU_MEMBER_CHANGE_KEY_GO    = Input::RIGHT
  10.   # 离开键
  11.   MENU_MEMBER_CHANGE_KEY_END   = Input::LEFT  
  12.   # 可更换角色最小编号
  13.   MENU_MEMBER_CHANGE_INDEX_MIN = 0
  14.   # 不能待机的角色编号
  15.   FORCETOBATTLE_ACTORS         = []  
  16.   # 不能加入战斗的角色编号
  17.   UMBATTLABLE_ACTORS           = []   
  18.   # 不能移动的角色编号
  19.   UNMOVABLE_ACTORS             = []
  20.   # 列数
  21.   COLUMN_MAX = 2
  22.   # 光标高度
  23.   CURSOR_HEIGHT = 96
  24.   # 一行的高度
  25.   LINE_HEIGHT = 116
  26. end
  27. class Game_Temp
  28.   attr_accessor :friends_need_refresh
  29.   alias rwkz_ini initialize
  30.   def initialize
  31.     rwkz_ini
  32.     @friend_need_refresh = false
  33.   end
  34. end
  35. class Scene_Map
  36.   alias rwkz_main main
  37.   def main
  38.     if $game_temp.friends_need_refresh
  39.       BFS_Friends.delete_all_friends
  40.       BFS_Friends.prepare_for_transferring
  41.       $game_temp.friends_need_refresh = false
  42.     end
  43.     rwkz_main
  44.   end   
  45. end
  46. class Game_Party
  47.   attr_accessor :waiting_actors
  48.   
  49.   
  50.   def gain_exp(exp)
  51.     for i in 0...$game_party.actors.size
  52.       actor = $game_party.actors[i]
  53.       if actor.cant_get_exp? == false
  54.         actor.exp += exp
  55.       end
  56.     end
  57.     if BFS_Setting::BACKWARD_EXP_GAINABLE
  58.       for i in 0...$game_party.waiting_actors.size
  59.         actor = $game_party.waiting_actors[i]
  60.         if actor.cant_get_exp? == false
  61.           actor.exp += exp
  62.         end
  63.       end
  64.     end
  65.   end
  66.     def refresh_fbs
  67.     return if @actors.size == $game_variables[1]
  68.     # 活动队伍数量增加时
  69.     if @actors.size < $game_variables[1]
  70.       change_size = (@actors.size - $game_variables[1]).abs
  71.       # 把等待队伍开头的角色塞进活动队伍
  72.       for i in 0...change_size
  73.         if @waiting_actors != []
  74.           break if @waiting_actors.size < 1
  75.           waiting_leader = @waiting_actors[0]
  76.           @waiting_actors.delete_at(0)
  77.           @actors.push(waiting_leader)
  78.         end
  79.       end
  80.       # BFS刷新
  81.               $game_temp.friends_need_refresh = true
  82.         $game_party.friend_party_update
  83.         # プレイヤーをリフレッシュ
  84.         $game_player.refresh
  85.         # ステータスウィンドウをリフレッシュ

  86.       friend_party_update
  87.    #   $scene.spriteset.dispose
  88. #      $scene.spriteset = Spriteset_Map.new
  89.       BFS_Friends.weapon_recheck
  90.       $scene = Scene_Map.new
  91.     # 活动中的角色数量减少时
  92.     else
  93.       change_size = (@actors.size - $game_variables[1]).abs
  94.       for i in 0...change_size
  95.         break if @actors.size < 2
  96.         to_wait_actor = @actors.pop
  97.         @waiting_actors.insert(0, to_wait_actor)
  98.       end
  99.       # FBS刷新
  100.       friend_party_update
  101.       BFS_Friends.delete_all_friends
  102.       BFS_Friends.prepare_for_transferring
  103.       $game_player.refresh
  104.       $scene.spriteset.dispose
  105.       $scene.spriteset = Spriteset_Map.new
  106.       $scene.hud_update
  107.     end
  108.   end

  109.   
  110.   
  111.   alias rk initialize
  112.   def initialize
  113.     rk
  114.     @waiting_actors = []
  115.   end
  116.   def remove_actor(actor_id)
  117.     if @actors.size == 1
  118. #     p "数据库中的角色数量会变为0,为了游戏的正常运行,请不要这样做。"
  119. #     p "因此,系统可能会忽略此次操作,见谅"
  120. #     p "如有特殊情况,请在脚本中删除这段文字"
  121.       return
  122.     end
  123.     switch_leader if actor_id == $game_party.actors[0].id
  124.     if @actors.include?($game_actors[actor_id])
  125.       @actors.delete($game_actors[actor_id])
  126.                   
  127.       if @waiting_actors != []
  128.         waiting_leader = @waiting_actors[0]
  129.         @waiting_actors.delete_at(0)
  130.         @actors.push(waiting_leader)
  131.       end
  132.     else
  133.       if @waiting_actors.include?($game_actors[actor_id])
  134.         @waiting_actors.delete($game_actors[actor_id])
  135.       else
  136.         return
  137.       end
  138.     end
  139.     friend_party_update
  140.     BFS_Friends.delete_all_friends
  141.     BFS_Friends.prepare_for_transferring
  142.     $game_player.refresh
  143.     $scene.spriteset.dispose
  144.     $scene.spriteset = Spriteset_Map.new
  145.     $scene.hud_update
  146.   end
  147.   def add_actor(actor_id)
  148.     actor = $game_actors[actor_id]
  149.     unless @actors.include?(actor) or @waiting_actors.include?(actor)
  150.       if @actors.size < $game_variables[1]
  151.         @actors.push(actor)
  152.         $game_player.refresh
  153.         friend_party_update
  154.         BFS_Friends.add(actor_id)
  155.         $scene.spriteset.dispose
  156.         $scene.spriteset = Spriteset_Map.new
  157.         BFS_Friends.weapon_recheck
  158.       else
  159.         if @waiting_actors.size < $game_variables[2]
  160.           @waiting_actors.push(actor)
  161.         end
  162.       end
  163.     end
  164.               $duiwu_jsm = $game_party.actors.collect{|actor| actor.name}

  165.   end
  166. end
  167. #==============================================================================
  168. # --- XRXS. 第二カーソル 機構 ---
  169. #------------------------------------------------------------------------------
  170. #     ウィンドウに .index2 プロパティを追加します。
  171. #==============================================================================
  172. module XRXS_Cursor2
  173.   #--------------------------------------------------------------------------
  174.   # ● オブジェクト初期化
  175.   #--------------------------------------------------------------------------
  176.   def initialize(x, y, w, h)
  177.     super(x, y, h, w)
  178.     # 補助ウィンドウ(透明)を作成:カーソル専用
  179.     @xrxsc2_window = Window_Selectable.new(self.x, self.y, self.width, self.height)
  180.     @xrxsc2_window.opacity = 0
  181.     @xrxsc2_window.active = false
  182.     @xrxsc2_window.index = -1
  183.   end
  184.   #--------------------------------------------------------------------------
  185.   # ○ 第二カーソルの設置
  186.   #--------------------------------------------------------------------------
  187.   def index2
  188.     return @xrxsc2_window.index
  189.   end
  190.   def index2=(index)
  191.     @xrxsc2_window.index = index
  192.     if index == -1
  193.       @xrxsc2_window.cursor_rect.empty
  194.     else
  195.       @xrxsc2_window.x = self.x
  196.       @xrxsc2_window.y = self.y
  197.       @xrxsc2_window.cursor_rect = self.cursor_rect
  198.     end
  199.   end
  200.   #--------------------------------------------------------------------------
  201.   # ○ 先頭の行の設定
  202.   #--------------------------------------------------------------------------
  203.   def top_row=(row)
  204.     super
  205.     # 補助ウィンドウの oy を更新
  206.     pre_oy = @xrxsc2_window.oy
  207.     @xrxsc2_window.oy = self.oy
  208.     @xrxsc2_window.cursor_rect.y -= self.oy - pre_oy
  209.   end
  210.   #--------------------------------------------------------------------------
  211.   # ○ 解放
  212.   #--------------------------------------------------------------------------
  213.   def dispose
  214.     @xrxsc2_window.dispose
  215.     super
  216.   end
  217.   #--------------------------------------------------------------------------
  218.   # ○ X, Y 座標
  219.   #--------------------------------------------------------------------------
  220.   def x=(n)
  221.     super
  222.     @xrxsc2_window.x = self.x unless @xrxsc2_window.nil?
  223.   end
  224.   def y=(n)
  225.     super
  226.     @xrxsc2_window.y = self.y unless @xrxsc2_window.nil?
  227.   end
  228. end
  229. # ▼▲▼ XRXS26AX. +入れ替えメニュー ver.2 ▼▲▼ built 081113
  230. # by 桜雅 在土

  231. #==============================================================================
  232. # ■ Window_MenuStatus
  233. #==============================================================================
  234. class Window_MenuStatus < Window_Selectable
  235.   #--------------------------------------------------------------------------
  236.   # ○ インクルード
  237.   #--------------------------------------------------------------------------
  238.   include XRXS_Cursor2
  239.   #--------------------------------------------------------------------------
  240.   # ● 公開インスタンス変数
  241.   #--------------------------------------------------------------------------
  242.   attr_reader   :column_max             # 列数
  243.   #--------------------------------------------------------------------------
  244.   # ● オブジェクト初期化
  245.   #--------------------------------------------------------------------------
  246.   def initialize
  247.     h = 480
  248.     if MENU_STATUS_STRETCH
  249.       h = $game_variables[1] * 116 + 16
  250.     end
  251.     super(0, 0, 480, h)
  252.     h = ($game_party.actors.size - 1) * LINE_HEIGHT + CURSOR_HEIGHT
  253.     self.contents = Bitmap.new(width - 32, h)
  254.     self.active = false
  255.     self.index = -1
  256.   end
  257.   #--------------------------------------------------------------------------
  258.   # ○ 1 ページに表示できる行数の取得
  259.   #--------------------------------------------------------------------------
  260.   def page_row_max
  261.     if MENU_STATUS_STRETCH
  262.       return $game_variables[1]          # 戦闘パーティ最大数
  263.     else
  264.       return [$game_variables[1], 4].max # 戦闘パーティ最大数(最低4)
  265.     end
  266.   end
  267.   #--------------------------------------------------------------------------
  268.   # ○ 先頭の行の取得
  269.   #--------------------------------------------------------------------------
  270.   def top_row
  271.     # ウィンドウ内容の転送元 Y 座標を、1 行の高さ LINE_HEIGHT で割る
  272.     return self.oy / LINE_HEIGHT
  273.   end
  274.   #--------------------------------------------------------------------------
  275.   # ○ 先頭の行の設定
  276.   #--------------------------------------------------------------------------
  277.   def top_row=(row)
  278.     super
  279.     self.oy = self.oy/32 * LINE_HEIGHT
  280.   end
  281.   #--------------------------------------------------------------------------
  282.   # ● カーソルの矩形更新
  283.   #--------------------------------------------------------------------------
  284.   def update_cursor_rect
  285.     super
  286.     unless @index < 0
  287.       y = (self.cursor_rect.y + self.oy) * LINE_HEIGHT/32 - self.oy
  288.       self.cursor_rect.set(0, y, self.cursor_rect.width, CURSOR_HEIGHT)
  289.     end
  290.   end
  291. end
  292. #==============================================================================
  293. # ■ Scene_Menu
  294. #==============================================================================
  295. class Scene_Menu
  296.   include BFS_Setting
  297.   #--------------------------------------------------------------------------
  298.   # ● フレーム更新
  299.   #--------------------------------------------------------------------------
  300.   alias xrxs26ax_update update
  301.   def update
  302.     # インデックスを保存
  303.     @status_index = @status_window.index
  304.     # 呼び戻す
  305.     xrxs26ax_update
  306.   end
  307.   #--------------------------------------------------------------------------
  308.   # ● フレーム更新 (コマンドウィンドウがアクティブの場合)
  309.   #--------------------------------------------------------------------------
  310.   alias xrxs26ax_update_command update_command
  311.   def update_command
  312.     # 呼び戻す
  313.     xrxs26ax_update_command
  314.     # 入れ替え移行キーが押されたとき、@command_window.indexが設定値以上
  315.     if Input.trigger?(MENU_MEMBER_CHANGE_KEY_GO) and
  316.        @command_window.index >= MENU_MEMBER_CHANGE_INDEX_MIN
  317.        $game_variables[5] = 2
  318.        if $game_map.map_id  == 6
  319.       # 決定 SE を演奏
  320.       $game_system.se_play($data_system.decision_se)
  321.       # カーソル位置を記憶
  322.       @command_index_before_menu_member_change = @command_window.index
  323.             # 入れ替えウィンドウへ移行
  324.       @command_window.active = false
  325.       @command_window.index = -1
  326.       @status_window.active = true
  327.       @status_window.index = 0

  328.     else
  329.     end
  330.     end
  331.   end
  332.   #--------------------------------------------------------------------------
  333.   # ● フレーム更新 (ステータスウィンドウがアクティブの場合)
  334.   #--------------------------------------------------------------------------
  335.   alias xrxs26ax_update_status update_status
  336.   def update_status
  337.     # 呼び戻す
  338.     if @command_window.index != -1
  339.       xrxs26ax_update_status
  340.       return
  341.     end
  342.     # B ボタンか入れ替え終了キーが押されたとき
  343.     if ((Input.trigger?(Input::B) or Input.trigger?(MENU_MEMBER_CHANGE_KEY_END)) and
  344.         @status_window.index2 == -1 and
  345.         @status_index%@status_window.column_max == 0)
  346.         $game_variables[5] = 1
  347.       # キャンセル SE を演奏
  348.       $game_system.se_play($data_system.cancel_se)
  349.       # コマンドウィンドウをアクティブにする
  350.       @command_window.active = true
  351.       @command_window.index = 0
  352.       @status_window.active = false
  353.       @status_window.index = -1
  354.       return
  355.     end
  356.     # B ボタンが押されたとき
  357.     if Input.trigger?(Input::B) and @status_window.index2 >= 0
  358.       @status_window.index = @status_window.index2
  359.       @status_window.index2 = -1
  360.       return
  361.     end
  362.     # 決定キーが押されたとき
  363.     if Input.trigger?(Input::C)
  364.        if @status_window.index2 == -1
  365.         if UNMOVABLE_ACTORS.include?(@status_window.all_actors[@status_window.index].id)
  366.           # ブザー SE を演奏
  367.           $game_system.se_play($data_system.buzzer_se)
  368.           return
  369.         end
  370.         # 決定 SE を演奏
  371.         $game_system.se_play($data_system.decision_se)
  372.         # メンバーの入れ替え一人目の決定
  373.         @status_window.index2 = @status_window.index
  374.       else
  375.         if UNMOVABLE_ACTORS.include?(@status_window.all_actors[@status_window.index].id)
  376.           # ブザー SE を演奏
  377.           $game_system.se_play($data_system.buzzer_se)
  378.           return
  379.         end
  380.         # どちらかが戦闘メンバー かつ どちらかが戦闘禁止アクター の場合
  381.         if (@status_window.index < $game_variables[1] or
  382.             @status_window.index2 < $game_variables[1]) and
  383.            (UMBATTLABLE_ACTORS.include?(@status_window.all_actors[@status_window.index].id) or
  384.             UMBATTLABLE_ACTORS.include?(@status_window.all_actors[@status_window.index2].id))
  385.           # ブザー SE を演奏
  386.           $game_system.se_play($data_system.buzzer_se)
  387.           return
  388.         end
  389.         # どちらかが待機メンバー かつ どちらかが待機禁止アクター の場合
  390.         if (@status_window.index >= $game_variables[1] or
  391.             @status_window.index2 >= $game_variables[1]) and
  392.            (FORCETOBATTLE_ACTORS.include?(@status_window.all_actors[@status_window.index].id) or
  393.             FORCETOBATTLE_ACTORS.include?(@status_window.all_actors[@status_window.index2].id))
  394.           # ブザー SE を演奏
  395.           $game_system.se_play($data_system.buzzer_se)
  396.           return
  397.         end
  398.         # 決定 SE を演奏
  399.         $game_system.se_play($data_system.decision_se)
  400.         # メンバーの入れ替え二人目の決定と入れ替えの実行
  401.         actor2 = @status_window.all_actors[@status_window.index]
  402.         actor = @status_window.all_actors[@status_window.index2]
  403.         @status_window.all_actors[@status_window.index2] = actor2
  404.         @status_window.all_actors[@status_window.index] = actor
  405.         $game_party.actors.clear
  406.         $game_party.waiting_actors.clear
  407.         for i in [email]0...@status_window.all_actors.size[/email]
  408.           if i < $game_variables[1]
  409.             $game_party.actors.push(@status_window.all_actors[i])
  410.           else
  411.             $game_party.waiting_actors.push(@status_window.all_actors[i])
  412.           end
  413.         end
  414.         $game_temp.friends_need_refresh = true
  415.         @status_window.index = @status_window.index2
  416.         @status_window.index2 = -1
  417.         $game_party.friend_party_update
  418.         # プレイヤーをリフレッシュ
  419.         $game_player.refresh
  420.         # ステータスウィンドウをリフレッシュ
  421.         @status_window.refresh
  422.         $game_party.refresh_fbs
  423.       end
  424.       return
  425.           end   
  426. end
  427.   end
  428. #==============================================================================
  429. # ■ Window_MenuStatus
  430. #==============================================================================
  431. class Window_MenuStatus < Window_Selectable
  432.   #--------------------------------------------------------------------------
  433.   # ○ インクルード
  434.   #--------------------------------------------------------------------------
  435.   include BFS_Setting
  436.   #--------------------------------------------------------------------------
  437.   # ● 公開インスタンス変数
  438.   #--------------------------------------------------------------------------
  439.   attr_reader   :newitem_window
  440.   attr_reader   :all_actors
  441.   attr_reader   :bottomkeyhelp_window
  442.   #--------------------------------------------------------------------------
  443.   # ● オブジェクト初期化
  444.   #--------------------------------------------------------------------------
  445.   alias xrxs26bx_initialize initialize
  446.   def initialize
  447.     # 呼び戻す
  448.     xrxs26bx_initialize
  449.     # 寄生してウィンドウを作成
  450.     # ボトルキーヘルプウィンドウ
  451.     @bottomkeyhelp_window = Window_BottomKeyHelp.new
  452.     @bottomkeyhelp_window.visible = false
  453.     # 設定変更
  454.     self.height   = 448
  455.     self.contents = Bitmap.new(width - 32, height - 32)
  456.     @all_actors = $game_party.actors + $game_party.waiting_actors
  457.     refresh
  458.   end
  459.   #--------------------------------------------------------------------------
  460.   # ● リフレッシュ
  461.   #--------------------------------------------------------------------------
  462.   def refresh
  463.     self.contents.clear
  464.     @item_max = @all_actors.size
  465.     @column_max = 2
  466.     y = ($game_variables[1]+1)/2 * 64 + 28
  467.     self.contents.font.size = 16
  468.     self.contents.font.color = system_color
  469.     self.contents.draw_text(4, 0, 92, 28, "参战")
  470.     self.contents.draw_text(4, y, 92, 28, "休息")
  471.     for i in [email]0...@all_actors.size[/email]
  472.       x = 64 + i%2 * 224
  473.       y = i/2 *  72 + 24
  474.       actor = @all_actors[i]
  475.       if i >= $game_variables[1]
  476.         y += 32
  477.         self.contents.font.color = disabled_color
  478.         self.contents.draw_text(x, y, 120, 32, actor.name)
  479.       else
  480.         draw_actor_name(actor   , x     , y     )
  481.       end
  482.       draw_actor_graphic(actor, x - 40, y + 64)
  483.       draw_actor_level(actor  , x + 94, y     )
  484.       draw_actor_hp(actor     , x, y + 16)
  485.       draw_actor_sp(actor     , x, y + 32)
  486.       draw_actor_state(actor  , x, y + 48)
  487.     end
  488.   end
  489.   #--------------------------------------------------------------------------
  490.   # ○ フレーム更新
  491.   #--------------------------------------------------------------------------
  492.   def update
  493.     # ウィンドウを更新
  494.     @bottomkeyhelp_window.update
  495.     super
  496.   end
  497.   #--------------------------------------------------------------------------
  498.   # ○ 解放
  499.   #--------------------------------------------------------------------------
  500.   def dispose
  501.     @bottomkeyhelp_window.dispose
  502.     super
  503.   end
  504.   #--------------------------------------------------------------------------
  505.   # ● カーソルの矩形更新
  506.   #--------------------------------------------------------------------------
  507.   def update_cursor_rect
  508.           if $game_variables[5] == 2
  509.     if @index < 0
  510.       self.cursor_rect.empty
  511.     else
  512.               y = @index/2 * 72 + 28
  513.       if @index >= $game_variables[1]
  514.         y += 32
  515.       end
  516.                       self.cursor_rect.set(@index%2 * 224, y, 224, 72)
  517.                       end

  518.                     end
  519.       if $game_variables[5] == 1
  520.                           if @index < 0
  521.       self.cursor_rect.empty
  522.     else
  523.                   y = @index/2 * 72 + 28
  524.             if @index > $game_variables[1]-1
  525.         @index = 0

  526.       end
  527.                 self.cursor_rect.set(@index%2 * 224, y, 224, 72)


  528.     end
  529.     end
  530.   end
  531. end
  532. #==============================================================================
  533. # ■ Scene_Menu
  534. #==============================================================================
  535. class Scene_Menu
  536.   #--------------------------------------------------------------------------
  537.   # ● フレーム更新
  538.   #--------------------------------------------------------------------------
  539.   alias xrxs26bx_update update
  540.   def update
  541.     # 登録
  542.     if @bottomkeyhelp_window.nil?
  543.       @bottomkeyhelp_window = @status_window.bottomkeyhelp_window
  544.       @bottomkeyhelp_window.visible = true
  545.       set_keyhelp1
  546.     end
  547.     # 呼び戻す
  548.     xrxs26bx_update
  549.   end
  550.   #--------------------------------------------------------------------------
  551.   # ● フレーム更新 (コマンドウィンドウがアクティブの場合)
  552.   #--------------------------------------------------------------------------
  553.   alias xrxs26bx_update_command update_command
  554.   def update_command
  555.     # 呼び戻す
  556.     xrxs26bx_update_command
  557.     # 入れ替え移行キーが押されたとき
  558.     if @command_window.index == -1 and @status_window.active
  559.       set_keyhelp2
  560.     end
  561.   end
  562.   #--------------------------------------------------------------------------
  563.   # ● フレーム更新 (ステータスウィンドウがアクティブの場合)
  564.   #--------------------------------------------------------------------------
  565.   alias xrxs26bx_update_status update_status
  566.   def update_status
  567.     # 保存
  568.     last_index = @status_window.index2
  569.     # 呼び戻す
  570.     xrxs26bx_update_status
  571.     #
  572.     if last_index != @status_window.index2
  573.       # 一人目を選択した場合
  574.       if @status_window.index2 >= 0
  575.         set_keyhelp3
  576.       else
  577.         set_keyhelp2
  578.       end
  579.     end
  580.     # 戻った場合
  581.     unless @status_window.active
  582.       set_keyhelp1
  583.     end
  584.   end
  585.   #--------------------------------------------------------------------------
  586.   # ○ キーヘルプを設定 1
  587.   #--------------------------------------------------------------------------
  588.   def set_keyhelp1
  589.     @bottomkeyhelp_window.clear
  590.     @bottomkeyhelp_window.add("B","关闭本窗口")
  591.     @bottomkeyhelp_window.add("C","确定")
  592.     @bottomkeyhelp_window.add("→","人物顺序调整")
  593.   end
  594.   #--------------------------------------------------------------------------
  595.   # ○ キーヘルプを設定 2
  596.   #--------------------------------------------------------------------------
  597.   def set_keyhelp2
  598.     @bottomkeyhelp_window.clear
  599.     @bottomkeyhelp_window.add("←,B","返回")
  600.     @bottomkeyhelp_window.add("C","第一个人物确定")
  601.   end
  602.   #--------------------------------------------------------------------------
  603.   # ○ キーヘルプを設定 3
  604.   #--------------------------------------------------------------------------
  605.   def set_keyhelp3
  606.     @bottomkeyhelp_window.clear
  607.     @bottomkeyhelp_window.add("B","返回")
  608.     @bottomkeyhelp_window.add("C","第二个人物确定")
  609.   end
  610. end



  611. #==============================================================================
  612. # □ Window_BottomKeyHelp
  613. #------------------------------------------------------------------------------
  614. #     画面下で操作説明をする透明なウィンドウです。
  615. #==============================================================================
  616. class Window_BottomKeyHelp < Window_Base
  617.   #--------------------------------------------------------------------------
  618.   # ○ オブジェクト初期化
  619.   #--------------------------------------------------------------------------
  620.   def initialize
  621.     super(0, 432, 640, 64)
  622.     self.contents = Bitmap.new(width - 32, height - 32)
  623.     self.opacity = 0
  624.     clear
  625.   end
  626.   #--------------------------------------------------------------------------
  627.   # ○ クリア
  628.   #--------------------------------------------------------------------------
  629.   def clear
  630.     self.contents.clear
  631.     @now_x = 608
  632.   end
  633.   #--------------------------------------------------------------------------
  634.   # ○ 追加
  635.   #--------------------------------------------------------------------------
  636.   def add(key, explanation)
  637.     # 計算
  638.     self.contents.font.size = 20
  639.     x  = self.contents.text_size(key).width
  640.     self.contents.font.size = 16
  641.     x += self.contents.text_size(explanation).width + 8
  642.     @now_x -= x
  643.     # 描写
  644.     self.contents.font.size = 20
  645.     self.contents.font.color = system_color
  646.     self.contents.draw_text(@now_x, 0, x, 32, key, 0)
  647.     self.contents.font.size = 16
  648.     self.contents.font.color = normal_color
  649.     self.contents.draw_text(@now_x, 0, x, 32, explanation, 2)
  650.     # 余白
  651.     @now_x -= 32
  652.   end
  653. end

  654. #==============================================================================
  655. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  656. #==============================================================================
复制代码

点评

没想到自己成功了  发表于 2016-2-17 21:24
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

在本版发帖返回顶部