Advertisement
Demonicskyers

Dodatkowe Scene_Menu

Jul 13th, 2013
484
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 5.38 KB | None | 0 0
  1. #-------------------------------------------------------------------------------
  2. # Wklejaj ten skrypt razem z Edytowanym Scene_Menu TYLKO jeżeli nie masz innego skryptu na CMS.
  3. #-------------------------------------------------------------------------------
  4. # This rewrite of Scene_Menu just adds the Quests option into the menu, and it
  5. # makes the number of menu features longer.
  6. #
  7. # I did not edit any other window in the system, so you will see the QUIT option
  8. # print overtop of the Game Time window in the screen.  I merely wanted to show
  9. # how to call the Quest Window from a menu or script.
  10. #-------------------------------------------------------------------------------
  11.  
  12.  
  13. #==============================================================================
  14. # ** Scene_Menu
  15. #------------------------------------------------------------------------------
  16. #  This class performs menu screen processing.
  17. #==============================================================================
  18.  
  19. class Scene_Menu
  20.   #--------------------------------------------------------------------------
  21.   # * Main Processing
  22.   #--------------------------------------------------------------------------
  23.   def main
  24.     # Make command window
  25.     s1 = $data_system.words.item
  26.     s2 = $data_system.words.skill
  27.     s3 = $data_system.words.equip
  28.     s4 = "Status"
  29.     # Changed the s5 from Save to Quests, added an s7 to make the list longer
  30.     s5 = "Quests"
  31.     s6 = "Save"
  32.     s7 = "End Game"
  33.     # Added the s7 to the command window
  34.     @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
  35.     @command_window.index = @menu_index
  36.     # If number of party members is 0
  37.     if $game_party.actors.size == 0
  38.       # Disable items, skills, equipment, and status
  39.       @command_window.disable_item(0)
  40.       @command_window.disable_item(1)
  41.       @command_window.disable_item(2)
  42.       @command_window.disable_item(3)
  43.     end
  44.     # Make play time window
  45.     @playtime_window = Window_PlayTime.new
  46.     @playtime_window.x = 0
  47.     @playtime_window.y = 320
  48.     # Make steps window
  49.     # Make gold window
  50.     @gold_window = Window_Gold.new
  51.     @gold_window.x = 0
  52.     @gold_window.y = 416
  53.     # Make status window
  54.     @status_window = Window_MenuStatus.new
  55.     @status_window.x = 160
  56.     @status_window.y = 0
  57.     # Execute transition
  58.     Graphics.transition
  59.     # Main loop
  60.     loop do
  61.       # Update game screen
  62.       Graphics.update
  63.       # Update input information
  64.       Input.update
  65.       # Frame update
  66.       update
  67.       # Abort loop if screen is changed
  68.       if $scene != self
  69.         break
  70.       end
  71.     end
  72.     # Prepare for transition
  73.     Graphics.freeze
  74.     # Dispose of windows
  75.     @command_window.dispose
  76.     @playtime_window.dispose
  77.     @gold_window.dispose
  78.     @status_window.dispose
  79.   end
  80.   #--------------------------------------------------------------------------
  81.   # * Frame Update (when command window is active)
  82.   #--------------------------------------------------------------------------
  83.   def update_command
  84.     # If B button was pressed
  85.     if Input.trigger?(Input::B)
  86.       # Play cancel SE
  87.       $game_system.se_play($data_system.cancel_se)
  88.       # Switch to map screen
  89.       $scene = Scene_Map.new
  90.       return
  91.     end
  92.     # If C button was pressed
  93.     if Input.trigger?(Input::C)
  94.       # If command other than save or end game, and party members = 0
  95.       if $game_party.actors.size == 0 and @command_window.index < 4
  96.         # Play buzzer SE
  97.         $game_system.se_play($data_system.buzzer_se)
  98.         return
  99.       end
  100.       # Branch by command window cursor position
  101.       case @command_window.index
  102.       when 0  # item
  103.         # Play decision SE
  104.         $game_system.se_play($data_system.decision_se)
  105.         # Switch to item screen
  106.         $scene = Scene_Item.new
  107.       when 1  # skill
  108.         # Play decision SE
  109.         $game_system.se_play($data_system.decision_se)
  110.         # Make status window active
  111.         @command_window.active = false
  112.         @status_window.active = true
  113.         @status_window.index = 0
  114.       when 2  # equipment
  115.         # Play decision SE
  116.         $game_system.se_play($data_system.decision_se)
  117.         # Make status window active
  118.         @command_window.active = false
  119.         @status_window.active = true
  120.         @status_window.index = 0
  121.       when 3  # status
  122.         # Play decision SE
  123.         $game_system.se_play($data_system.decision_se)
  124.         # Make status window active
  125.         @command_window.active = false
  126.         @status_window.active = true
  127.         @status_window.index = 0
  128.       # Changed #4 to the Quest menu (instead of save)
  129.       when 4  # quest
  130.         # This is for quests now:
  131.         $game_temp.quest_menu_calling = true
  132.         $scene = Scene_Quests.new
  133.       # Changed 5 on down to keep save and quit in the menu...
  134.       when 5  # save
  135.         # If saving is forbidden
  136.         if $game_system.save_disabled
  137.           # Play buzzer SE
  138.           $game_system.se_play($data_system.buzzer_se)
  139.           return
  140.         end
  141.         # Play decision SE
  142.         $game_system.se_play($data_system.decision_se)
  143.         # Switch to save screen
  144.         $scene = Scene_Save.new
  145.       when 6  # end game
  146.         # Play decision SE
  147.         $game_system.se_play($data_system.decision_se)
  148.         # Switch to end game screen
  149.         $scene = Scene_End.new
  150.       end
  151.       return
  152.     end
  153.   end
  154. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement