Project1

标题: 人物加点如何在菜单中显示? [打印本页]

作者: Cherry    时间: 2011-6-30 22:30
标题: 人物加点如何在菜单中显示?
http://rpg.blue/thread-83054-1-1.html
人物加点如何在菜单中显示?dsu_plus_rewardpost_czw
作者: 我的米呀    时间: 2011-6-30 23:59
本帖最后由 我的米呀 于 2011-7-1 09:37 编辑

学习了下知道怎么改了!!
把这个覆盖掉Scene_Menue
  1. #==============================================================================
  2. # ■ Scene_Menu
  3. #------------------------------------------------------------------------------
  4. #  处理菜单画面的类。
  5. #==============================================================================

  6. class Scene_Menu < Scene_Base
  7.   #--------------------------------------------------------------------------
  8.   # ● 初始化对像
  9.   #     menu_index : 命令窗口光标初始位置
  10.   #--------------------------------------------------------------------------
  11.   def initialize(menu_index = 0)
  12.     @menu_index = menu_index
  13.   end
  14.   #--------------------------------------------------------------------------
  15.   # ● 开始处理
  16.   #--------------------------------------------------------------------------
  17.   def start
  18.     super
  19.     create_menu_background
  20.     create_command_window
  21.     @gold_window = Window_Gold.new(0, 360)
  22.     @status_window = Window_MenuStatus.new(160, 0)
  23.   end
  24.   #--------------------------------------------------------------------------
  25.   # ● 结束处理
  26.   #--------------------------------------------------------------------------
  27.   def terminate
  28.     super
  29.     dispose_menu_background
  30.     @command_window.dispose
  31.     @gold_window.dispose
  32.     @status_window.dispose
  33.   end
  34.   #--------------------------------------------------------------------------
  35.   # ● 更新画面
  36.   #--------------------------------------------------------------------------
  37.   def update
  38.     super
  39.     update_menu_background
  40.     @command_window.update
  41.     @gold_window.update
  42.     @status_window.update
  43.     if @command_window.active
  44.       update_command_selection
  45.     elsif @status_window.active
  46.       update_actor_selection
  47.     end
  48.   end
  49.   #--------------------------------------------------------------------------
  50.   # ● 生成命令窗口
  51.   #--------------------------------------------------------------------------
  52.   def create_command_window
  53.     s1 = Vocab::item
  54.     s2 = Vocab::skill
  55.     s3 = Vocab::equip
  56.     s4 = Vocab::status
  57.     s5 = "手动加点"
  58.     s6 = Vocab::save
  59.     s7 = Vocab::game_end
  60.     s8 = Vocab::game_end
  61.     @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6,s7])
  62.     @command_window.index = @menu_index
  63.     if $game_party.members.size == 0          # 如果队伍为空
  64.       @command_window.draw_item(0, false)     # 无效化物品选项
  65.       @command_window.draw_item(1, false)     # 无效化技能选项
  66.       @command_window.draw_item(2, false)     # 无效化装备选项
  67.       @command_window.draw_item(3, false)     # 无效化状态选项
  68.     end
  69.     if $game_system.save_disabled             # 如果禁止存档
  70.       @command_window.draw_item(4, false)     # 无效化存档选项
  71.     end
  72.   end
  73.   #--------------------------------------------------------------------------
  74.   # ● 更新命令窗口
  75.   #--------------------------------------------------------------------------
  76.   def update_command_selection
  77.     if Input.trigger?(Input::B)
  78.       Sound.play_cancel
  79.       $scene = Scene_Map.new
  80.     elsif Input.trigger?(Input::C)
  81.       if $game_party.members.size == 0 and @command_window.index < 4
  82.         Sound.play_buzzer
  83.         return
  84.       elsif $game_system.save_disabled and @command_window.index == 4
  85.         Sound.play_buzzer
  86.         return
  87.       end
  88.       Sound.play_decision
  89.       case @command_window.index
  90.       when 0      # 物品
  91.         $scene = Scene_Item.new
  92.       when 1,2,3  # 技能、装备、状态
  93.         start_actor_selection
  94.       when 4
  95.         $scene = Scene_Lvup.new
  96.       when 5      # 存档
  97.         $scene = Scene_File.new(true, false, false)
  98.       when 6      # 结束游戏
  99.         $scene = Scene_End.new
  100.       end
  101.     end
  102.   end
  103.   #--------------------------------------------------------------------------
  104.   # ● 角色选择开始
  105.   #--------------------------------------------------------------------------
  106.   def start_actor_selection
  107.     @command_window.active = false
  108.     @status_window.active = true
  109.     if $game_party.last_actor_index < @status_window.item_max
  110.       @status_window.index = $game_party.last_actor_index
  111.     else
  112.       @status_window.index = 0
  113.     end
  114.   end
  115.   #--------------------------------------------------------------------------
  116.   # ● 角色选择结束
  117.   #--------------------------------------------------------------------------
  118.   def end_actor_selection
  119.     @command_window.active = true
  120.     @status_window.active = false
  121.     @status_window.index = -1
  122.   end
  123.   #--------------------------------------------------------------------------
  124.   # ● 角色选择更新
  125.   #--------------------------------------------------------------------------
  126.   def update_actor_selection
  127.     if Input.trigger?(Input::B)
  128.       Sound.play_cancel
  129.       end_actor_selection
  130.     elsif Input.trigger?(Input::C)
  131.       $game_party.last_actor_index = @status_window.index
  132.       Sound.play_decision
  133.       case @command_window.index
  134.       when 1  # 技能
  135.         $scene = Scene_Skill.new(@status_window.index)
  136.       when 2  # 装备
  137.         $scene = Scene_Equip.new(@status_window.index)
  138.       when 3  # 状态
  139.         $scene = Scene_Status.new(@status_window.index)
  140.       end
  141.     end
  142.   end
  143. end
复制代码

作者: Cherry    时间: 2011-7-6 10:26
我又懂了:
  1. VOCAB_MENU_ENEMY_GUIDE = "怪物图鉴"
  2. OPTION_NAME = "系统音量"
  3. VOCAB_MENU_PARTYFORM = "队伍编成"
  4. OPTION_name = "人物加点"
  5. #==============================================================================
  6. # ■ Scene_Menu
  7. #==============================================================================
  8. class Scene_Menu < Scene_Base
  9. #--------------------------------------------------------------------------
  10. # ● 生成指令窗口
  11. #--------------------------------------------------------------------------
  12. def create_command_window
  13. s1 = Vocab::item
  14. s2 = Vocab::skill
  15. s3 = Vocab::equip
  16. s4 = Vocab::status
  17. s5 = OPTION_name
  18. s6 = VOCAB_MENU_ENEMY_GUIDE
  19. s7 = VOCAB_MENU_PARTYFORM
  20. s8 = Vocab::save
  21. s9 = OPTION_NAME
  22. s10 = Vocab::game_end
  23. @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7, s8, s9, s10])
  24. @command_window.index = @menu_index
  25. if $game_party.members.size == 0 # 同伴人数为 0 的情况下
  26. @command_window.draw_item(0, false) # 物品无效化
  27. @command_window.draw_item(1, false) # 特技无效化
  28. @command_window.draw_item(2, false) # 装备无效化
  29. @command_window.draw_item(3, false) # 状态无效化
  30. end
  31. if $game_system.save_disabled # 禁止存档的情况下
  32. @command_window.draw_item(4, false) # 存档无效化
  33. end
  34. end
  35. #--------------------------------------------------------------------------
  36. # ● 更新指令选择
  37. #--------------------------------------------------------------------------
  38. def update_command_selection
  39. if Input.trigger?(Input::B)
  40. Sound.play_cancel
  41. $scene = Scene_Map.new
  42. elsif Input.trigger?(Input::C)
  43. if $game_party.members.size == 0 and @command_window.index < 4
  44. Sound.play_buzzer
  45. return
  46. elsif $game_system.save_disabled and @command_window.index == 4
  47. Sound.play_buzzer
  48. return
  49. end
  50. Sound.play_decision
  51. case @command_window.index
  52. when 0  
  53. $scene = Scene_Item.new
  54. when 1
  55. $scene = Scene_Skill.new
  56. when 2
  57. $scene = Scene_Equip.new
  58. when 3
  59. $scene = Scene_Status.new
  60. when 4
  61. $scene = Scene_Lvup.new
  62. when 5
  63. $scene = Scene_EnemyGuide.new
  64. when 6
  65. $scene = Scene_PartyForm.new
  66. when 7  
  67. $scene = Scene_File.new(true, false, false)
  68. when 8  
  69. $scene = Scene_System.new
  70. when 9  
  71. $scene = Scene_End.new
  72. end
  73. end
  74. end
  75. end
复制代码

作者: 小凡哥    时间: 2011-8-6 17:35
我又懂了:

下面这个脚本是干吗的?




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