AriArk

AriArk's Menu Options

Sep 3rd, 2013
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.31 KB | None | 0 0
  1. #--------------------------------------------------------------------------
  2. # AriArk's Menu Options
  3. # Vesion 1.00
  4. #--------------------------------------------------------------------------
  5. # This script will let you add menu options to the menu scene.
  6. #--------------------------------------------------------------------------
  7. class Scene_Menu < Scene_MenuBase
  8. #--------------------------------------------------------------------------
  9. # CUSTOM SETTINGS
  10. #--------------------------------------------------------------------------
  11. # I am using Load as an example menu option, change this to use your own.
  12. #--------------------------------------------------------------------------
  13. # Just change and copy paste the load commands.
  14. #--------------------------------------------------------------------------
  15. def create_command_window
  16. @command_window = Window_MenuCommand.new
  17. @command_window.set_handler(:item, method(:command_item))
  18. @command_window.set_handler(:skill, method(:command_personal))
  19. @command_window.set_handler(:equip, method(:command_personal))
  20. @command_window.set_handler(:status, method(:command_personal))
  21. @command_window.set_handler(:formation, method(:command_formation))
  22. @command_window.set_handler(:save, method(:command_save))
  23. @command_window.set_handler(:game_end, method(:command_game_end))
  24. @command_window.set_handler(:cancel, method(:return_scene))
  25. # @command_window.set_handler(:load, method(:command_load))
  26. end
  27. end
  28. #---------------------------------------------------------------------------
  29. class Window_MenuCommand < Window_Command
  30. #---------------------------------------------------------------------------
  31. # DO NOT TOUCH
  32. #---------------------------------------------------------------------------
  33. def make_command_list
  34. add_main_commands
  35. add_formation_command
  36. add_custom_commands
  37. add_original_commands
  38. add_save_command
  39. add_game_end_command
  40. end
  41. #--------------------------------------------------------------------------
  42. # END OF DO NOT TOUCH
  43. #--------------------------------------------------------------------------
  44. #--------------------------------------------------------------------------
  45. # * Add Custom Commands to Command List
  46. #--------------------------------------------------------------------------
  47. def add_custom_commands
  48. # add_command("Load", :load, main_commands_enabled)
  49. # add_command("Text", :x, main_commands_enabled)
  50. end
  51. end
  52. #--------------------------------------------------------------------------
  53. class Scene_Menu < Scene_MenuBase
  54. #--------------------------------------------------------------------------
  55. # Custom Command
  56. #--------------------------------------------------------------------------
  57. def command_load
  58. # SceneManager.call(Scene_Load)
  59. end
  60. #--------------------------------------------------------------------------
  61. # Personal Command
  62. #--------------------------------------------------------------------------
  63. # These is the commands in which you select the actor.
  64. #--------------------------------------------------------------------------
  65. def on_personal_ok
  66. case @command_window.current_symbol
  67. when :skill
  68. SceneManager.call(Scene_Skill)
  69. when :equip
  70. SceneManager.call(Scene_Equip)
  71. when :status
  72. SceneManager.call(Scene_Status)
  73. # when :z
  74. # SceneManager.call(Scene_y)
  75. end
  76. end
  77. #----------------------------------------------------------------------------
  78. # END OF CUSTOM SETTINGS
  79. #----------------------------------------------------------------------------
  80. def start
  81. super
  82. create_command_window
  83. create_gold_window
  84. create_status_window
  85. end
  86.  
  87. def create_gold_window
  88. @gold_window = Window_Gold.new
  89. @gold_window.x = 0
  90. @gold_window.y = Graphics.height - @gold_window.height
  91. end
  92.  
  93. def create_status_window
  94. @status_window = Window_MenuStatus.new(@command_window.width, 0)
  95. end
  96.  
  97. def command_item
  98. SceneManager.call(Scene_Item)
  99. end
  100.  
  101. def command_personal
  102. @status_window.select_last
  103. @status_window.activate
  104. @status_window.set_handler(:ok, method(:on_personal_ok))
  105. @status_window.set_handler(:cancel, method(:on_personal_cancel))
  106. end
  107.  
  108. def command_formation
  109. @status_window.select_last
  110. @status_window.activate
  111. @status_window.set_handler(:ok, method(:on_formation_ok))
  112. @status_window.set_handler(:cancel, method(:on_formation_cancel))
  113. end
  114.  
  115. def command_save
  116. SceneManager.call(Scene_Save)
  117. end
  118.  
  119. def command_game_end
  120. SceneManager.call(Scene_End)
  121. end
  122.  
  123. def on_personal_cancel
  124. @status_window.unselect
  125. @command_window.activate
  126. end
  127.  
  128. def on_formation_ok
  129. if @status_window.pending_index >= 0
  130. $game_party.swap_order(@status_window.index,
  131. @status_window.pending_index)
  132. @status_window.pending_index = -1
  133. @status_window.redraw_item(@status_window.index)
  134. else
  135. @status_window.pending_index = @status_window.index
  136. end
  137. @status_window.activate
  138. end
  139.  
  140. def on_formation_cancel
  141. if @status_window.pending_index >= 0
  142. @status_window.pending_index = -1
  143. @status_window.activate
  144. else
  145. @status_window.unselect
  146. @command_window.activate
  147. end
  148. end
  149. end
Advertisement
Add Comment
Please, Sign In to add comment