Project1

标题: 想製作這樣的菜單樣式 [打印本页]

作者: POPO70114    时间: 2013-10-24 18:33
标题: 想製作這樣的菜單樣式
如圖




菜單放到底下

只剩下物品和結束遊戲兩種

最左邊有領隊頭像

其餘就和默認一樣

我只會把選項刪到只剩下物品和結束遊戲

其他的不知道該怎麼做

還請各位替小弟解惑

感激不盡!!
作者: 余烬之中    时间: 2013-10-24 20:42
本帖最后由 余烬之中 于 2013-10-24 20:46 编辑

效果图:

方法:
打开脚本编辑器
找到这个:

在其中进行如下改正:






然后再找到这个





完成
完成代码:
Window_MenuCommand
一定要替换原来的而不是插入到原来的之下
也就是说 把原来的删掉 把这个插入
RUBY 代码复制
  1. #encoding:utf-8
  2. #==============================================================================
  3. # ■ Window_MenuCommand
  4. #------------------------------------------------------------------------------
  5. #  菜单画面中显示指令的窗口
  6. #==============================================================================
  7.  
  8. class Window_MenuCommand < Window_HorzCommand
  9.   #--------------------------------------------------------------------------
  10.   # ● 初始化指令选择位置(类方法)
  11.   #--------------------------------------------------------------------------
  12.   def self.init_command_position
  13.     @@last_command_symbol = nil
  14.   end
  15.   #--------------------------------------------------------------------------
  16.   # ● 初始化对象
  17.   #--------------------------------------------------------------------------
  18.   def initialize
  19.     super(96 + 16, Graphics.height - 50)
  20.     select_last
  21.   end
  22.   #--------------------------------------------------------------------------
  23.   # ● 获取窗口的宽度
  24.   #--------------------------------------------------------------------------
  25.   def window_width
  26.     return Graphics.width - 96 - 16
  27.   end
  28.   #--------------------------------------------------------------------------
  29.   # ● 获取显示行数
  30.   #--------------------------------------------------------------------------
  31.   def visible_line_number
  32.     1
  33.   end
  34.   #--------------------------------------------------------------------------
  35.   # ● 生成指令列表
  36.   #--------------------------------------------------------------------------
  37.   def make_command_list
  38.     add_main_commands
  39.     add_formation_command
  40.     add_original_commands
  41.     add_save_command
  42.     add_game_end_command
  43.   end
  44.   #--------------------------------------------------------------------------
  45.   # ● 向指令列表添加主要的指令
  46.   #--------------------------------------------------------------------------
  47.   def add_main_commands
  48.     add_command(Vocab::item,   :item,   main_commands_enabled)
  49. #~     add_command(Vocab::skill,  :skill,  main_commands_enabled)
  50. #~     add_command(Vocab::equip,  :equip,  main_commands_enabled)
  51. #~     add_command(Vocab::status, :status, main_commands_enabled)
  52.   end
  53.   #--------------------------------------------------------------------------
  54.   # ● 添加整队指令
  55.   #--------------------------------------------------------------------------
  56.   def add_formation_command
  57. #~     add_command(Vocab::formation, :formation, formation_enabled)
  58.   end
  59.   #--------------------------------------------------------------------------
  60.   # ● 独自添加指令用
  61.   #--------------------------------------------------------------------------
  62.   def add_original_commands
  63.   end
  64.   #--------------------------------------------------------------------------
  65.   # ● 添加存档指令
  66.   #--------------------------------------------------------------------------
  67.   def add_save_command
  68. #~     add_command(Vocab::save, :save, save_enabled)
  69.   end
  70.   #--------------------------------------------------------------------------
  71.   # ● 添加游戏结束指令
  72.   #--------------------------------------------------------------------------
  73.   def add_game_end_command
  74.     add_command(Vocab::game_end, :game_end)
  75.   end
  76.   #--------------------------------------------------------------------------
  77.   # ● 获取主要指令的有效状态
  78.   #--------------------------------------------------------------------------
  79.   def main_commands_enabled
  80.     $game_party.exists
  81.   end
  82.   #--------------------------------------------------------------------------
  83.   # ● 获取整队的有效状态
  84.   #--------------------------------------------------------------------------
  85.   def formation_enabled
  86.     $game_party.members.size >= 2 && !$game_system.formation_disabled
  87.   end
  88.   #--------------------------------------------------------------------------
  89.   # ● 获取存档的有效状态
  90.   #--------------------------------------------------------------------------
  91.   def save_enabled
  92.     !$game_system.save_disabled
  93.   end
  94.   #--------------------------------------------------------------------------
  95.   # ● 按下确定键时的处理
  96.   #--------------------------------------------------------------------------
  97.   def process_ok
  98.     @@last_command_symbol = current_symbol
  99.     super
  100.   end
  101.   #--------------------------------------------------------------------------
  102.   # ● 返回最后一个选项的位置
  103.   #--------------------------------------------------------------------------
  104.   def select_last
  105.     select_symbol(@@last_command_symbol)
  106.   end
  107.   #||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  108.   #||||||||||||||||||||||||||                     |||||||||||||||||||||||||||
  109.   #||||||||||||||||||||||||||  ●以下是新增内容●  |||||||||||||||||||||||||||
  110.   #||||||||||||||||||||||||||                     |||||||||||||||||||||||||||
  111.   #||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  112.   #--------------------------------------------------------------------------
  113.   # ● 获取列数
  114.   #--------------------------------------------------------------------------
  115.   def col_max
  116.     item_max
  117.   end
  118. end



Scene_Menu
RUBY 代码复制
  1. #encoding:utf-8
  2. #==============================================================================
  3. # ■ Scene_Menu
  4. #------------------------------------------------------------------------------
  5. #  菜单画面
  6. #==============================================================================
  7.  
  8. class Scene_Menu < Scene_MenuBase
  9.   #--------------------------------------------------------------------------
  10.   # ● 开始处理
  11.   #--------------------------------------------------------------------------
  12.   def start
  13.     super
  14.     create_command_window
  15.     create_gold_window
  16.     create_status_window
  17.   end
  18.   #--------------------------------------------------------------------------
  19.   # ● 生成指令窗口
  20.   #--------------------------------------------------------------------------
  21.   def create_command_window
  22.     @command_window = Window_MenuCommand.new
  23.     @command_window.set_handler(:item,      method(:command_item))
  24. #~     @command_window.set_handler(:skill,     method(:command_personal))
  25. #~     @command_window.set_handler(:equip,     method(:command_personal))
  26. #~     @command_window.set_handler(:status,    method(:command_personal))
  27. #~     @command_window.set_handler(:formation, method(:command_formation))
  28. #~     @command_window.set_handler(:save,      method(:command_save))
  29.     @command_window.set_handler(:game_end,  method(:command_game_end))
  30.     @command_window.set_handler(:cancel,    method(:return_scene))
  31.   end
  32.   #--------------------------------------------------------------------------
  33.   # ● 生成金钱窗口
  34.   #--------------------------------------------------------------------------
  35.   ############## 原 ###########
  36. #~   def create_gold_window
  37. #~     @gold_window = Window_Gold.new
  38. #~     @gold_window.x = 0
  39. #~     @gold_window.y = Graphics.height - @gold_window.height
  40. #~   end
  41.   ############## 改 ###########
  42.   def create_gold_window
  43.     @face_window = Window_Base.new(0, Graphics.height - 112, 112, 112)
  44.     @face_window.draw_actor_face($game_party.members[0], 0, 0)
  45.   end
  46.   #--------------------------------------------------------------------------
  47.   # ● 生成状态窗口
  48.   #--------------------------------------------------------------------------
  49.   def create_status_window
  50. #~     @status_window = Window_MenuStatus.new(@command_window.width, 0)
  51.   end
  52.   #--------------------------------------------------------------------------
  53.   # ● 指令“物品”
  54.   #--------------------------------------------------------------------------
  55.   def command_item
  56.     SceneManager.call(Scene_Item)
  57.   end
  58.   #--------------------------------------------------------------------------
  59.   # ● 指令“技能”“装备”“状态”
  60.   #--------------------------------------------------------------------------
  61.   def command_personal
  62.     @status_window.select_last
  63.     @status_window.activate
  64.     @status_window.set_handler(:ok,     method(:on_personal_ok))
  65.     @status_window.set_handler(:cancel, method(:on_personal_cancel))
  66.   end
  67.   #--------------------------------------------------------------------------
  68.   # ● 指令“整队”
  69.   #--------------------------------------------------------------------------
  70.   def command_formation
  71.     @status_window.select_last
  72.     @status_window.activate
  73.     @status_window.set_handler(:ok,     method(:on_formation_ok))
  74.     @status_window.set_handler(:cancel, method(:on_formation_cancel))
  75.   end
  76.   #--------------------------------------------------------------------------
  77.   # ● 指令“存档”
  78.   #--------------------------------------------------------------------------
  79.   def command_save
  80.     SceneManager.call(Scene_Save)
  81.   end
  82.   #--------------------------------------------------------------------------
  83.   # ● 指令“结束游戏”
  84.   #--------------------------------------------------------------------------
  85.   def command_game_end
  86.     SceneManager.call(Scene_End)
  87.   end
  88.   #--------------------------------------------------------------------------
  89.   # ● 个人指令“确定”
  90.   #--------------------------------------------------------------------------
  91.   def on_personal_ok
  92.     case @command_window.current_symbol
  93.     when :skill
  94.       SceneManager.call(Scene_Skill)
  95.     when :equip
  96.       SceneManager.call(Scene_Equip)
  97.     when :status
  98.       SceneManager.call(Scene_Status)
  99.     end
  100.   end
  101.   #--------------------------------------------------------------------------
  102.   # ● 个人指令“取消”
  103.   #--------------------------------------------------------------------------
  104.   def on_personal_cancel
  105.     @status_window.unselect
  106.     @command_window.activate
  107.   end
  108.   #--------------------------------------------------------------------------
  109.   # ● 整队“确定”
  110.   #--------------------------------------------------------------------------
  111.   def on_formation_ok
  112.     if @status_window.pending_index >= 0
  113.       $game_party.swap_order(@status_window.index,
  114.                              @status_window.pending_index)
  115.       @status_window.pending_index = -1
  116.       @status_window.redraw_item(@status_window.index)
  117.     else
  118.       @status_window.pending_index = @status_window.index
  119.     end
  120.     @status_window.activate
  121.   end
  122.   #--------------------------------------------------------------------------
  123.   # ● 整队“取消”
  124.   #--------------------------------------------------------------------------
  125.   def on_formation_cancel
  126.     if @status_window.pending_index >= 0
  127.       @status_window.pending_index = -1
  128.       @status_window.activate
  129.     else
  130.       @status_window.unselect
  131.       @command_window.activate
  132.     end
  133.   end
  134. end

作者: tseyik    时间: 2013-10-24 20:43
這様?

[attachimg]199226[/attachim]

01.png (120.28 KB, 下载次数: 21)

01.png





欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1