Guest User

Untitled

a guest
Oct 10th, 2016
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.21 KB | None | 0 0
  1. #===============================================================================
  2. #
  3. # DT's One Person Menu
  4. # Author: DoctorTodd
  5. # Date (02/19/2012)
  6. # Type: (Menu)
  7. # Version: (1.0.0) (VXA)
  8. # Level: (Simple)
  9. #
  10. #===============================================================================
  11. #
  12. # NOTES: 1)This script will only work with ace, you may find my VX version on
  13. # RMRK.net and the rpg maker web forums.
  14. #
  15. #===============================================================================
  16. #
  17. # Description: A menu that is modified to work as if you are only using one
  18. # actor.
  19. #
  20. # Credits: Me (DoctorTodd)
  21. #
  22. #===============================================================================
  23. #
  24. # Instructions
  25. # Paste above main.
  26. #
  27. #===============================================================================
  28. #
  29. # Contact me for commercial use, other wise just credit me and don't repost
  30. # without my permission.
  31. #
  32. #===============================================================================
  33. #
  34. # Editing begins 40 and ends on 59.
  35. #
  36. #===============================================================================
  37. module DTOPM
  38.  
  39. #Window skin to use, place in system.
  40. WINDOW = ('Window')
  41.  
  42. #Status Window X
  43. SX = 10
  44.  
  45. #Status Window Y
  46. SY = 10
  47.  
  48. #Command Window X
  49. CX = 10
  50.  
  51. #Command Window Y
  52. CY = 170
  53. end
  54.  
  55. class Scene_Menu < Scene_MenuBase
  56. #--------------------------------------------------------------------------
  57. # * Start processing
  58. #--------------------------------------------------------------------------
  59. def start
  60. super
  61. create_background
  62. create_command_window
  63. create_status_window
  64. end
  65. #--------------------------------------------------------------------------
  66. # * Create Gold Window
  67. #--------------------------------------------------------------------------
  68. def create_gold_window
  69. @gold_window = Window_Gold.new
  70. @gold_window.x = (DTOPM::GX)
  71. @gold_window.y = (DTOPM::GY)
  72. @gold_window.windowskin = Cache.system(DTOPM::WINDOW)
  73. @gold_window.height = 55
  74. end
  75. #--------------------------------------------------------------------------
  76. # * Create Status Window
  77. #--------------------------------------------------------------------------
  78. def create_status_window
  79. @status_window = Window_MenuInfo.new((DTOPM::SX), (DTOPM::SY))
  80. @status_window.windowskin = Cache.system(DTOPM::WINDOW)
  81. end
  82. #--------------------------------------------------------------------------
  83. # * Create Command Window
  84. #--------------------------------------------------------------------------
  85. def create_command_window
  86. @command_window = Window_MenuCommand.new
  87. @command_window.set_handler(:item, method(:command_item))
  88. @command_window.set_handler(:save, method(:command_save))
  89. @command_window.set_handler(:cancel, method(:return_scene))
  90. @command_window.x = (DTOPM::CX)
  91. @command_window.y = (DTOPM::CY)
  92. end
  93. end
  94. #--------------------------------------------------------------------------
  95. # * [Item] Command
  96. #--------------------------------------------------------------------------
  97. def command_item
  98. SceneManager.call(Scene_Item)
  99. end
  100. #--------------------------------------------------------------------------
  101. # * [Save] Command
  102. #--------------------------------------------------------------------------
  103. def command_save
  104. SceneManager.call(Scene_Save)
  105. end
  106. #===================================================================
  107. # ** Window_MenuStatus
  108. #------------------------------------------------------------------------------
  109. # This window displays the characters status on the menu screen.
  110. #==============================================================================
  111.  
  112. class Window_MenuInfo < Window_Base
  113. #--------------------------------------------------------------------------
  114. # * Object Initialization
  115. # x : window X coordinate
  116. # y : window Y coordinate
  117. #--------------------------------------------------------------------------
  118. def initialize(x, y)
  119. super(x, y, 88, 152)
  120. refresh
  121. end
  122. #--------------------------------------------------------------------------
  123. # * Refresh
  124. #--------------------------------------------------------------------------
  125. def refresh
  126. self.contents.clear
  127. @actor = $game_party.members[0]
  128. draw_actor_face(@actor, 0, 0, width = 92)
  129. draw_actor_name(@actor, 12, 104)
  130. end
  131. end
  132. #==============================================================================
  133. # ** Window_MenuCommand
  134. #------------------------------------------------------------------------------
  135. # This command window appears on the menu screen.
  136. #==============================================================================
  137.  
  138. class Window_MenuCommand < Window_Command
  139. #--------------------------------------------------------------------------
  140. # * Initialize Command Selection Position (Class Method)
  141. #--------------------------------------------------------------------------
  142. def self.init_command_position
  143. @@last_command_symbol = nil
  144. end
  145. #--------------------------------------------------------------------------
  146. # * Object Initialization
  147. #--------------------------------------------------------------------------
  148. def initialize
  149. super(0, 0)
  150. select_last
  151. end
  152. #--------------------------------------------------------------------------
  153. # * Get Window Width
  154. #--------------------------------------------------------------------------
  155. def window_width
  156. return 88
  157. end
  158. #--------------------------------------------------------------------------
  159. # * Get Number of Lines to Show
  160. #--------------------------------------------------------------------------
  161. def visible_line_number
  162. item_max
  163. end
  164. #--------------------------------------------------------------------------
  165. # * Create Command List
  166. #--------------------------------------------------------------------------
  167. def make_command_list
  168. add_main_commands
  169. add_original_commands
  170. add_save_command
  171. end
  172. #--------------------------------------------------------------------------
  173. # * Add Main Commands to List
  174. #--------------------------------------------------------------------------
  175. def add_main_commands
  176. add_command(Vocab::item, :item, main_commands_enabled)
  177. end
  178. #--------------------------------------------------------------------------
  179. # * For Adding Original Commands
  180. #--------------------------------------------------------------------------
  181. def add_original_commands
  182. end
  183. #--------------------------------------------------------------------------
  184. # * Add Save to Command List
  185. #--------------------------------------------------------------------------
  186. def add_save_command
  187. add_command(Vocab::save, :save, save_enabled)
  188. end
  189. #--------------------------------------------------------------------------
  190. # * Get Activation State of Main Commands
  191. #--------------------------------------------------------------------------
  192. def main_commands_enabled
  193. $game_party.exists
  194. end
  195. #--------------------------------------------------------------------------
  196. # * Get Activation State of Formation
  197. #--------------------------------------------------------------------------
  198. def formation_enabled
  199. $game_party.members.size >= 2 && !$game_system.formation_disabled
  200. end
  201. #--------------------------------------------------------------------------
  202. # * Get Activation State of Save
  203. #--------------------------------------------------------------------------
  204. def save_enabled
  205. !$game_system.save_disabled
  206. end
  207. #--------------------------------------------------------------------------
  208. # * Processing When OK Button Is Pressed
  209. #--------------------------------------------------------------------------
  210. def process_ok
  211. @@last_command_symbol = current_symbol
  212. super
  213. end
  214. #--------------------------------------------------------------------------
  215. # * Restore Previous Selection Position
  216. #--------------------------------------------------------------------------
  217. def select_last
  218. select_symbol(@@last_command_symbol)
  219. end
  220. end
Advertisement
Add Comment
Please, Sign In to add comment