Advertisement
NightWolf687

WE Simple Banner Menu

Aug 5th, 2014
383
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.54 KB | None | 0 0
  1. #===============================================================================
  2. # DO NOT DETACH THIS HEADER!!!
  3. #===============================================================================
  4. # WE Simple Menu
  5. # By *NightWolf687*
  6. #
  7. # CREDIT *NightWolf687* OR Nuke Games INC.
  8. #
  9. #=============================================================================
  10. # This script creates a simple banner-like pause menu.
  11. #===============================================================================
  12. # Free for commercial and non-commercial games.
  13. # BUT credit is required!
  14. #===============================================================================
  15. # Customizable Section
  16. #===============================================================================
  17.  
  18. module WE
  19.  
  20. XPOS = 0 #<= X position of the Menu
  21. YPOS = 0 #<= Y position of the menu
  22. WIDTH = 545 #<= Width of the Menu
  23. HEIGHT = 50 #<= Height of the Menu
  24. Save_Command_Name = "Save" #<= Save Text
  25. end
  26.  
  27. #----------------------------------------------------------------------------
  28. # Don't edit past here unless you know what you're doing!!!
  29. #----------------------------------------------------------------------------
  30.  
  31. class Window_WE_Menu < Window_HorzCommand
  32.  
  33. #--------------------------------------------------------------------------
  34. # * Load Size Info
  35. #--------------------------------------------------------------------------
  36. def initialize(x, y, width, height)
  37. @window_width = width
  38. @window_height = height
  39. super(x, y)
  40. end
  41. #--------------------------------------------------------------------------
  42. # * Load Window Width
  43. #--------------------------------------------------------------------------
  44. def window_width
  45. @window_width
  46. end
  47. #--------------------------------------------------------------------------
  48. # * Load Window Height
  49. #--------------------------------------------------------------------------
  50. def window_height
  51. @window_height
  52. end
  53. #--------------------------------------------------------------------------
  54. # * Digits
  55. #--------------------------------------------------------------------------
  56. def col_max
  57. return 4
  58. end
  59. #--------------------------------------------------------------------------
  60. # * Command List
  61. #--------------------------------------------------------------------------
  62. def make_command_list
  63. add_command(Vocab::item, :item)
  64. add_command(WE::Save_Command_Name, :save)
  65. add_command(Vocab::equip, :equip)
  66. add_command(Vocab::game_end, :game_end)
  67. end
  68. end
  69.  
  70.  
  71. class Scene_Map < Scene_Base
  72. #--------------------------------------------------------------------------
  73. # * Call Menu
  74. #--------------------------------------------------------------------------
  75. alias :we_call_menu call_menu
  76. def call_menu
  77. we_call_menu
  78. Sound.play_ok
  79. SceneManager.call(Scene_WE_Menu)
  80. Window_MenuCommand::init_command_position
  81. end
  82. end
  83.  
  84. class Scene_WE_Menu < Scene_MenuBase
  85. #--------------------------------------------------------------------------
  86. # * Start Menu
  87. #--------------------------------------------------------------------------
  88. def start
  89. super
  90. create_command_window
  91. end
  92. #--------------------------------------------------------------------------
  93. # * Create Commands
  94. #--------------------------------------------------------------------------
  95. def create_command_window
  96. @command_window = Window_WE_Menu.new(WE::XPOS,WE::YPOS,WE::WIDTH,WE::HEIGHT)
  97. @command_window.set_handler(:item, method(:command_item))
  98. @command_window.set_handler(:save, method(:command_save))
  99. @command_window.set_handler(:equip, method(:command_equip))
  100. @command_window.set_handler(:game_end, method(:command_game_end))
  101. @command_window.set_handler(:cancel, method(:return_scene))
  102. end
  103.  
  104. #--------------------------------------------------------------------------
  105. # * [Item]
  106. #--------------------------------------------------------------------------
  107. def command_item
  108. SceneManager.call(Scene_Item)
  109. end
  110. #--------------------------------------------------------------------------
  111. # * [Save]
  112. #--------------------------------------------------------------------------
  113. def command_save
  114. SceneManager.call(Scene_Save)
  115. end
  116. #---------------------------------------------------------------------------
  117. # * [Equip]
  118. #--------------------------------------------------------------------------
  119. def command_equip
  120. SceneManager.call(Scene_Equip)
  121. end
  122. #--------------------------------------------------------------------------
  123. # * [Exit Game]
  124. #--------------------------------------------------------------------------
  125. def command_game_end
  126. SceneManager.call(Scene_End)
  127. end
  128. #--------------------------------------------------------------------------
  129. # * Return to Game (Un-Pause)
  130. #--------------------------------------------------------------------------
  131. def return_scene
  132. SceneManager.call(Scene_Map)
  133. end
  134. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement