Advertisement
Guest User

Untitled

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