Advertisement
Dekita

$D13x Pause Menu v1.0

Mar 28th, 2013
423
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.06 KB | None | 0 0
  1. if true # << Make true to use this script, false to disable.
  2. #===============================================================================
  3. #
  4. # ☆ $D13x - Pause Menu
  5. # -- Author : Dekita
  6. # -- Version : 1.0
  7. # -- Level : Easy / Normal
  8. # -- Requires : N/A
  9. # -- Engine : RPG Maker VX Ace.
  10. #
  11. #===============================================================================
  12. # ☆ Import
  13. #-------------------------------------------------------------------------------
  14. $D13x={}if$D13x==nil
  15. $D13x[:Pause_Menu]=true
  16. #===============================================================================
  17. # ☆ Updates
  18. #-------------------------------------------------------------------------------
  19. # D /M /Y
  20. # 28/o3/2o13 - Finished,
  21. # 27/o3/2o13 - Started
  22. #
  23. #===============================================================================
  24. # ☆ Introduction
  25. #-------------------------------------------------------------------------------
  26. # This script modifies Scene_End and allows it to use graphics for each command
  27. # option.
  28. #
  29. # I Highly reccommend using this paired with my $D13x - Scene Backgrounds script
  30. # And my $D13x - Key Menu Script, this will give you the ability to create
  31. # highly unique 'Pause' screens with minimum effort.
  32. #
  33. #===============================================================================
  34. # ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
  35. #===============================================================================
  36. # 1. You MUST give credit to "Dekita" !!
  37. # 2. You are NOT allowed to repost this script.(or modified versions)
  38. # 3. You are NOT allowed to convert this script.
  39. # 4. You are NOT allowed to use this script for Commercial games.
  40. # 5. ENJOY!
  41. #
  42. # "FINE PRINT"
  43. # By using this script you hereby agree to the above terms and conditions,
  44. # if any violation of the above terms occurs "legal action" may be taken.
  45. # Not understanding the above terms and conditions does NOT mean that
  46. # they do not apply to you.
  47. # If you wish to discuss the terms and conditions in further detail you can
  48. # contact me at http://dekitarpg.wordpress.com/
  49. #
  50. #===============================================================================
  51. # ☆ Instructions
  52. #-------------------------------------------------------------------------------
  53. # Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
  54. #
  55. #===============================================================================
  56. module GE_Graph
  57. #===============================================================================
  58.  
  59. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  60. # ☆ General Settings
  61. #-----------------------------------------------------------------------------
  62. # All Command Graphics Must be in the below folder.
  63. Graphics_Folder = "Graphics/$D13x Game End/"
  64. #-----------------------------------------------------------------------------
  65. # Opacity [ min , max, increase per frame]
  66. Opacity = [ 80 , 255 , 2]
  67. #-----------------------------------------------------------------------------
  68. # Visible Commands.
  69. # Command , Name , Graphic , y , Hue , z ]
  70. Commands=[
  71. [:continue, "Continue", "Continue", 200, 0, 50],
  72. # [:to_menu , "To Menu" , "To_Menu" , 230, 0, 50],
  73. [:to_title, "To Title", "To_Title", 250, 0, 50],
  74. [:shutdown, "Shutdown", "ShutDown", 300, 0, 50],
  75. ]
  76. #-----------------------------------------------------------------------------
  77. # Remove ' Game End ' option from main menu
  78. Remove_From_Menu = true
  79.  
  80. end #####################
  81. # CUSTOMISATION END #
  82. #####################
  83. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
  84. # #
  85. # http://dekitarpg.wordpress.com/ #
  86. # #
  87. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  88. #===============================================================================#
  89. # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
  90. # YES?\.\. #
  91. # OMG, REALLY? \| #
  92. # WELL SLAP MY FACE AND CALL ME A DRAGONITE.\..\.. #
  93. # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
  94. #===============================================================================#
  95. module Cache
  96. #===============================================================================
  97. #--------------------------------------------------------------------------
  98. # Get Windowskin
  99. #--------------------------------------------------------------------------
  100. def self.sd13x_GE(name, hue=0)
  101. load_bitmap(GE_Graph::Graphics_Folder, name, hue)
  102. end
  103.  
  104. end
  105.  
  106. #===============================================================================
  107. class Window_MenuCommand < Window_Command
  108. #===============================================================================
  109. #--------------------------------------------------------------------------
  110. # Add Exit Game to Command List
  111. #--------------------------------------------------------------------------
  112. if GE_Graph::Remove_From_Menu
  113. def add_game_end_command
  114. end
  115. end
  116.  
  117. end
  118.  
  119. #===============================================================================
  120. class Window_GameEnd < Window_Command
  121. #===============================================================================
  122. #--------------------------------------------------------------------------
  123. # Update Window Position
  124. #--------------------------------------------------------------------------
  125. def update_placement
  126. self.x = 0 - width
  127. self.y = 0 - height
  128. end
  129. #--------------------------------------------------------------------------
  130. # Create Command List
  131. #--------------------------------------------------------------------------
  132. def make_command_list
  133. for command in GE_Graph::Commands
  134. add_command(command[1],command[0])
  135. end
  136. end
  137.  
  138. end
  139.  
  140. #==============================================================================
  141. class SE_CMND_Graphs < Sprite
  142. #==============================================================================
  143. #--------------------------------------------------------------------------
  144. # Create
  145. #--------------------------------------------------------------------------
  146. def initialize(set)
  147. super(nil)
  148. self.bitmap = Cache.sd13x_GE(set[2], set[4])
  149. self.x = Graphics.width/2-(self.bitmap.width/2)
  150. self.opacity = GE_Graph::Opacity[0]
  151. self.y = set[3]
  152. self.z = set[5]
  153. end
  154. #--------------------------------------------------------------------------
  155. # Give Up
  156. #--------------------------------------------------------------------------
  157. def dispose
  158. super
  159. end
  160. #--------------------------------------------------------------------------
  161. # Try Again
  162. #--------------------------------------------------------------------------
  163. def update
  164. super
  165. if self.opacity < GE_Graph::Opacity[1]
  166. self.opacity += GE_Graph::Opacity[2]
  167. end
  168. end
  169.  
  170. end
  171.  
  172. #==============================================================================
  173. class Scene_End < Scene_MenuBase
  174. #==============================================================================
  175. #--------------------------------------------------------------------------
  176. # Alias List
  177. #--------------------------------------------------------------------------
  178. alias :pausemenu_ptmin_SEND :pre_terminate
  179. alias :pausemenu_ccmnd_SEND :create_command_window
  180. #--------------------------------------------------------------------------
  181. # Create Command Window
  182. #--------------------------------------------------------------------------
  183. def create_command_window
  184. pausemenu_ccmnd_SEND
  185. @command_window.set_handler(:continue, method(:return_scene))
  186. @command_window.set_handler(:to_menu, method(:command_to_menu))
  187. create_command_images
  188. end
  189. #--------------------------------------------------------------------------
  190. # Create Images
  191. #--------------------------------------------------------------------------
  192. def create_command_images
  193. @cmnd_images = []
  194. for command in GE_Graph::Commands
  195. @cmnd_images << SE_CMND_Graphs.new(command)
  196. end
  197. @cmnd_images.each {|cmnd| cmnd.opacity = 0}
  198. end
  199. #--------------------------------------------------------------------------
  200. # [Go to Menu] Command
  201. #--------------------------------------------------------------------------
  202. def command_to_menu
  203. Sound.play_ok
  204. SceneManager.call(Scene_Menu)
  205. Window_MenuCommand::init_command_position
  206. end
  207. #--------------------------------------------------------------------------
  208. # Pre-Termination Processing
  209. #--------------------------------------------------------------------------
  210. def pre_terminate
  211. pausemenu_ptmin_SEND
  212. @cmnd_images.each {|cmnd| cmnd.dispose } if @cmnd_images
  213. end
  214. #--------------------------------------------------------------------------
  215. # Update
  216. #--------------------------------------------------------------------------
  217. def update
  218. super
  219. if @cmnd_images
  220. counter = 0
  221. @cmnd_images.each do |cmnd|
  222. cmnd.opacity = GE_Graph::Opacity[0] if @command_window.index != counter
  223. counter += 1
  224. end
  225. @cmnd_images[@command_window.index].update
  226. end
  227. end
  228.  
  229. end
  230.  
  231. #==============================================================================#
  232. # http://dekitarpg.wordpress.com/ #
  233. #==============================================================================#
  234. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement